diff --git a/notNeededPackages.json b/notNeededPackages.json index eebd1140de..a91bf4f1e5 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -396,6 +396,12 @@ "sourceRepoURL": "https://github.com/date-fns/date-fns", "asOfVersion": "2.6.0" }, + { + "libraryName": "dd-trace", + "typingsPackageName": "dd-trace", + "sourceRepoURL": "https://github.com/DataDog/dd-trace-js", + "asOfVersion": "0.9.0" + }, { "libraryName": "decimal.js", "typingsPackageName": "decimal.js", @@ -414,6 +420,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/delay", "asOfVersion": "3.1.0" }, + { + "libraryName": "detect-browser", + "typingsPackageName": "detect-browser", + "sourceRepoURL": "https://github.com/DamonOehlman/detect-browser", + "asOfVersion": "4.0.0" + }, { "libraryName": "DevExtreme", "typingsPackageName": "devextreme", @@ -726,6 +738,12 @@ "sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status", "asOfVersion": "1.2.0" }, + { + "libraryName": "i18next-browser-languagedetector", + "typingsPackageName": "i18next-browser-languagedetector", + "sourceRepoURL": "https://github.com/i18next/i18next-browser-languagedetector", + "asOfVersion": "3.0.0" + }, { "libraryName": "i18next-xhr-backend", "typingsPackageName": "i18next-xhr-backend", @@ -762,6 +780,12 @@ "sourceRepoURL": "https://github.com/taye/interact.js", "asOfVersion": "1.3.0" }, + { + "libraryName": "internal-ip", + "typingsPackageName": "internal-ip", + "sourceRepoURL": "https://github.com/sindresorhus/internal-ip", + "asOfVersion": "4.1.0" + }, { "libraryName": "inversify", "typingsPackageName": "inversify", @@ -1116,6 +1140,18 @@ "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "p-map", + "typingsPackageName": "p-map", + "sourceRepoURL": "https://github.com/sindresorhus/p-map", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-throttle", + "typingsPackageName": "p-throttle", + "sourceRepoURL": "https://github.com/sindresorhus/p-throttle", + "asOfVersion": "2.1.0" + }, { "libraryName": "param-case", "typingsPackageName": "param-case", @@ -1644,6 +1680,12 @@ "sourceRepoURL": "http://gcanti.github.io/tcomb/guide/index.html", "asOfVersion": "2.6.0" }, + { + "libraryName": "terser", + "typingsPackageName": "terser", + "sourceRepoURL": "https://github.com/terser-js/terser", + "asOfVersion": "3.12.0" + }, { "libraryName": "timezonecomplete", "typingsPackageName": "timezonecomplete", diff --git a/package.json b/package.json index 7fc0358f27..1a5124c035 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lint": "dtslint types" }, "devDependencies": { - "dtslint": "github:Microsoft/dtslint#production", + "dtslint": "latest", "types-publisher": "github:Microsoft/types-publisher#production" }, "dependencies": {} diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index 92c090d179..fdd0f395fe 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -97,6 +97,7 @@ let _algoliaIndexSettings: IndexSettings = { minProximity: 0, placeholders: { '': [''] }, camelCaseAttributes: [''], + sortFacetValuesBy: 'count', }; let _algoliaQueryParameters: QueryParameters = { @@ -150,6 +151,7 @@ let _algoliaQueryParameters: QueryParameters = { synonyms: true, replaceSynonymsInHighlight: false, minProximity: 0, + sortFacetValuesBy: 'alpha', }; let client: Client = algoliasearch('', ''); diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 5478fedbac..8e3ba4c5ab 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -5,6 +5,7 @@ // Aurélien Hervé // Samuel Vaillant // Kai Eichinger +// Nery Ortez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -24,25 +25,25 @@ declare namespace algoliasearch { * Query on multiple index * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - search( + search( queries: { indexName: string; query: string; params: QueryParameters; }[], - cb: (err: Error, res: MultiResponse) => void + cb: (err: Error, res: MultiResponse) => void ): void; /** * Query on multiple index * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - search( + search( queries: { indexName: string; query: string; params: QueryParameters; }[] - ): Promise; + ): Promise>; /** * Query for facet values of a specific facet */ @@ -590,14 +591,14 @@ declare namespace algoliasearch { * Search in an index * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search */ - search(params: QueryParameters): Promise; + search(params: QueryParameters): Promise>; /** * Search in an index * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search */ - search( + search( params: QueryParameters, - cb: (err: Error, res: Response) => void + cb: (err: Error, res: Response) => void ): void; /** * Search in an index @@ -1451,6 +1452,11 @@ declare namespace algoliasearch { nbShards?: number; userData?: string | object; + + /** + * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/ + */ + sortFacetValuesBy?: 'count' | 'alpha'; } namespace SearchForFacetValues { @@ -1776,14 +1782,16 @@ declare namespace algoliasearch { https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/ */ camelCaseAttributes?: string[]; + + sortFacetValuesBy?: 'count' | 'alpha'; } - interface Response { + interface Response { /** * Contains all the hits matching the query * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ - hits: any[]; + hits: T[]; /** * Current page * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response @@ -1842,8 +1850,8 @@ declare namespace algoliasearch { cursor?: string; } - interface MultiResponse { - results: Response[]; + interface MultiResponse { + results: Response[]; } } diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index ce58d6a428..11e22f5ccf 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -6,6 +6,7 @@ // Samuel Vaillant // Claas Brüggemann // Kai Eichinger +// Nery Ortez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -25,25 +26,25 @@ declare namespace algoliasearch { * Query on multiple index * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - search( + search( queries: { indexName: string; query: string; params: QueryParameters; }[], - cb: (err: Error, res: MultiResponse) => void + cb: (err: Error, res: MultiResponse) => void ): void; /** * Query on multiple index * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - search( + search( queries: { indexName: string; query: string; params: QueryParameters; }[] - ): Promise; + ): Promise>; /** * Query for facet values of a specific facet */ @@ -109,15 +110,15 @@ declare namespace algoliasearch { * Search in an index * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search */ - search( + search( params: QueryParameters, - cb: (err: Error, res: Response) => void + cb: (err: Error, res: Response) => void ): void; /** * Search in an index * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search */ - search(params: QueryParameters): Promise; + search(params: QueryParameters): Promise>; /** * Search in an index * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ @@ -531,6 +532,11 @@ declare namespace algoliasearch { nbShards?: number; userData?: string | object; + + /** + * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/ + */ + sortFacetValuesBy?: 'count' | 'alpha'; } namespace SearchForFacetValues { @@ -552,12 +558,12 @@ declare namespace algoliasearch { } } - interface Response { + interface Response { /** * Contains all the hits matching the query * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ - hits: any[]; + hits: T[]; /** * Current page * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response @@ -616,8 +622,8 @@ declare namespace algoliasearch { cursor?: string; } - interface MultiResponse { - results: Response[]; + interface MultiResponse { + results: Response[]; } } diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index acc7341a84..6b012d5677 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -346,7 +346,7 @@ declare module 'angular' { interface IMenuService { close(): void; hide(response?: any, options?: any): IPromise; - open(event?: MouseEvent): void; + open(event?: MouseEvent | JQueryEventObject): void; } interface IColorPalette { diff --git a/types/argparse/argparse-tests.ts b/types/argparse/argparse-tests.ts index ed714ada95..942e2bb4f2 100644 --- a/types/argparse/argparse-tests.ts +++ b/types/argparse/argparse-tests.ts @@ -1,6 +1,12 @@ // near copy of each of the tests from https://github.com/nodeca/argparse/tree/master/examples -import { ArgumentParser, RawDescriptionHelpFormatter } from 'argparse'; +import { + ArgumentParser, + RawDescriptionHelpFormatter, + Action, + ActionConstructorOptions, + Namespace, +} from 'argparse'; let args: any; const simpleExample = new ArgumentParser({ @@ -276,3 +282,26 @@ group.addArgument(['--bar'], { help: 'bar help' }); formatterExample.printHelp(); + +class CustomAction1 extends Action { + constructor(options: ActionConstructorOptions) { + super(options); + } + call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null) { + console.log('custom action 1'); + } +} + +class CustomAction2 extends Action { + call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null) { + console.log('custom action 2'); + } +} + +const customActionExample = new ArgumentParser({ addHelp: false }); +customActionExample.addArgument('--abc', { + action: CustomAction1, +}); +customActionExample.addArgument('--def', { + action: CustomAction2, +}); diff --git a/types/argparse/index.d.ts b/types/argparse/index.d.ts index 3330055b1f..a229b6bc49 100644 --- a/types/argparse/index.d.ts +++ b/types/argparse/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Andrew Schurman // Tomasz Łaziuk // Sebastian Silbermann +// Kannan Goundan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -79,13 +80,24 @@ export interface ArgumentGroupOptions { description?: string; } +export abstract class Action { + protected dest: string; + constructor(options: ActionConstructorOptions); + abstract call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null): void; +} + +// Passed to the Action constructor. Subclasses are just expected to relay this to +// the super() constructor, so using an "opaque type" pattern is probably fine. +// Someone may want to fill this out in the future. +export type ActionConstructorOptions = number & {_: 'ActionConstructorOptions'}; + export class HelpFormatter { } export class ArgumentDefaultsHelpFormatter { } export class RawDescriptionHelpFormatter { } export class RawTextHelpFormatter { } export interface ArgumentOptions { - action?: string; + action?: string | { new(options: ActionConstructorOptions): Action }; optionStrings?: string[]; dest?: string; nargs?: string | number; diff --git a/types/argparse/tsconfig.json b/types/argparse/tsconfig.json index 49e7b03ca8..9248f1d078 100644 --- a/types/argparse/tsconfig.json +++ b/types/argparse/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "argparse-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts index 66655f8dd3..89eff9a8c6 100644 --- a/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts +++ b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts @@ -101,3 +101,50 @@ const thingShadows = new awsIot.thingShadow({ thingShadows.on("timeout", function(thingName: string, clientToken: string) { }); + +const jobs = new awsIot.jobs({ + keyPath: "", + certPath: "", + caPath: "", + clientId: "", + region: "", + baseReconnectTimeMs: 1000, + protocol: "wss", + port: 443, + host: "", + debug: false +}); + +jobs.subscribeToJobs("thingname", "operationname", (err, job) => { + console.error("Error", err); + if (err || !job) { + return; + } + console.log("job id", job.id); + console.log("job info", job.document); + console.log("job op", job.operation); + console.log("job status", job.status); + console.log("job status details", job.status.statusDetails); + console.log( + "job status details progress", + job.status.statusDetails.progress + ); + + job.inProgress({ progress: "1" }, err => + console.error("Job progress error", err) + ); + job.failed({ progress: "2" }, err => + console.error("Job failed error", err) + ); + job.succeeded({ progress: "3" }, err => + console.error("Job failed error", err) + ); +}); + +jobs.startJobNotifications("thingname", err => + console.error("Start job notification error", err) +); + +jobs.unsubscribeFromJobs("thingname", "operationame", err => + console.error("Unsubscribe from jobs error", err) +); diff --git a/types/aws-iot-device-sdk/index.d.ts b/types/aws-iot-device-sdk/index.d.ts index f2bcab818c..8b52a68bfc 100644 --- a/types/aws-iot-device-sdk/index.d.ts +++ b/types/aws-iot-device-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for aws-iot-device-sdk 2.1.0 +// Type definitions for aws-iot-device-sdk 2.2.0 // Project: https://github.com/aws/aws-iot-device-sdk-js // Definitions by: Markus Olsson // Margus Lamp @@ -391,3 +391,115 @@ export class thingShadow extends NodeJS.EventEmitter { /** Emitted when a different client"s update or delete operation is accepted on the shadow. */ on(event: "foreignStateChange", listener: (thingName: string, operation: "update" | "delete", stateObject: any) => void): this; } + +export interface statusDetails { + progress: string; +} + +export interface jobStatus { + status: string; + statusDetails: statusDetails; +} + +export interface jobDocument { + [key: string]: any +} + +export interface job { + /** Object that contains job execution information and functions for updating job execution status. */ + + /** Returns the job id. */ + id: string; + + /** + * The JSON document describing details of the job to be executed eg. + * { + * "operation": "install", + * "otherProperty": "value", + * ... + * } + */ + document: jobDocument; + + /** + * Returns the job operation from the job document. Eg. 'install', 'reboot', etc. + */ + operation: string; + + /** + * Returns the current job status according to AWS Orchestra. + */ + status: jobStatus; + + /** + * Update the status of the job execution to be IN_PROGRESS for the thing associated with the job. + * + * @param statusDetails - optional document describing the status details of the in progress job + * @param callback - function(err) optional callback for when the operation completes, err is null if no error occurred + */ + inProgress(statusDetails?: statusDetails, callback?: (err: Error) => void): void; + + /** + * Update the status of the job execution to be FAILED for the thing associated with the job. + * + * @param statusDetails - optional document describing the status details of the in progress job e.g. + * @param callback - function(err) optional callback for when the operation completes, err is null if no error occurred + */ + failed(statusDetails?: statusDetails, callback?: (err: Error) => void): void; + + /** + * Update the status of the job execution to be SUCCESS for the thing associated with the job. + * + * @param statusDetails - optional document describing the status details of the in progress job e.g. + * @param callback - function(err) optional callback for when the operation completes, err is null if no error occurred + */ + succeeded(statusDetails?: statusDetails, callback?: (err: Error) => void): void; +} + +export class jobs extends device { + /** + * The `jobs` class wraps an instance of the `device` class with additional functionality to + * handle job execution management through the AWS IoT Jobs platform. Arguments in `deviceOptions` + * are the same as those in the device class and the `jobs` class supports all of the + * same events and functions as the `device` class. + */ + constructor(options?: DeviceOptions); + + /** + * Subscribes to job execution notifications for the thing named `thingName`. If + * `operationName` is specified then the callback will only be called when a job + * ready for execution contains a property called `operation` in its job document with + * a value matching `operationName`. If `operationName` is omitted then the callback + * will be called for every job ready for execution that does not match another + * `subscribeToJobs` subscription. + * + * @param thingName - name of the Thing to receive job execution notifications + * @param operationName - optionally filter job execution notifications to jobs with a value + * for the `operation` property that matches `operationName + * @param callback - function (err, job) callback for when a job execution is ready for processing or an error occurs + * - `err` a subscription error or an error that occurs when client is disconnecting + * - `job` an object that contains job execution information and functions for updating job execution status. + */ + subscribeToJobs(thingName: string, operationName: string, callback?: (err: Error, job: job) => void): void; + + /** + * Causes any existing queued job executions for the given thing to be published + * to the appropriate subscribeToJobs handler. Only needs to be called once per thing. + * + * @param thingName - name of the Thing to cancel job execution notifications for + * @param callback - function (err) callback for when the startJobNotifications operation completes + */ + startJobNotifications(thingName: string, callback: (error: Error) => void): mqtt.Client; + + /** + * Unsubscribes from job execution notifications for the thing named `thingName` having + * operations with a value of the given `operationName`. If `operationName` is omitted then + * the default handler for the thing with the given name is unsubscribed. + * + * @param thingName - name of the Thing to cancel job execution notifications for + * @param operationName - optional name of previously subscribed operation names + * @param callback - function (err) callback for when the unsubscribe operation completes + */ + unsubscribeFromJobs(thingName: string, operationName: string, callback: (err: Error) => void): void; + +} diff --git a/types/babel-types/babel-types-tests.ts b/types/babel-types/babel-types-tests.ts index 8ffb1b32de..921608924c 100644 --- a/types/babel-types/babel-types-tests.ts +++ b/types/babel-types/babel-types-tests.ts @@ -53,6 +53,12 @@ traverse(ast, { } }); +// Node type checks +t.isIdentifier(t.identifier("id")); +t.isIdentifier(exp); +t.isIdentifier(null); +t.isIdentifier(undefined); + // TypeScript Types // TODO: Test all variants of these functions' signatures diff --git a/types/babel-types/index.d.ts b/types/babel-types/index.d.ts index d37cdf0a76..f0d781a7ed 100644 --- a/types/babel-types/index.d.ts +++ b/types/babel-types/index.d.ts @@ -1514,246 +1514,246 @@ export function TSUndefinedKeyword(): TSUndefinedKeyword; export function TSUnionType(types: TSType[]): TSUnionType; export function TSVoidKeyword(): TSVoidKeyword; -export function isArrayExpression(node: object, opts?: object): node is ArrayExpression; -export function isAssignmentExpression(node: object, opts?: object): node is AssignmentExpression; -export function isBinaryExpression(node: object, opts?: object): node is BinaryExpression; -export function isDirective(node: object, opts?: object): node is Directive; -export function isDirectiveLiteral(node: object, opts?: object): node is DirectiveLiteral; -export function isBlockStatement(node: object, opts?: object): node is BlockStatement; -export function isBreakStatement(node: object, opts?: object): node is BreakStatement; -export function isCallExpression(node: object, opts?: object): node is CallExpression; -export function isCatchClause(node: object, opts?: object): node is CatchClause; -export function isConditionalExpression(node: object, opts?: object): node is ConditionalExpression; -export function isContinueStatement(node: object, opts?: object): node is ContinueStatement; -export function isDebuggerStatement(node: object, opts?: object): node is DebuggerStatement; -export function isDoWhileStatement(node: object, opts?: object): node is DoWhileStatement; -export function isEmptyStatement(node: object, opts?: object): node is EmptyStatement; -export function isExpressionStatement(node: object, opts?: object): node is ExpressionStatement; -export function isFile(node: object, opts?: object): node is File; -export function isForInStatement(node: object, opts?: object): node is ForInStatement; -export function isForStatement(node: object, opts?: object): node is ForStatement; -export function isFunctionDeclaration(node: object, opts?: object): node is FunctionDeclaration; -export function isFunctionExpression(node: object, opts?: object): node is FunctionExpression; -export function isIdentifier(node: object, opts?: object): node is Identifier; -export function isIfStatement(node: object, opts?: object): node is IfStatement; -export function isLabeledStatement(node: object, opts?: object): node is LabeledStatement; -export function isStringLiteral(node: object, opts?: object): node is StringLiteral; -export function isNumericLiteral(node: object, opts?: object): node is NumericLiteral; -export function isNullLiteral(node: object, opts?: object): node is NullLiteral; -export function isBooleanLiteral(node: object, opts?: object): node is BooleanLiteral; -export function isRegExpLiteral(node: object, opts?: object): node is RegExpLiteral; -export function isLogicalExpression(node: object, opts?: object): node is LogicalExpression; -export function isMemberExpression(node: object, opts?: object): node is MemberExpression; -export function isNewExpression(node: object, opts?: object): node is NewExpression; -export function isProgram(node: object, opts?: object): node is Program; -export function isObjectExpression(node: object, opts?: object): node is ObjectExpression; -export function isObjectMethod(node: object, opts?: object): node is ObjectMethod; -export function isObjectProperty(node: object, opts?: object): node is ObjectProperty; -export function isRestElement(node: object, opts?: object): node is RestElement; -export function isReturnStatement(node: object, opts?: object): node is ReturnStatement; -export function isSequenceExpression(node: object, opts?: object): node is SequenceExpression; -export function isSwitchCase(node: object, opts?: object): node is SwitchCase; -export function isSwitchStatement(node: object, opts?: object): node is SwitchStatement; -export function isThisExpression(node: object, opts?: object): node is ThisExpression; -export function isThrowStatement(node: object, opts?: object): node is ThrowStatement; -export function isTryStatement(node: object, opts?: object): node is TryStatement; -export function isUnaryExpression(node: object, opts?: object): node is UnaryExpression; -export function isUpdateExpression(node: object, opts?: object): node is UpdateExpression; -export function isVariableDeclaration(node: object, opts?: object): node is VariableDeclaration; -export function isVariableDeclarator(node: object, opts?: object): node is VariableDeclarator; -export function isWhileStatement(node: object, opts?: object): node is WhileStatement; -export function isWithStatement(node: object, opts?: object): node is WithStatement; -export function isAssignmentPattern(node: object, opts?: object): node is AssignmentPattern; -export function isArrayPattern(node: object, opts?: object): node is ArrayPattern; -export function isArrowFunctionExpression(node: object, opts?: object): node is ArrowFunctionExpression; -export function isClassBody(node: object, opts?: object): node is ClassBody; -export function isClassDeclaration(node: object, opts?: object): node is ClassDeclaration; -export function isClassExpression(node: object, opts?: object): node is ClassExpression; -export function isExportAllDeclaration(node: object, opts?: object): node is ExportAllDeclaration; -export function isExportDefaultDeclaration(node: object, opts?: object): node is ExportDefaultDeclaration; -export function isExportNamedDeclaration(node: object, opts?: object): node is ExportNamedDeclaration; -export function isExportSpecifier(node: object, opts?: object): node is ExportSpecifier; -export function isForOfStatement(node: object, opts?: object): node is ForOfStatement; -export function isImportDeclaration(node: object, opts?: object): node is ImportDeclaration; -export function isImportDefaultSpecifier(node: object, opts?: object): node is ImportDefaultSpecifier; -export function isImportNamespaceSpecifier(node: object, opts?: object): node is ImportNamespaceSpecifier; -export function isImportSpecifier(node: object, opts?: object): node is ImportSpecifier; -export function isMetaProperty(node: object, opts?: object): node is MetaProperty; -export function isClassMethod(node: object, opts?: object): node is ClassMethod; -export function isObjectPattern(node: object, opts?: object): node is ObjectPattern; -export function isSpreadElement(node: object, opts?: object): node is SpreadElement; -export function isSuper(node: object, opts?: object): node is Super; -export function isTaggedTemplateExpression(node: object, opts?: object): node is TaggedTemplateExpression; -export function isTemplateElement(node: object, opts?: object): node is TemplateElement; -export function isTemplateLiteral(node: object, opts?: object): node is TemplateLiteral; -export function isYieldExpression(node: object, opts?: object): node is YieldExpression; -export function isAnyTypeAnnotation(node: object, opts?: object): node is AnyTypeAnnotation; -export function isArrayTypeAnnotation(node: object, opts?: object): node is ArrayTypeAnnotation; -export function isBooleanTypeAnnotation(node: object, opts?: object): node is BooleanTypeAnnotation; -export function isBooleanLiteralTypeAnnotation(node: object, opts?: object): node is BooleanLiteralTypeAnnotation; -export function isNullLiteralTypeAnnotation(node: object, opts?: object): node is NullLiteralTypeAnnotation; -export function isClassImplements(node: object, opts?: object): node is ClassImplements; -export function isClassProperty(node: object, opts?: object): node is ClassProperty; -export function isDeclareClass(node: object, opts?: object): node is DeclareClass; -export function isDeclareFunction(node: object, opts?: object): node is DeclareFunction; -export function isDeclareInterface(node: object, opts?: object): node is DeclareInterface; -export function isDeclareModule(node: object, opts?: object): node is DeclareModule; -export function isDeclareTypeAlias(node: object, opts?: object): node is DeclareTypeAlias; -export function isDeclareVariable(node: object, opts?: object): node is DeclareVariable; -export function isExistentialTypeParam(node: object, opts?: object): node is ExistentialTypeParam; -export function isFunctionTypeAnnotation(node: object, opts?: object): node is FunctionTypeAnnotation; -export function isFunctionTypeParam(node: object, opts?: object): node is FunctionTypeParam; -export function isGenericTypeAnnotation(node: object, opts?: object): node is GenericTypeAnnotation; -export function isInterfaceExtends(node: object, opts?: object): node is InterfaceExtends; -export function isInterfaceDeclaration(node: object, opts?: object): node is InterfaceDeclaration; -export function isIntersectionTypeAnnotation(node: object, opts?: object): node is IntersectionTypeAnnotation; -export function isMixedTypeAnnotation(node: object, opts?: object): node is MixedTypeAnnotation; -export function isNullableTypeAnnotation(node: object, opts?: object): node is NullableTypeAnnotation; -export function isNumericLiteralTypeAnnotation(node: object, opts?: object): node is NumericLiteralTypeAnnotation; -export function isNumberTypeAnnotation(node: object, opts?: object): node is NumberTypeAnnotation; -export function isStringLiteralTypeAnnotation(node: object, opts?: object): node is StringLiteralTypeAnnotation; -export function isStringTypeAnnotation(node: object, opts?: object): node is StringTypeAnnotation; -export function isThisTypeAnnotation(node: object, opts?: object): node is ThisTypeAnnotation; -export function isTupleTypeAnnotation(node: object, opts?: object): node is TupleTypeAnnotation; -export function isTypeofTypeAnnotation(node: object, opts?: object): node is TypeofTypeAnnotation; -export function isTypeAlias(node: object, opts?: object): node is TypeAlias; -export function isTypeAnnotation(node: object, opts?: object): node is TypeAnnotation; -export function isTypeCastExpression(node: object, opts?: object): node is TypeCastExpression; -export function isTypeParameter(node: object, opts?: object): node is TypeParameter; -export function isTypeParameterDeclaration(node: object, opts?: object): node is TypeParameterDeclaration; -export function isTypeParameterInstantiation(node: object, opts?: object): node is TypeParameterInstantiation; -export function isObjectTypeAnnotation(node: object, opts?: object): node is ObjectTypeAnnotation; -export function isObjectTypeCallProperty(node: object, opts?: object): node is ObjectTypeCallProperty; -export function isObjectTypeIndexer(node: object, opts?: object): node is ObjectTypeIndexer; -export function isObjectTypeProperty(node: object, opts?: object): node is ObjectTypeProperty; -export function isQualifiedTypeIdentifier(node: object, opts?: object): node is QualifiedTypeIdentifier; -export function isUnionTypeAnnotation(node: object, opts?: object): node is UnionTypeAnnotation; -export function isVoidTypeAnnotation(node: object, opts?: object): node is VoidTypeAnnotation; -export function isJSXAttribute(node: object, opts?: object): node is JSXAttribute; -export function isJSXClosingElement(node: object, opts?: object): node is JSXClosingElement; -export function isJSXElement(node: object, opts?: object): node is JSXElement; -export function isJSXEmptyExpression(node: object, opts?: object): node is JSXEmptyExpression; -export function isJSXExpressionContainer(node: object, opts?: object): node is JSXExpressionContainer; -export function isJSXIdentifier(node: object, opts?: object): node is JSXIdentifier; -export function isJSXMemberExpression(node: object, opts?: object): node is JSXMemberExpression; -export function isJSXNamespacedName(node: object, opts?: object): node is JSXNamespacedName; -export function isJSXOpeningElement(node: object, opts?: object): node is JSXOpeningElement; -export function isJSXSpreadAttribute(node: object, opts?: object): node is JSXSpreadAttribute; -export function isJSXText(node: object, opts?: object): node is JSXText; -export function isNoop(node: object, opts?: object): node is Noop; -export function isParenthesizedExpression(node: object, opts?: object): node is ParenthesizedExpression; -export function isAwaitExpression(node: object, opts?: object): node is AwaitExpression; -export function isBindExpression(node: object, opts?: object): node is BindExpression; -export function isDecorator(node: object, opts?: object): node is Decorator; -export function isDoExpression(node: object, opts?: object): node is DoExpression; -export function isExportDefaultSpecifier(node: object, opts?: object): node is ExportDefaultSpecifier; -export function isExportNamespaceSpecifier(node: object, opts?: object): node is ExportNamespaceSpecifier; -export function isRestProperty(node: object, opts?: object): node is RestProperty; -export function isSpreadProperty(node: object, opts?: object): node is SpreadProperty; -export function isExpression(node: object, opts?: object): node is Expression; -export function isBinary(node: object, opts?: object): node is Binary; -export function isScopable(node: object, opts?: object): node is Scopable; -export function isBlockParent(node: object, opts?: object): node is BlockParent; -export function isBlock(node: object, opts?: object): node is Block; -export function isStatement(node: object, opts?: object): node is Statement; -export function isTerminatorless(node: object, opts?: object): node is Terminatorless; -export function isCompletionStatement(node: object, opts?: object): node is CompletionStatement; -export function isConditional(node: object, opts?: object): node is Conditional; -export function isLoop(node: object, opts?: object): node is Loop; -export function isWhile(node: object, opts?: object): node is While; -export function isExpressionWrapper(node: object, opts?: object): node is ExpressionWrapper; -export function isFor(node: object, opts?: object): node is For; -export function isForXStatement(node: object, opts?: object): node is ForXStatement; +export function isArrayExpression(node: object | null | undefined, opts?: object): node is ArrayExpression; +export function isAssignmentExpression(node: object | null | undefined, opts?: object): node is AssignmentExpression; +export function isBinaryExpression(node: object | null | undefined, opts?: object): node is BinaryExpression; +export function isDirective(node: object | null | undefined, opts?: object): node is Directive; +export function isDirectiveLiteral(node: object | null | undefined, opts?: object): node is DirectiveLiteral; +export function isBlockStatement(node: object | null | undefined, opts?: object): node is BlockStatement; +export function isBreakStatement(node: object | null | undefined, opts?: object): node is BreakStatement; +export function isCallExpression(node: object | null | undefined, opts?: object): node is CallExpression; +export function isCatchClause(node: object | null | undefined, opts?: object): node is CatchClause; +export function isConditionalExpression(node: object | null | undefined, opts?: object): node is ConditionalExpression; +export function isContinueStatement(node: object | null | undefined, opts?: object): node is ContinueStatement; +export function isDebuggerStatement(node: object | null | undefined, opts?: object): node is DebuggerStatement; +export function isDoWhileStatement(node: object | null | undefined, opts?: object): node is DoWhileStatement; +export function isEmptyStatement(node: object | null | undefined, opts?: object): node is EmptyStatement; +export function isExpressionStatement(node: object | null | undefined, opts?: object): node is ExpressionStatement; +export function isFile(node: object | null | undefined, opts?: object): node is File; +export function isForInStatement(node: object | null | undefined, opts?: object): node is ForInStatement; +export function isForStatement(node: object | null | undefined, opts?: object): node is ForStatement; +export function isFunctionDeclaration(node: object | null | undefined, opts?: object): node is FunctionDeclaration; +export function isFunctionExpression(node: object | null | undefined, opts?: object): node is FunctionExpression; +export function isIdentifier(node: object | null | undefined, opts?: object): node is Identifier; +export function isIfStatement(node: object | null | undefined, opts?: object): node is IfStatement; +export function isLabeledStatement(node: object | null | undefined, opts?: object): node is LabeledStatement; +export function isStringLiteral(node: object | null | undefined, opts?: object): node is StringLiteral; +export function isNumericLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral; +export function isNullLiteral(node: object | null | undefined, opts?: object): node is NullLiteral; +export function isBooleanLiteral(node: object | null | undefined, opts?: object): node is BooleanLiteral; +export function isRegExpLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral; +export function isLogicalExpression(node: object | null | undefined, opts?: object): node is LogicalExpression; +export function isMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression; +export function isNewExpression(node: object | null | undefined, opts?: object): node is NewExpression; +export function isProgram(node: object | null | undefined, opts?: object): node is Program; +export function isObjectExpression(node: object | null | undefined, opts?: object): node is ObjectExpression; +export function isObjectMethod(node: object | null | undefined, opts?: object): node is ObjectMethod; +export function isObjectProperty(node: object | null | undefined, opts?: object): node is ObjectProperty; +export function isRestElement(node: object | null | undefined, opts?: object): node is RestElement; +export function isReturnStatement(node: object | null | undefined, opts?: object): node is ReturnStatement; +export function isSequenceExpression(node: object | null | undefined, opts?: object): node is SequenceExpression; +export function isSwitchCase(node: object | null | undefined, opts?: object): node is SwitchCase; +export function isSwitchStatement(node: object | null | undefined, opts?: object): node is SwitchStatement; +export function isThisExpression(node: object | null | undefined, opts?: object): node is ThisExpression; +export function isThrowStatement(node: object | null | undefined, opts?: object): node is ThrowStatement; +export function isTryStatement(node: object | null | undefined, opts?: object): node is TryStatement; +export function isUnaryExpression(node: object | null | undefined, opts?: object): node is UnaryExpression; +export function isUpdateExpression(node: object | null | undefined, opts?: object): node is UpdateExpression; +export function isVariableDeclaration(node: object | null | undefined, opts?: object): node is VariableDeclaration; +export function isVariableDeclarator(node: object | null | undefined, opts?: object): node is VariableDeclarator; +export function isWhileStatement(node: object | null | undefined, opts?: object): node is WhileStatement; +export function isWithStatement(node: object | null | undefined, opts?: object): node is WithStatement; +export function isAssignmentPattern(node: object | null | undefined, opts?: object): node is AssignmentPattern; +export function isArrayPattern(node: object | null | undefined, opts?: object): node is ArrayPattern; +export function isArrowFunctionExpression(node: object | null | undefined, opts?: object): node is ArrowFunctionExpression; +export function isClassBody(node: object | null | undefined, opts?: object): node is ClassBody; +export function isClassDeclaration(node: object | null | undefined, opts?: object): node is ClassDeclaration; +export function isClassExpression(node: object | null | undefined, opts?: object): node is ClassExpression; +export function isExportAllDeclaration(node: object | null | undefined, opts?: object): node is ExportAllDeclaration; +export function isExportDefaultDeclaration(node: object | null | undefined, opts?: object): node is ExportDefaultDeclaration; +export function isExportNamedDeclaration(node: object | null | undefined, opts?: object): node is ExportNamedDeclaration; +export function isExportSpecifier(node: object | null | undefined, opts?: object): node is ExportSpecifier; +export function isForOfStatement(node: object | null | undefined, opts?: object): node is ForOfStatement; +export function isImportDeclaration(node: object | null | undefined, opts?: object): node is ImportDeclaration; +export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object): node is ImportDefaultSpecifier; +export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object): node is ImportNamespaceSpecifier; +export function isImportSpecifier(node: object | null | undefined, opts?: object): node is ImportSpecifier; +export function isMetaProperty(node: object | null | undefined, opts?: object): node is MetaProperty; +export function isClassMethod(node: object | null | undefined, opts?: object): node is ClassMethod; +export function isObjectPattern(node: object | null | undefined, opts?: object): node is ObjectPattern; +export function isSpreadElement(node: object | null | undefined, opts?: object): node is SpreadElement; +export function isSuper(node: object | null | undefined, opts?: object): node is Super; +export function isTaggedTemplateExpression(node: object | null | undefined, opts?: object): node is TaggedTemplateExpression; +export function isTemplateElement(node: object | null | undefined, opts?: object): node is TemplateElement; +export function isTemplateLiteral(node: object | null | undefined, opts?: object): node is TemplateLiteral; +export function isYieldExpression(node: object | null | undefined, opts?: object): node is YieldExpression; +export function isAnyTypeAnnotation(node: object | null | undefined, opts?: object): node is AnyTypeAnnotation; +export function isArrayTypeAnnotation(node: object | null | undefined, opts?: object): node is ArrayTypeAnnotation; +export function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanTypeAnnotation; +export function isBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanLiteralTypeAnnotation; +export function isNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is NullLiteralTypeAnnotation; +export function isClassImplements(node: object | null | undefined, opts?: object): node is ClassImplements; +export function isClassProperty(node: object | null | undefined, opts?: object): node is ClassProperty; +export function isDeclareClass(node: object | null | undefined, opts?: object): node is DeclareClass; +export function isDeclareFunction(node: object | null | undefined, opts?: object): node is DeclareFunction; +export function isDeclareInterface(node: object | null | undefined, opts?: object): node is DeclareInterface; +export function isDeclareModule(node: object | null | undefined, opts?: object): node is DeclareModule; +export function isDeclareTypeAlias(node: object | null | undefined, opts?: object): node is DeclareTypeAlias; +export function isDeclareVariable(node: object | null | undefined, opts?: object): node is DeclareVariable; +export function isExistentialTypeParam(node: object | null | undefined, opts?: object): node is ExistentialTypeParam; +export function isFunctionTypeAnnotation(node: object | null | undefined, opts?: object): node is FunctionTypeAnnotation; +export function isFunctionTypeParam(node: object | null | undefined, opts?: object): node is FunctionTypeParam; +export function isGenericTypeAnnotation(node: object | null | undefined, opts?: object): node is GenericTypeAnnotation; +export function isInterfaceExtends(node: object | null | undefined, opts?: object): node is InterfaceExtends; +export function isInterfaceDeclaration(node: object | null | undefined, opts?: object): node is InterfaceDeclaration; +export function isIntersectionTypeAnnotation(node: object | null | undefined, opts?: object): node is IntersectionTypeAnnotation; +export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object): node is MixedTypeAnnotation; +export function isNullableTypeAnnotation(node: object | null | undefined, opts?: object): node is NullableTypeAnnotation; +export function isNumericLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is NumericLiteralTypeAnnotation; +export function isNumberTypeAnnotation(node: object | null | undefined, opts?: object): node is NumberTypeAnnotation; +export function isStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is StringLiteralTypeAnnotation; +export function isStringTypeAnnotation(node: object | null | undefined, opts?: object): node is StringTypeAnnotation; +export function isThisTypeAnnotation(node: object | null | undefined, opts?: object): node is ThisTypeAnnotation; +export function isTupleTypeAnnotation(node: object | null | undefined, opts?: object): node is TupleTypeAnnotation; +export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeofTypeAnnotation; +export function isTypeAlias(node: object | null | undefined, opts?: object): node is TypeAlias; +export function isTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeAnnotation; +export function isTypeCastExpression(node: object | null | undefined, opts?: object): node is TypeCastExpression; +export function isTypeParameter(node: object | null | undefined, opts?: object): node is TypeParameter; +export function isTypeParameterDeclaration(node: object | null | undefined, opts?: object): node is TypeParameterDeclaration; +export function isTypeParameterInstantiation(node: object | null | undefined, opts?: object): node is TypeParameterInstantiation; +export function isObjectTypeAnnotation(node: object | null | undefined, opts?: object): node is ObjectTypeAnnotation; +export function isObjectTypeCallProperty(node: object | null | undefined, opts?: object): node is ObjectTypeCallProperty; +export function isObjectTypeIndexer(node: object | null | undefined, opts?: object): node is ObjectTypeIndexer; +export function isObjectTypeProperty(node: object | null | undefined, opts?: object): node is ObjectTypeProperty; +export function isQualifiedTypeIdentifier(node: object | null | undefined, opts?: object): node is QualifiedTypeIdentifier; +export function isUnionTypeAnnotation(node: object | null | undefined, opts?: object): node is UnionTypeAnnotation; +export function isVoidTypeAnnotation(node: object | null | undefined, opts?: object): node is VoidTypeAnnotation; +export function isJSXAttribute(node: object | null | undefined, opts?: object): node is JSXAttribute; +export function isJSXClosingElement(node: object | null | undefined, opts?: object): node is JSXClosingElement; +export function isJSXElement(node: object | null | undefined, opts?: object): node is JSXElement; +export function isJSXEmptyExpression(node: object | null | undefined, opts?: object): node is JSXEmptyExpression; +export function isJSXExpressionContainer(node: object | null | undefined, opts?: object): node is JSXExpressionContainer; +export function isJSXIdentifier(node: object | null | undefined, opts?: object): node is JSXIdentifier; +export function isJSXMemberExpression(node: object | null | undefined, opts?: object): node is JSXMemberExpression; +export function isJSXNamespacedName(node: object | null | undefined, opts?: object): node is JSXNamespacedName; +export function isJSXOpeningElement(node: object | null | undefined, opts?: object): node is JSXOpeningElement; +export function isJSXSpreadAttribute(node: object | null | undefined, opts?: object): node is JSXSpreadAttribute; +export function isJSXText(node: object | null | undefined, opts?: object): node is JSXText; +export function isNoop(node: object | null | undefined, opts?: object): node is Noop; +export function isParenthesizedExpression(node: object | null | undefined, opts?: object): node is ParenthesizedExpression; +export function isAwaitExpression(node: object | null | undefined, opts?: object): node is AwaitExpression; +export function isBindExpression(node: object | null | undefined, opts?: object): node is BindExpression; +export function isDecorator(node: object | null | undefined, opts?: object): node is Decorator; +export function isDoExpression(node: object | null | undefined, opts?: object): node is DoExpression; +export function isExportDefaultSpecifier(node: object | null | undefined, opts?: object): node is ExportDefaultSpecifier; +export function isExportNamespaceSpecifier(node: object | null | undefined, opts?: object): node is ExportNamespaceSpecifier; +export function isRestProperty(node: object | null | undefined, opts?: object): node is RestProperty; +export function isSpreadProperty(node: object | null | undefined, opts?: object): node is SpreadProperty; +export function isExpression(node: object | null | undefined, opts?: object): node is Expression; +export function isBinary(node: object | null | undefined, opts?: object): node is Binary; +export function isScopable(node: object | null | undefined, opts?: object): node is Scopable; +export function isBlockParent(node: object | null | undefined, opts?: object): node is BlockParent; +export function isBlock(node: object | null | undefined, opts?: object): node is Block; +export function isStatement(node: object | null | undefined, opts?: object): node is Statement; +export function isTerminatorless(node: object | null | undefined, opts?: object): node is Terminatorless; +export function isCompletionStatement(node: object | null | undefined, opts?: object): node is CompletionStatement; +export function isConditional(node: object | null | undefined, opts?: object): node is Conditional; +export function isLoop(node: object | null | undefined, opts?: object): node is Loop; +export function isWhile(node: object | null | undefined, opts?: object): node is While; +export function isExpressionWrapper(node: object | null | undefined, opts?: object): node is ExpressionWrapper; +export function isFor(node: object | null | undefined, opts?: object): node is For; +export function isForXStatement(node: object | null | undefined, opts?: object): node is ForXStatement; // tslint:disable-next-line ban-types -export function isFunction(node: object, opts?: object): node is Function; -export function isFunctionParent(node: object, opts?: object): node is FunctionParent; -export function isPureish(node: object, opts?: object): node is Pureish; -export function isDeclaration(node: object, opts?: object): node is Declaration; -export function isLVal(node: object, opts?: object): node is LVal; -export function isLiteral(node: object, opts?: object): node is Literal; -export function isImmutable(node: object, opts?: object): node is Immutable; -export function isUserWhitespacable(node: object, opts?: object): node is UserWhitespacable; -export function isMethod(node: object, opts?: object): node is Method; -export function isObjectMember(node: object, opts?: object): node is ObjectMember; -export function isProperty(node: object, opts?: object): node is Property; -export function isUnaryLike(node: object, opts?: object): node is UnaryLike; -export function isPattern(node: object, opts?: object): node is Pattern; -export function isClass(node: object, opts?: object): node is Class; -export function isModuleDeclaration(node: object, opts?: object): node is ModuleDeclaration; -export function isExportDeclaration(node: object, opts?: object): node is ExportDeclaration; -export function isModuleSpecifier(node: object, opts?: object): node is ModuleSpecifier; -export function isFlow(node: object, opts?: object): node is Flow; -export function isFlowBaseAnnotation(node: object, opts?: object): node is FlowBaseAnnotation; -export function isFlowDeclaration(node: object, opts?: object): node is FlowDeclaration; -export function isJSX(node: object, opts?: object): node is JSX; -export function isNumberLiteral(node: object, opts?: object): node is NumericLiteral; -export function isRegexLiteral(node: object, opts?: object): node is RegExpLiteral; +export function isFunction(node: object | null | undefined, opts?: object): node is Function; +export function isFunctionParent(node: object | null | undefined, opts?: object): node is FunctionParent; +export function isPureish(node: object | null | undefined, opts?: object): node is Pureish; +export function isDeclaration(node: object | null | undefined, opts?: object): node is Declaration; +export function isLVal(node: object | null | undefined, opts?: object): node is LVal; +export function isLiteral(node: object | null | undefined, opts?: object): node is Literal; +export function isImmutable(node: object | null | undefined, opts?: object): node is Immutable; +export function isUserWhitespacable(node: object | null | undefined, opts?: object): node is UserWhitespacable; +export function isMethod(node: object | null | undefined, opts?: object): node is Method; +export function isObjectMember(node: object | null | undefined, opts?: object): node is ObjectMember; +export function isProperty(node: object | null | undefined, opts?: object): node is Property; +export function isUnaryLike(node: object | null | undefined, opts?: object): node is UnaryLike; +export function isPattern(node: object | null | undefined, opts?: object): node is Pattern; +export function isClass(node: object | null | undefined, opts?: object): node is Class; +export function isModuleDeclaration(node: object | null | undefined, opts?: object): node is ModuleDeclaration; +export function isExportDeclaration(node: object | null | undefined, opts?: object): node is ExportDeclaration; +export function isModuleSpecifier(node: object | null | undefined, opts?: object): node is ModuleSpecifier; +export function isFlow(node: object | null | undefined, opts?: object): node is Flow; +export function isFlowBaseAnnotation(node: object | null | undefined, opts?: object): node is FlowBaseAnnotation; +export function isFlowDeclaration(node: object | null | undefined, opts?: object): node is FlowDeclaration; +export function isJSX(node: object | null | undefined, opts?: object): node is JSX; +export function isNumberLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral; +export function isRegexLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral; -export function isReferencedIdentifier(node: object, opts?: object): node is Identifier | JSXIdentifier; -export function isReferencedMemberExpression(node: object, opts?: object): node is MemberExpression; -export function isBindingIdentifier(node: object, opts?: object): node is Identifier; -export function isScope(node: object, opts?: object): node is Scopable; -export function isReferenced(node: object, opts?: object): boolean; -export function isBlockScoped(node: object, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration; -export function isVar(node: object, opts?: object): node is VariableDeclaration; -export function isUser(node: object, opts?: object): boolean; -export function isGenerated(node: object, opts?: object): boolean; -export function isPure(node: object, opts?: object): boolean; +export function isReferencedIdentifier(node: object | null | undefined, opts?: object): node is Identifier | JSXIdentifier; +export function isReferencedMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression; +export function isBindingIdentifier(node: object | null | undefined, opts?: object): node is Identifier; +export function isScope(node: object | null | undefined, opts?: object): node is Scopable; +export function isReferenced(node: object | null | undefined, opts?: object): boolean; +export function isBlockScoped(node: object | null | undefined, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration; +export function isVar(node: object | null | undefined, opts?: object): node is VariableDeclaration; +export function isUser(node: object | null | undefined, opts?: object): boolean; +export function isGenerated(node: object | null | undefined, opts?: object): boolean; +export function isPure(node: object | null | undefined, opts?: object): boolean; -export function isTSAnyKeyword(node: object, opts?: object): node is TSAnyKeyword; -export function isTSArrayType(node: object, opts?: object): node is TSArrayType; -export function isTSAsExpression(node: object, opts?: object): node is TSAsExpression; -export function isTSBooleanKeyword(node: object, opts?: object): node is TSBooleanKeyword; -export function isTSCallSignatureDeclaration(node: object, opts?: object): node is TSCallSignatureDeclaration; -export function isTSConstructSignatureDeclaration(node: object, opts?: object): node is TSTypeElement; -export function isTSConstructorType(node: object, opts?: object): node is TSConstructorType; -export function isTSDeclareFunction(node: object, opts?: object): node is TSDeclareFunction; -export function isTSDeclareMethod(node: object, opts?: object): node is TSDeclareMethod; -export function isTSEnumDeclaration(node: object, opts?: object): node is TSEnumDeclaration; -export function isTSEnumMember(node: object, opts?: object): node is TSEnumMember; -export function isTSExportAssignment(node: object, opts?: object): node is TSExportAssignment; -export function isTSExpressionWithTypeArguments(node: object, opts?: object): node is TSExpressionWithTypeArguments; -export function isTSExternalModuleReference(node: object, opts?: object): node is TSExternalModuleReference; -export function isTSFunctionType(node: object, opts?: object): node is TSFunctionType; -export function isTSImportEqualsDeclaration(node: object, opts?: object): node is TSImportEqualsDeclaration; -export function isTSIndexSignature(node: object, opts?: object): node is TSIndexSignature; -export function isTSIndexedAccessType(node: object, opts?: object): node is TSIndexedAccessType; -export function isTSInterfaceBody(node: object, opts?: object): node is TSInterfaceBody; -export function isTSInterfaceDeclaration(node: object, opts?: object): node is TSInterfaceDeclaration; -export function isTSIntersectionType(node: object, opts?: object): node is TSIntersectionType; -export function isTSLiteralType(node: object, opts?: object): node is TSLiteralType; -export function isTSMappedType(node: object, opts?: object): node is TSMappedType; -export function isTSMethodSignature(node: object, opts?: object): node is TSMethodSignature; -export function isTSModuleBlock(node: object, opts?: object): node is TSModuleBlock; -export function isTSModuleDeclaration(node: object, opts?: object): node is TSModuleDeclaration; -export function isTSNamespaceExportDeclaration(node: object, opts?: object): node is TSNamespaceExportDeclaration; -export function isTSNeverKeyword(node: object, opts?: object): node is TSNeverKeyword; -export function isTSNonNullExpression(node: object, opts?: object): node is TSNonNullExpression; -export function isTSNullKeyword(node: object, opts?: object): node is TSNullKeyword; -export function isTSNumberKeyword(node: object, opts?: object): node is TSNumberKeyword; -export function isTSObjectKeyword(node: object, opts?: object): node is TSObjectKeyword; -export function isTSParameterProperty(node: object, opts?: object): node is TSParameterProperty; -export function isTSParenthesizedType(node: object, opts?: object): node is TSParenthesizedType; -export function isTSPropertySignature(node: object, opts?: object): node is TSPropertySignature; -export function isTSQualifiedName(node: object, opts?: object): node is TSQualifiedName; -export function isTSStringKeyword(node: object, opts?: object): node is TSStringKeyword; -export function isTSSymbolKeyword(node: object, opts?: object): node is TSSymbolKeyword; -export function isTSThisType(node: object, opts?: object): node is TSThisType; -export function isTSTupleType(node: object, opts?: object): node is TSTupleType; -export function isTSTypeAliasDeclaration(node: object, opts?: object): node is TSTypeAliasDeclaration; -export function isTSTypeAnnotation(node: object, opts?: object): node is TSTypeAnnotation; -export function isTSTypeAssertion(node: object, opts?: object): node is TSTypeAssertion; -export function isTSTypeLiteral(node: object, opts?: object): node is TSTypeLiteral; -export function isTSTypeOperator(node: object, opts?: object): node is TSTypeOperator; -export function isTSTypeParameter(node: object, opts?: object): node is TSTypeParameter; -export function isTSTypeParameterDeclaration(node: object, opts?: object): node is TSTypeParameterDeclaration; -export function isTSTypeParameterInstantiation(node: object, opts?: object): node is TSTypeParameterInstantiation; -export function isTSTypePredicate(node: object, opts?: object): node is TSTypePredicate; -export function isTSTypeQuery(node: object, opts?: object): node is TSTypeQuery; -export function isTSTypeReference(node: object, opts?: object): node is TSTypeReference; -export function isTSUndefinedKeyword(node: object, opts?: object): node is TSUndefinedKeyword; -export function isTSUnionType(node: object, opts?: object): node is TSUnionType; -export function isTSVoidKeyword(node: object, opts?: object): node is TSVoidKeyword; +export function isTSAnyKeyword(node: object | null | undefined, opts?: object): node is TSAnyKeyword; +export function isTSArrayType(node: object | null | undefined, opts?: object): node is TSArrayType; +export function isTSAsExpression(node: object | null | undefined, opts?: object): node is TSAsExpression; +export function isTSBooleanKeyword(node: object | null | undefined, opts?: object): node is TSBooleanKeyword; +export function isTSCallSignatureDeclaration(node: object | null | undefined, opts?: object): node is TSCallSignatureDeclaration; +export function isTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object): node is TSTypeElement; +export function isTSConstructorType(node: object | null | undefined, opts?: object): node is TSConstructorType; +export function isTSDeclareFunction(node: object | null | undefined, opts?: object): node is TSDeclareFunction; +export function isTSDeclareMethod(node: object | null | undefined, opts?: object): node is TSDeclareMethod; +export function isTSEnumDeclaration(node: object | null | undefined, opts?: object): node is TSEnumDeclaration; +export function isTSEnumMember(node: object | null | undefined, opts?: object): node is TSEnumMember; +export function isTSExportAssignment(node: object | null | undefined, opts?: object): node is TSExportAssignment; +export function isTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object): node is TSExpressionWithTypeArguments; +export function isTSExternalModuleReference(node: object | null | undefined, opts?: object): node is TSExternalModuleReference; +export function isTSFunctionType(node: object | null | undefined, opts?: object): node is TSFunctionType; +export function isTSImportEqualsDeclaration(node: object | null | undefined, opts?: object): node is TSImportEqualsDeclaration; +export function isTSIndexSignature(node: object | null | undefined, opts?: object): node is TSIndexSignature; +export function isTSIndexedAccessType(node: object | null | undefined, opts?: object): node is TSIndexedAccessType; +export function isTSInterfaceBody(node: object | null | undefined, opts?: object): node is TSInterfaceBody; +export function isTSInterfaceDeclaration(node: object | null | undefined, opts?: object): node is TSInterfaceDeclaration; +export function isTSIntersectionType(node: object | null | undefined, opts?: object): node is TSIntersectionType; +export function isTSLiteralType(node: object | null | undefined, opts?: object): node is TSLiteralType; +export function isTSMappedType(node: object | null | undefined, opts?: object): node is TSMappedType; +export function isTSMethodSignature(node: object | null | undefined, opts?: object): node is TSMethodSignature; +export function isTSModuleBlock(node: object | null | undefined, opts?: object): node is TSModuleBlock; +export function isTSModuleDeclaration(node: object | null | undefined, opts?: object): node is TSModuleDeclaration; +export function isTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object): node is TSNamespaceExportDeclaration; +export function isTSNeverKeyword(node: object | null | undefined, opts?: object): node is TSNeverKeyword; +export function isTSNonNullExpression(node: object | null | undefined, opts?: object): node is TSNonNullExpression; +export function isTSNullKeyword(node: object | null | undefined, opts?: object): node is TSNullKeyword; +export function isTSNumberKeyword(node: object | null | undefined, opts?: object): node is TSNumberKeyword; +export function isTSObjectKeyword(node: object | null | undefined, opts?: object): node is TSObjectKeyword; +export function isTSParameterProperty(node: object | null | undefined, opts?: object): node is TSParameterProperty; +export function isTSParenthesizedType(node: object | null | undefined, opts?: object): node is TSParenthesizedType; +export function isTSPropertySignature(node: object | null | undefined, opts?: object): node is TSPropertySignature; +export function isTSQualifiedName(node: object | null | undefined, opts?: object): node is TSQualifiedName; +export function isTSStringKeyword(node: object | null | undefined, opts?: object): node is TSStringKeyword; +export function isTSSymbolKeyword(node: object | null | undefined, opts?: object): node is TSSymbolKeyword; +export function isTSThisType(node: object | null | undefined, opts?: object): node is TSThisType; +export function isTSTupleType(node: object | null | undefined, opts?: object): node is TSTupleType; +export function isTSTypeAliasDeclaration(node: object | null | undefined, opts?: object): node is TSTypeAliasDeclaration; +export function isTSTypeAnnotation(node: object | null | undefined, opts?: object): node is TSTypeAnnotation; +export function isTSTypeAssertion(node: object | null | undefined, opts?: object): node is TSTypeAssertion; +export function isTSTypeLiteral(node: object | null | undefined, opts?: object): node is TSTypeLiteral; +export function isTSTypeOperator(node: object | null | undefined, opts?: object): node is TSTypeOperator; +export function isTSTypeParameter(node: object | null | undefined, opts?: object): node is TSTypeParameter; +export function isTSTypeParameterDeclaration(node: object | null | undefined, opts?: object): node is TSTypeParameterDeclaration; +export function isTSTypeParameterInstantiation(node: object | null | undefined, opts?: object): node is TSTypeParameterInstantiation; +export function isTSTypePredicate(node: object | null | undefined, opts?: object): node is TSTypePredicate; +export function isTSTypeQuery(node: object | null | undefined, opts?: object): node is TSTypeQuery; +export function isTSTypeReference(node: object | null | undefined, opts?: object): node is TSTypeReference; +export function isTSUndefinedKeyword(node: object | null | undefined, opts?: object): node is TSUndefinedKeyword; +export function isTSUnionType(node: object | null | undefined, opts?: object): node is TSUnionType; +export function isTSVoidKeyword(node: object | null | undefined, opts?: object): node is TSVoidKeyword; // React specific export interface ReactHelpers { @@ -1762,231 +1762,231 @@ export interface ReactHelpers { } export const react: ReactHelpers; -export function assertArrayExpression(node: object, opts?: object): void; -export function assertAssignmentExpression(node: object, opts?: object): void; -export function assertBinaryExpression(node: object, opts?: object): void; -export function assertDirective(node: object, opts?: object): void; -export function assertDirectiveLiteral(node: object, opts?: object): void; -export function assertBlockStatement(node: object, opts?: object): void; -export function assertBreakStatement(node: object, opts?: object): void; -export function assertCallExpression(node: object, opts?: object): void; -export function assertCatchClause(node: object, opts?: object): void; -export function assertConditionalExpression(node: object, opts?: object): void; -export function assertContinueStatement(node: object, opts?: object): void; -export function assertDebuggerStatement(node: object, opts?: object): void; -export function assertDoWhileStatement(node: object, opts?: object): void; -export function assertEmptyStatement(node: object, opts?: object): void; -export function assertExpressionStatement(node: object, opts?: object): void; -export function assertFile(node: object, opts?: object): void; -export function assertForInStatement(node: object, opts?: object): void; -export function assertForStatement(node: object, opts?: object): void; -export function assertFunctionDeclaration(node: object, opts?: object): void; -export function assertFunctionExpression(node: object, opts?: object): void; -export function assertIdentifier(node: object, opts?: object): void; -export function assertIfStatement(node: object, opts?: object): void; -export function assertLabeledStatement(node: object, opts?: object): void; -export function assertStringLiteral(node: object, opts?: object): void; -export function assertNumericLiteral(node: object, opts?: object): void; -export function assertNullLiteral(node: object, opts?: object): void; -export function assertBooleanLiteral(node: object, opts?: object): void; -export function assertRegExpLiteral(node: object, opts?: object): void; -export function assertLogicalExpression(node: object, opts?: object): void; -export function assertMemberExpression(node: object, opts?: object): void; -export function assertNewExpression(node: object, opts?: object): void; -export function assertProgram(node: object, opts?: object): void; -export function assertObjectExpression(node: object, opts?: object): void; -export function assertObjectMethod(node: object, opts?: object): void; -export function assertObjectProperty(node: object, opts?: object): void; -export function assertRestElement(node: object, opts?: object): void; -export function assertReturnStatement(node: object, opts?: object): void; -export function assertSequenceExpression(node: object, opts?: object): void; -export function assertSwitchCase(node: object, opts?: object): void; -export function assertSwitchStatement(node: object, opts?: object): void; -export function assertThisExpression(node: object, opts?: object): void; -export function assertThrowStatement(node: object, opts?: object): void; -export function assertTryStatement(node: object, opts?: object): void; -export function assertUnaryExpression(node: object, opts?: object): void; -export function assertUpdateExpression(node: object, opts?: object): void; -export function assertVariableDeclaration(node: object, opts?: object): void; -export function assertVariableDeclarator(node: object, opts?: object): void; -export function assertWhileStatement(node: object, opts?: object): void; -export function assertWithStatement(node: object, opts?: object): void; -export function assertAssignmentPattern(node: object, opts?: object): void; -export function assertArrayPattern(node: object, opts?: object): void; -export function assertArrowFunctionExpression(node: object, opts?: object): void; -export function assertClassBody(node: object, opts?: object): void; -export function assertClassDeclaration(node: object, opts?: object): void; -export function assertClassExpression(node: object, opts?: object): void; -export function assertExportAllDeclaration(node: object, opts?: object): void; -export function assertExportDefaultDeclaration(node: object, opts?: object): void; -export function assertExportNamedDeclaration(node: object, opts?: object): void; -export function assertExportSpecifier(node: object, opts?: object): void; -export function assertForOfStatement(node: object, opts?: object): void; -export function assertImportDeclaration(node: object, opts?: object): void; -export function assertImportDefaultSpecifier(node: object, opts?: object): void; -export function assertImportNamespaceSpecifier(node: object, opts?: object): void; -export function assertImportSpecifier(node: object, opts?: object): void; -export function assertMetaProperty(node: object, opts?: object): void; -export function assertClassMethod(node: object, opts?: object): void; -export function assertObjectPattern(node: object, opts?: object): void; -export function assertSpreadElement(node: object, opts?: object): void; -export function assertSuper(node: object, opts?: object): void; -export function assertTaggedTemplateExpression(node: object, opts?: object): void; -export function assertTemplateElement(node: object, opts?: object): void; -export function assertTemplateLiteral(node: object, opts?: object): void; -export function assertYieldExpression(node: object, opts?: object): void; -export function assertAnyTypeAnnotation(node: object, opts?: object): void; -export function assertArrayTypeAnnotation(node: object, opts?: object): void; -export function assertBooleanTypeAnnotation(node: object, opts?: object): void; -export function assertBooleanLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertNullLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertClassImplements(node: object, opts?: object): void; -export function assertClassProperty(node: object, opts?: object): void; -export function assertDeclareClass(node: object, opts?: object): void; -export function assertDeclareFunction(node: object, opts?: object): void; -export function assertDeclareInterface(node: object, opts?: object): void; -export function assertDeclareModule(node: object, opts?: object): void; -export function assertDeclareTypeAlias(node: object, opts?: object): void; -export function assertDeclareVariable(node: object, opts?: object): void; -export function assertExistentialTypeParam(node: object, opts?: object): void; -export function assertFunctionTypeAnnotation(node: object, opts?: object): void; -export function assertFunctionTypeParam(node: object, opts?: object): void; -export function assertGenericTypeAnnotation(node: object, opts?: object): void; -export function assertInterfaceExtends(node: object, opts?: object): void; -export function assertInterfaceDeclaration(node: object, opts?: object): void; -export function assertIntersectionTypeAnnotation(node: object, opts?: object): void; -export function assertMixedTypeAnnotation(node: object, opts?: object): void; -export function assertNullableTypeAnnotation(node: object, opts?: object): void; -export function assertNumericLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertNumberTypeAnnotation(node: object, opts?: object): void; -export function assertStringLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertStringTypeAnnotation(node: object, opts?: object): void; -export function assertThisTypeAnnotation(node: object, opts?: object): void; -export function assertTupleTypeAnnotation(node: object, opts?: object): void; -export function assertTypeofTypeAnnotation(node: object, opts?: object): void; -export function assertTypeAlias(node: object, opts?: object): void; -export function assertTypeAnnotation(node: object, opts?: object): void; -export function assertTypeCastExpression(node: object, opts?: object): void; -export function assertTypeParameter(node: object, opts?: object): void; -export function assertTypeParameterDeclaration(node: object, opts?: object): void; -export function assertTypeParameterInstantiation(node: object, opts?: object): void; -export function assertObjectTypeAnnotation(node: object, opts?: object): void; -export function assertObjectTypeCallProperty(node: object, opts?: object): void; -export function assertObjectTypeIndexer(node: object, opts?: object): void; -export function assertObjectTypeProperty(node: object, opts?: object): void; -export function assertQualifiedTypeIdentifier(node: object, opts?: object): void; -export function assertUnionTypeAnnotation(node: object, opts?: object): void; -export function assertVoidTypeAnnotation(node: object, opts?: object): void; -export function assertJSXAttribute(node: object, opts?: object): void; -export function assertJSXClosingElement(node: object, opts?: object): void; -export function assertJSXElement(node: object, opts?: object): void; -export function assertJSXEmptyExpression(node: object, opts?: object): void; -export function assertJSXExpressionContainer(node: object, opts?: object): void; -export function assertJSXIdentifier(node: object, opts?: object): void; -export function assertJSXMemberExpression(node: object, opts?: object): void; -export function assertJSXNamespacedName(node: object, opts?: object): void; -export function assertJSXOpeningElement(node: object, opts?: object): void; -export function assertJSXSpreadAttribute(node: object, opts?: object): void; -export function assertJSXText(node: object, opts?: object): void; -export function assertNoop(node: object, opts?: object): void; -export function assertParenthesizedExpression(node: object, opts?: object): void; -export function assertAwaitExpression(node: object, opts?: object): void; -export function assertBindExpression(node: object, opts?: object): void; -export function assertDecorator(node: object, opts?: object): void; -export function assertDoExpression(node: object, opts?: object): void; -export function assertExportDefaultSpecifier(node: object, opts?: object): void; -export function assertExportNamespaceSpecifier(node: object, opts?: object): void; -export function assertRestProperty(node: object, opts?: object): void; -export function assertSpreadProperty(node: object, opts?: object): void; -export function assertExpression(node: object, opts?: object): void; -export function assertBinary(node: object, opts?: object): void; -export function assertScopable(node: object, opts?: object): void; -export function assertBlockParent(node: object, opts?: object): void; -export function assertBlock(node: object, opts?: object): void; -export function assertStatement(node: object, opts?: object): void; -export function assertTerminatorless(node: object, opts?: object): void; -export function assertCompletionStatement(node: object, opts?: object): void; -export function assertConditional(node: object, opts?: object): void; -export function assertLoop(node: object, opts?: object): void; -export function assertWhile(node: object, opts?: object): void; -export function assertExpressionWrapper(node: object, opts?: object): void; -export function assertFor(node: object, opts?: object): void; -export function assertForXStatement(node: object, opts?: object): void; -export function assertFunction(node: object, opts?: object): void; -export function assertFunctionParent(node: object, opts?: object): void; -export function assertPureish(node: object, opts?: object): void; -export function assertDeclaration(node: object, opts?: object): void; -export function assertLVal(node: object, opts?: object): void; -export function assertLiteral(node: object, opts?: object): void; -export function assertImmutable(node: object, opts?: object): void; -export function assertUserWhitespacable(node: object, opts?: object): void; -export function assertMethod(node: object, opts?: object): void; -export function assertObjectMember(node: object, opts?: object): void; -export function assertProperty(node: object, opts?: object): void; -export function assertUnaryLike(node: object, opts?: object): void; -export function assertPattern(node: object, opts?: object): void; -export function assertClass(node: object, opts?: object): void; -export function assertModuleDeclaration(node: object, opts?: object): void; -export function assertExportDeclaration(node: object, opts?: object): void; -export function assertModuleSpecifier(node: object, opts?: object): void; -export function assertFlow(node: object, opts?: object): void; -export function assertFlowBaseAnnotation(node: object, opts?: object): void; -export function assertFlowDeclaration(node: object, opts?: object): void; -export function assertJSX(node: object, opts?: object): void; -export function assertNumberLiteral(node: object, opts?: object): void; -export function assertRegexLiteral(node: object, opts?: object): void; +export function assertArrayExpression(node: object | null | undefined, opts?: object): void; +export function assertAssignmentExpression(node: object | null | undefined, opts?: object): void; +export function assertBinaryExpression(node: object | null | undefined, opts?: object): void; +export function assertDirective(node: object | null | undefined, opts?: object): void; +export function assertDirectiveLiteral(node: object | null | undefined, opts?: object): void; +export function assertBlockStatement(node: object | null | undefined, opts?: object): void; +export function assertBreakStatement(node: object | null | undefined, opts?: object): void; +export function assertCallExpression(node: object | null | undefined, opts?: object): void; +export function assertCatchClause(node: object | null | undefined, opts?: object): void; +export function assertConditionalExpression(node: object | null | undefined, opts?: object): void; +export function assertContinueStatement(node: object | null | undefined, opts?: object): void; +export function assertDebuggerStatement(node: object | null | undefined, opts?: object): void; +export function assertDoWhileStatement(node: object | null | undefined, opts?: object): void; +export function assertEmptyStatement(node: object | null | undefined, opts?: object): void; +export function assertExpressionStatement(node: object | null | undefined, opts?: object): void; +export function assertFile(node: object | null | undefined, opts?: object): void; +export function assertForInStatement(node: object | null | undefined, opts?: object): void; +export function assertForStatement(node: object | null | undefined, opts?: object): void; +export function assertFunctionDeclaration(node: object | null | undefined, opts?: object): void; +export function assertFunctionExpression(node: object | null | undefined, opts?: object): void; +export function assertIdentifier(node: object | null | undefined, opts?: object): void; +export function assertIfStatement(node: object | null | undefined, opts?: object): void; +export function assertLabeledStatement(node: object | null | undefined, opts?: object): void; +export function assertStringLiteral(node: object | null | undefined, opts?: object): void; +export function assertNumericLiteral(node: object | null | undefined, opts?: object): void; +export function assertNullLiteral(node: object | null | undefined, opts?: object): void; +export function assertBooleanLiteral(node: object | null | undefined, opts?: object): void; +export function assertRegExpLiteral(node: object | null | undefined, opts?: object): void; +export function assertLogicalExpression(node: object | null | undefined, opts?: object): void; +export function assertMemberExpression(node: object | null | undefined, opts?: object): void; +export function assertNewExpression(node: object | null | undefined, opts?: object): void; +export function assertProgram(node: object | null | undefined, opts?: object): void; +export function assertObjectExpression(node: object | null | undefined, opts?: object): void; +export function assertObjectMethod(node: object | null | undefined, opts?: object): void; +export function assertObjectProperty(node: object | null | undefined, opts?: object): void; +export function assertRestElement(node: object | null | undefined, opts?: object): void; +export function assertReturnStatement(node: object | null | undefined, opts?: object): void; +export function assertSequenceExpression(node: object | null | undefined, opts?: object): void; +export function assertSwitchCase(node: object | null | undefined, opts?: object): void; +export function assertSwitchStatement(node: object | null | undefined, opts?: object): void; +export function assertThisExpression(node: object | null | undefined, opts?: object): void; +export function assertThrowStatement(node: object | null | undefined, opts?: object): void; +export function assertTryStatement(node: object | null | undefined, opts?: object): void; +export function assertUnaryExpression(node: object | null | undefined, opts?: object): void; +export function assertUpdateExpression(node: object | null | undefined, opts?: object): void; +export function assertVariableDeclaration(node: object | null | undefined, opts?: object): void; +export function assertVariableDeclarator(node: object | null | undefined, opts?: object): void; +export function assertWhileStatement(node: object | null | undefined, opts?: object): void; +export function assertWithStatement(node: object | null | undefined, opts?: object): void; +export function assertAssignmentPattern(node: object | null | undefined, opts?: object): void; +export function assertArrayPattern(node: object | null | undefined, opts?: object): void; +export function assertArrowFunctionExpression(node: object | null | undefined, opts?: object): void; +export function assertClassBody(node: object | null | undefined, opts?: object): void; +export function assertClassDeclaration(node: object | null | undefined, opts?: object): void; +export function assertClassExpression(node: object | null | undefined, opts?: object): void; +export function assertExportAllDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportDefaultDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportNamedDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportSpecifier(node: object | null | undefined, opts?: object): void; +export function assertForOfStatement(node: object | null | undefined, opts?: object): void; +export function assertImportDeclaration(node: object | null | undefined, opts?: object): void; +export function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object): void; +export function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object): void; +export function assertImportSpecifier(node: object | null | undefined, opts?: object): void; +export function assertMetaProperty(node: object | null | undefined, opts?: object): void; +export function assertClassMethod(node: object | null | undefined, opts?: object): void; +export function assertObjectPattern(node: object | null | undefined, opts?: object): void; +export function assertSpreadElement(node: object | null | undefined, opts?: object): void; +export function assertSuper(node: object | null | undefined, opts?: object): void; +export function assertTaggedTemplateExpression(node: object | null | undefined, opts?: object): void; +export function assertTemplateElement(node: object | null | undefined, opts?: object): void; +export function assertTemplateLiteral(node: object | null | undefined, opts?: object): void; +export function assertYieldExpression(node: object | null | undefined, opts?: object): void; +export function assertAnyTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertArrayTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertBooleanTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertClassImplements(node: object | null | undefined, opts?: object): void; +export function assertClassProperty(node: object | null | undefined, opts?: object): void; +export function assertDeclareClass(node: object | null | undefined, opts?: object): void; +export function assertDeclareFunction(node: object | null | undefined, opts?: object): void; +export function assertDeclareInterface(node: object | null | undefined, opts?: object): void; +export function assertDeclareModule(node: object | null | undefined, opts?: object): void; +export function assertDeclareTypeAlias(node: object | null | undefined, opts?: object): void; +export function assertDeclareVariable(node: object | null | undefined, opts?: object): void; +export function assertExistentialTypeParam(node: object | null | undefined, opts?: object): void; +export function assertFunctionTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertFunctionTypeParam(node: object | null | undefined, opts?: object): void; +export function assertGenericTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertInterfaceExtends(node: object | null | undefined, opts?: object): void; +export function assertInterfaceDeclaration(node: object | null | undefined, opts?: object): void; +export function assertIntersectionTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertMixedTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNullableTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNumericLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNumberTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertStringTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertThisTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTupleTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTypeofTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTypeAlias(node: object | null | undefined, opts?: object): void; +export function assertTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTypeCastExpression(node: object | null | undefined, opts?: object): void; +export function assertTypeParameter(node: object | null | undefined, opts?: object): void; +export function assertTypeParameterDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTypeParameterInstantiation(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeCallProperty(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeIndexer(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeProperty(node: object | null | undefined, opts?: object): void; +export function assertQualifiedTypeIdentifier(node: object | null | undefined, opts?: object): void; +export function assertUnionTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertVoidTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertJSXAttribute(node: object | null | undefined, opts?: object): void; +export function assertJSXClosingElement(node: object | null | undefined, opts?: object): void; +export function assertJSXElement(node: object | null | undefined, opts?: object): void; +export function assertJSXEmptyExpression(node: object | null | undefined, opts?: object): void; +export function assertJSXExpressionContainer(node: object | null | undefined, opts?: object): void; +export function assertJSXIdentifier(node: object | null | undefined, opts?: object): void; +export function assertJSXMemberExpression(node: object | null | undefined, opts?: object): void; +export function assertJSXNamespacedName(node: object | null | undefined, opts?: object): void; +export function assertJSXOpeningElement(node: object | null | undefined, opts?: object): void; +export function assertJSXSpreadAttribute(node: object | null | undefined, opts?: object): void; +export function assertJSXText(node: object | null | undefined, opts?: object): void; +export function assertNoop(node: object | null | undefined, opts?: object): void; +export function assertParenthesizedExpression(node: object | null | undefined, opts?: object): void; +export function assertAwaitExpression(node: object | null | undefined, opts?: object): void; +export function assertBindExpression(node: object | null | undefined, opts?: object): void; +export function assertDecorator(node: object | null | undefined, opts?: object): void; +export function assertDoExpression(node: object | null | undefined, opts?: object): void; +export function assertExportDefaultSpecifier(node: object | null | undefined, opts?: object): void; +export function assertExportNamespaceSpecifier(node: object | null | undefined, opts?: object): void; +export function assertRestProperty(node: object | null | undefined, opts?: object): void; +export function assertSpreadProperty(node: object | null | undefined, opts?: object): void; +export function assertExpression(node: object | null | undefined, opts?: object): void; +export function assertBinary(node: object | null | undefined, opts?: object): void; +export function assertScopable(node: object | null | undefined, opts?: object): void; +export function assertBlockParent(node: object | null | undefined, opts?: object): void; +export function assertBlock(node: object | null | undefined, opts?: object): void; +export function assertStatement(node: object | null | undefined, opts?: object): void; +export function assertTerminatorless(node: object | null | undefined, opts?: object): void; +export function assertCompletionStatement(node: object | null | undefined, opts?: object): void; +export function assertConditional(node: object | null | undefined, opts?: object): void; +export function assertLoop(node: object | null | undefined, opts?: object): void; +export function assertWhile(node: object | null | undefined, opts?: object): void; +export function assertExpressionWrapper(node: object | null | undefined, opts?: object): void; +export function assertFor(node: object | null | undefined, opts?: object): void; +export function assertForXStatement(node: object | null | undefined, opts?: object): void; +export function assertFunction(node: object | null | undefined, opts?: object): void; +export function assertFunctionParent(node: object | null | undefined, opts?: object): void; +export function assertPureish(node: object | null | undefined, opts?: object): void; +export function assertDeclaration(node: object | null | undefined, opts?: object): void; +export function assertLVal(node: object | null | undefined, opts?: object): void; +export function assertLiteral(node: object | null | undefined, opts?: object): void; +export function assertImmutable(node: object | null | undefined, opts?: object): void; +export function assertUserWhitespacable(node: object | null | undefined, opts?: object): void; +export function assertMethod(node: object | null | undefined, opts?: object): void; +export function assertObjectMember(node: object | null | undefined, opts?: object): void; +export function assertProperty(node: object | null | undefined, opts?: object): void; +export function assertUnaryLike(node: object | null | undefined, opts?: object): void; +export function assertPattern(node: object | null | undefined, opts?: object): void; +export function assertClass(node: object | null | undefined, opts?: object): void; +export function assertModuleDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportDeclaration(node: object | null | undefined, opts?: object): void; +export function assertModuleSpecifier(node: object | null | undefined, opts?: object): void; +export function assertFlow(node: object | null | undefined, opts?: object): void; +export function assertFlowBaseAnnotation(node: object | null | undefined, opts?: object): void; +export function assertFlowDeclaration(node: object | null | undefined, opts?: object): void; +export function assertJSX(node: object | null | undefined, opts?: object): void; +export function assertNumberLiteral(node: object | null | undefined, opts?: object): void; +export function assertRegexLiteral(node: object | null | undefined, opts?: object): void; -export function assertTSAnyKeyword(node: object, opts?: object): void; -export function assertTSArrayType(node: object, opts?: object): void; -export function assertTSAsExpression(node: object, opts?: object): void; -export function assertTSBooleanKeyword(node: object, opts?: object): void; -export function assertTSCallSignatureDeclaration(node: object, opts?: object): void; -export function assertTSConstructSignatureDeclaration(node: object, opts?: object): void; -export function assertTSConstructorType(node: object, opts?: object): void; -export function assertTSDeclareFunction(node: object, opts?: object): void; -export function assertTSDeclareMethod(node: object, opts?: object): void; -export function assertTSEnumDeclaration(node: object, opts?: object): void; -export function assertTSEnumMember(node: object, opts?: object): void; -export function assertTSExportAssignment(node: object, opts?: object): void; -export function assertTSExpressionWithTypeArguments(node: object, opts?: object): void; -export function assertTSExternalModuleReference(node: object, opts?: object): void; -export function assertTSFunctionType(node: object, opts?: object): void; -export function assertTSImportEqualsDeclaration(node: object, opts?: object): void; -export function assertTSIndexSignature(node: object, opts?: object): void; -export function assertTSIndexedAccessType(node: object, opts?: object): void; -export function assertTSInterfaceBody(node: object, opts?: object): void; -export function assertTSInterfaceDeclaration(node: object, opts?: object): void; -export function assertTSIntersectionType(node: object, opts?: object): void; -export function assertTSLiteralType(node: object, opts?: object): void; -export function assertTSMappedType(node: object, opts?: object): void; -export function assertTSMethodSignature(node: object, opts?: object): void; -export function assertTSModuleBlock(node: object, opts?: object): void; -export function assertTSModuleDeclaration(node: object, opts?: object): void; -export function assertTSNamespaceExportDeclaration(node: object, opts?: object): void; -export function assertTSNeverKeyword(node: object, opts?: object): void; -export function assertTSNonNullExpression(node: object, opts?: object): void; -export function assertTSNullKeyword(node: object, opts?: object): void; -export function assertTSNumberKeyword(node: object, opts?: object): void; -export function assertTSObjectKeyword(node: object, opts?: object): void; -export function assertTSParameterProperty(node: object, opts?: object): void; -export function assertTSParenthesizedType(node: object, opts?: object): void; -export function assertTSPropertySignature(node: object, opts?: object): void; -export function assertTSQualifiedName(node: object, opts?: object): void; -export function assertTSStringKeyword(node: object, opts?: object): void; -export function assertTSSymbolKeyword(node: object, opts?: object): void; -export function assertTSThisType(node: object, opts?: object): void; -export function assertTSTupleType(node: object, opts?: object): void; -export function assertTSTypeAliasDeclaration(node: object, opts?: object): void; -export function assertTSTypeAnnotation(node: object, opts?: object): void; -export function assertTSTypeAssertion(node: object, opts?: object): void; -export function assertTSTypeLiteral(node: object, opts?: object): void; -export function assertTSTypeOperator(node: object, opts?: object): void; -export function assertTSTypeParameter(node: object, opts?: object): void; -export function assertTSTypeParameterDeclaration(node: object, opts?: object): void; -export function assertTSTypeParameterInstantiation(node: object, opts?: object): void; -export function assertTSTypePredicate(node: object, opts?: object): void; -export function assertTSTypeQuery(node: object, opts?: object): void; -export function assertTSTypeReference(node: object, opts?: object): void; -export function assertTSUndefinedKeyword(node: object, opts?: object): void; -export function assertTSUnionType(node: object, opts?: object): void; -export function assertTSVoidKeyword(node: object, opts?: object): void; +export function assertTSAnyKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSArrayType(node: object | null | undefined, opts?: object): void; +export function assertTSAsExpression(node: object | null | undefined, opts?: object): void; +export function assertTSBooleanKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSCallSignatureDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSConstructorType(node: object | null | undefined, opts?: object): void; +export function assertTSDeclareFunction(node: object | null | undefined, opts?: object): void; +export function assertTSDeclareMethod(node: object | null | undefined, opts?: object): void; +export function assertTSEnumDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSEnumMember(node: object | null | undefined, opts?: object): void; +export function assertTSExportAssignment(node: object | null | undefined, opts?: object): void; +export function assertTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object): void; +export function assertTSExternalModuleReference(node: object | null | undefined, opts?: object): void; +export function assertTSFunctionType(node: object | null | undefined, opts?: object): void; +export function assertTSImportEqualsDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSIndexSignature(node: object | null | undefined, opts?: object): void; +export function assertTSIndexedAccessType(node: object | null | undefined, opts?: object): void; +export function assertTSInterfaceBody(node: object | null | undefined, opts?: object): void; +export function assertTSInterfaceDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSIntersectionType(node: object | null | undefined, opts?: object): void; +export function assertTSLiteralType(node: object | null | undefined, opts?: object): void; +export function assertTSMappedType(node: object | null | undefined, opts?: object): void; +export function assertTSMethodSignature(node: object | null | undefined, opts?: object): void; +export function assertTSModuleBlock(node: object | null | undefined, opts?: object): void; +export function assertTSModuleDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSNeverKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSNonNullExpression(node: object | null | undefined, opts?: object): void; +export function assertTSNullKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSNumberKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSObjectKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSParameterProperty(node: object | null | undefined, opts?: object): void; +export function assertTSParenthesizedType(node: object | null | undefined, opts?: object): void; +export function assertTSPropertySignature(node: object | null | undefined, opts?: object): void; +export function assertTSQualifiedName(node: object | null | undefined, opts?: object): void; +export function assertTSStringKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSSymbolKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSThisType(node: object | null | undefined, opts?: object): void; +export function assertTSTupleType(node: object | null | undefined, opts?: object): void; +export function assertTSTypeAliasDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTSTypeAssertion(node: object | null | undefined, opts?: object): void; +export function assertTSTypeLiteral(node: object | null | undefined, opts?: object): void; +export function assertTSTypeOperator(node: object | null | undefined, opts?: object): void; +export function assertTSTypeParameter(node: object | null | undefined, opts?: object): void; +export function assertTSTypeParameterDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSTypeParameterInstantiation(node: object | null | undefined, opts?: object): void; +export function assertTSTypePredicate(node: object | null | undefined, opts?: object): void; +export function assertTSTypeQuery(node: object | null | undefined, opts?: object): void; +export function assertTSTypeReference(node: object | null | undefined, opts?: object): void; +export function assertTSUndefinedKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSUnionType(node: object | null | undefined, opts?: object): void; +export function assertTSVoidKeyword(node: object | null | undefined, opts?: object): void; diff --git a/types/babel-types/tsconfig.json b/types/babel-types/tsconfig.json index 92d7d6442e..f4a6179f99 100644 --- a/types/babel-types/tsconfig.json +++ b/types/babel-types/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/babel__core/babel__core-tests.ts b/types/babel__core/babel__core-tests.ts index ba51ac21be..b44e45c605 100644 --- a/types/babel__core/babel__core-tests.ts +++ b/types/babel__core/babel__core-tests.ts @@ -39,3 +39,59 @@ babel.transformFromAstAsync(parsedAst!, sourceCode, options).then(transformFromA const { code, map, ast } = transformFromAstAsyncResult!; const { body } = ast!.program; }); + +function checkOptions(_options: babel.TransformOptions) {} +function checkConfigFunction(_config: babel.ConfigFunction) {} + +checkOptions({ envName: 'banana' }); +// babel uses object destructuring default to provide the envName fallback so null is not allowed +// $ExpectError +checkOptions({ envName: null }); +checkOptions({ caller: { name: '@babel/register' } }); +checkOptions({ caller: { name: 'babel-jest', supportsStaticESM: false } }); +// don't add an index signature; users should augment the interface instead if they need to +// $ExpectError +checkOptions({ caller: { name: '', tomato: true } }); +checkOptions({ rootMode: 'upward-optional' }); +// $ExpectError +checkOptions({ rootMode: 'potato' }); + +// $ExpectError +checkConfigFunction(() => {}); +// you technically can do that though you probably shouldn't +checkConfigFunction(() => ({})); +checkConfigFunction(api => { + api.assertVersion(7); + api.assertVersion("^7.2"); + + api.cache.forever(); + api.cache.never(); + api.cache.using(() => true); + api.cache.using(() => 1); + api.cache.using(() => '1'); + api.cache.using(() => null); + api.cache.using(() => undefined); + // $ExpectError + api.cache.using(() => ({})); + api.cache.invalidate(() => 2); + + // $ExpectType string + api.env(); + + api.env('development'); + api.env(['production', 'test']); + // $ExpectType 42 + api.env(name => 42); + + // $ExpectType string + api.version; + + return { + shouldPrintComment(comment) { + // $ExpectType string + comment; + + return true; + } + }; +}); diff --git a/types/babel__core/index.d.ts b/types/babel__core/index.d.ts index 66501d24db..3875d40d71 100644 --- a/types/babel__core/index.d.ts +++ b/types/babel__core/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for @babel/core 7.0 +// Type definitions for @babel/core 7.1 // Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io // Definitions by: Troy Gerwien // Marvin Hagemeister // Melvin Groenhoff +// Jessica Franco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 @@ -54,6 +55,15 @@ export interface TransformOptions { */ root?: string | null; + /** + * This option, combined with the "root" value, defines how Babel chooses its project root. + * The different modes define different ways that Babel can process the "root" value to get + * the final project root. + * + * @see https://babeljs.io/docs/en/next/options#rootmode + */ + rootMode?: 'root' | 'upward' | 'upward-optional'; + /** * The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files. * @@ -82,7 +92,7 @@ export interface TransformOptions { * * Default: env vars */ - envName?: string | null; + envName?: string; /** * Enable code generation @@ -112,6 +122,14 @@ export interface TransformOptions { */ cwd?: string | null; + /** + * Utilities may pass a caller object to identify themselves to Babel and + * pass capability-related flags for use by configs, presets and plugins. + * + * @see https://babeljs.io/docs/en/next/options#caller + */ + caller?: TransformCaller; + /** * This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }` * which will use those options when the `envName` is `production` @@ -284,6 +302,14 @@ export interface TransformOptions { wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null; } +export interface TransformCaller { + // the only required property + name: string; + // e.g. set to true by `babel-loader` and false by `babel-jest` + supportsStaticESM?: boolean; + // augment this with a "declare module '@babel/core' { ... }" if you need more keys +} + export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any; /** @@ -528,4 +554,129 @@ export interface CreateConfigItemOptions { */ export function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem; +// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't +/** + * @see https://babeljs.io/docs/en/next/config-files#config-function-api + */ +export interface ConfigAPI { + /** + * The version string for the Babel version that is loading the config file. + * + * @see https://babeljs.io/docs/en/next/config-files#apiversion + */ + version: string; + /** + * @see https://babeljs.io/docs/en/next/config-files#apicache + */ + cache: SimpleCacheConfigurator; + /** + * @see https://babeljs.io/docs/en/next/config-files#apienv + */ + env: EnvFunction; + // undocumented; currently hardcoded to return 'false' + // async(): boolean + /** + * This API is used as a way to access the `caller` data that has been passed to Babel. + * Since many instances of Babel may be running in the same process with different `caller` values, + * this API is designed to automatically configure `api.cache`, the same way `api.env()` does. + * + * The `caller` value is available as the first parameter of the callback function. + * It is best used with something like this to toggle configuration behavior + * based on a specific environment: + * + * @example + * function isBabelRegister(caller?: { name: string }) { + * return !!(caller && caller.name === "@babel/register") + * } + * api.caller(isBabelRegister) + * + * @see https://babeljs.io/docs/en/next/config-files#apicallercb + */ + caller(callerCallback: (caller: TransformOptions['caller']) => T): T; + /** + * While `api.version` can be useful in general, it's sometimes nice to just declare your version. + * This API exposes a simple way to do that with: + * + * @example + * api.assertVersion(7) // major version only + * api.assertVersion("^7.2") + * + * @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange + */ + assertVersion(versionRange: number | string): boolean; + // NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types + // tokTypes: typeof tokTypes +} + +/** + * JS configs are great because they can compute a config on the fly, + * but the downside there is that it makes caching harder. + * Babel wants to avoid re-executing the config function every time a file is compiled, + * because then it would also need to re-execute any plugin and preset functions + * referenced in that config. + * + * To avoid this, Babel expects users of config functions to tell it how to manage caching + * within a config file. + * + * @see https://babeljs.io/docs/en/next/config-files#apicache + */ +export interface SimpleCacheConfigurator { + // there is an undocumented call signature that is a shorthand for forever()/never()/using(). + // (ever: boolean): void + // (callback: CacheCallback): T + /** + * Permacache the computed config and never call the function again. + */ + forever(): void; + /** + * Do not cache this config, and re-execute the function every time. + */ + never(): void; + /** + * Any time the using callback returns a value other than the one that was expected, + * the overall config function will be called again and a new entry will be added to the cache. + * + * @example + * api.cache.using(() => process.env.NODE_ENV) + */ + using(callback: SimpleCacheCallback): T; + /** + * Any time the using callback returns a value other than the one that was expected, + * the overall config function will be called again and all entries in the cache will + * be replaced with the result. + * + * @example + * api.cache.invalidate(() => process.env.NODE_ENV) + */ + invalidate(callback: SimpleCacheCallback): T; +} + +// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231 +export type SimpleCacheKey = string | boolean | number | null | undefined; +export type SimpleCacheCallback = () => T; + +/** + * Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function + * meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel + * was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set. + * + * @see https://babeljs.io/docs/en/next/config-files#apienv + */ +export interface EnvFunction { + /** + * @returns the current `envName` string + */ + (): string; + /** + * @returns `true` if the `envName` is `===` any of the given strings + */ + (envName: string | ReadonlyArray): boolean; + // the official documentation is misleading for this one... + // this just passes the callback to `cache.using` but with an additional argument. + // it returns its result instead of necessarily returning a boolean. + (envCallback: (envName: NonNullable) => T): T; +} + +export type ConfigFunction = (api: ConfigAPI) => TransformOptions; + export as namespace babel; diff --git a/types/backbone-associations/index.d.ts b/types/backbone-associations/index.d.ts index d0681c6651..c93eb965e8 100644 --- a/types/backbone-associations/index.d.ts +++ b/types/backbone-associations/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Backbone-associations 0.6.4 -// Project: https://github.com/dhruvaray/backbone-associations/ +// Project: http://dhruvaray.github.io/backbone-associations // Definitions by: Craig Brett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/backbone-relational/index.d.ts b/types/backbone-relational/index.d.ts index f19cfa8daa..e9cc5e71ff 100644 --- a/types/backbone-relational/index.d.ts +++ b/types/backbone-relational/index.d.ts @@ -7,180 +7,163 @@ /// -import { Events, EventsHash, Model as BModel, Collection } from 'backbone'; +import { EventsMixin, Events, Model as BModel, Collection } from 'backbone'; -declare module 'backbone-relational' { - class Model extends BModel { - /** - * Do not use, prefer TypeScript's extend functionality. - **/ - //private static extend(properties:any, classProperties?:any):any; +export class Model extends BModel { + /** + * Do not use, prefer TypeScript's extend functionality. + **/ + //private static extend(properties:any, classProperties?:any):any; - relations:any; - subModelTypes:any; - subModelTypeAttribute:any; + relations:any; + subModelTypes:any; + subModelTypeAttribute:any; - initializeRelations(options:any):void; + initializeRelations(options:any):void; - updateRelations(options:any):void; + updateRelations(options:any):void; - queue(func:any):void; + queue(func:any):void; - processQueue():void; + processQueue():void; - getRelation(name:string):Relation; + getRelation(name:string):Relation; - getRelations():Relation[]; + getRelations():Relation[]; - fetchRelated(key:string, options?:any, update?:boolean):any; + fetchRelated(key:string, options?:any, update?:boolean):any; - toJSON(options?: any):any; + toJSON(options?: any):any; - static setup(); + static setup(); - static build(attributes:any, options?:any); + static build(attributes:any, options?:any); - static findOrCreate(attributes:string, options?:any); + static findOrCreate(attributes:string, options?:any); - static findOrCreate(attributes:number, options?:any); + static findOrCreate(attributes:number, options?:any); - static findOrCreate(attributes:any, options?:any); - } + static findOrCreate(attributes:any, options?:any); +} - export class Relation extends BModel { +export class Relation extends BModel { - options:any; - instance:any; - key:any; - keyContents:any; - relatedModel:any; - relatedCollection:any; - reverseRelation:any; - related:any; + options:any; + instance:any; + key:any; + keyContents:any; + relatedModel:any; + relatedCollection:any; + reverseRelation:any; + related:any; - checkPreconditions():boolean; + checkPreconditions():boolean; - setRelated(related:BModel):void; + setRelated(related:BModel):void; - setRelated(related:Collection):void; + setRelated(related:Collection):void; - getReverseRelations(model:Model):Relation; + getReverseRelations(model:Model):Relation; - destroy():void; - } + destroy():void; +} - export class HasOne extends Relation { - collectionType:any; +export class HasOne extends Relation { + collectionType:any; - findRelated(options:any):BModel; + findRelated(options:any):BModel; - setKeyContents(keyContents:string):void; + setKeyContents(keyContents:string):void; - setKeyContents(keyContents:string[]):void; + setKeyContents(keyContents:string[]):void; - setKeyContents(keyContents:number):void; + setKeyContents(keyContents:number):void; - setKeyContents(keyContents:number[]):void; + setKeyContents(keyContents:number[]):void; - setKeyContents(keyContents:Collection):void; + setKeyContents(keyContents:Collection):void; - onChange(model:BModel, attr:any, options:any):void; + onChange(model:BModel, attr:any, options:any):void; - handleAddition(model:BModel, coll:Collection, options:any):void; + handleAddition(model:BModel, coll:Collection, options:any):void; - handleRemoval(model:BModel, coll:Collection, options:any):void; + handleRemoval(model:BModel, coll:Collection, options:any):void; - handleReset(coll:Collection, options:any):void; + handleReset(coll:Collection, options:any):void; - tryAddRelated(model:BModel, coll:any, options:any):void; + tryAddRelated(model:BModel, coll:any, options:any):void; - addRelated(model:BModel, options:any):void; + addRelated(model:BModel, options:any):void; - removeRelated(model:BModel, coll:any, options:any):void; - - } - - - export class HasMany extends Relation { - collectionType:any; - - findRelated(options:any):BModel; - - setKeyContents(keyContents:string):void; - - setKeyContents(keyContents:number):void; - - setKeyContents(keyContents:BModel):void; - - onChange(model:BModel, attr:any, options:any):void; - - tryAddRelated(model:BModel, coll:any, options:any):void; - - addRelated(model:BModel, options:any):void; - - removeRelated(model:BModel, coll:any, options:any):void; - - } - - export class Store implements Events { - on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; - on(eventMap: EventsHash): any; - on(eventName: any, callback?: any, context?: any): any; - off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; - unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - once(events: string, callback: (...args: any[]) => void, context?: any): any; - listenTo(object: any, events: string, callback: (...args: any[]) => void): any; - listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; - stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; - - initializeRelation(model, relation, options); - - addModelScope(scope:any):void; - - removeModelScope(scope):void; - - addSubModels(subModelTypes:Model, superModelType:Model):void; - - setupSuperModel(modelType:Model):void; - - addReverseRelation(relation:any):void; - - addOrphanRelation(relation:any):void; - - processOrphanRelations():void; - - retroFitRelation(relation:Model, create:boolean):Collection; - - getCollection(type:Model, create:boolean):Collection; - - getObjectByName(name:string):any; - - - resolveIdForItem(type:any, item:any):any; - - static find(type:any, item:string):Model; - - static find(type:any, item:number):Model; - - static find(type:any, item:Model):Model; - - static find(type:any, item:any):Model; - - register(model:Model):void; - - checkId(model:Model, id:any):void; - - update(model:Model):void; - - unregister(model:Model, collection:Collection, options:any):void; - - reset():void; - - - } + removeRelated(model:BModel, coll:any, options:any):void; } + +export class HasMany extends Relation { + collectionType:any; + + findRelated(options:any):BModel; + + setKeyContents(keyContents:string):void; + + setKeyContents(keyContents:number):void; + + setKeyContents(keyContents:BModel):void; + + onChange(model:BModel, attr:any, options:any):void; + + tryAddRelated(model:BModel, coll:any, options:any):void; + + addRelated(model:BModel, options:any):void; + + removeRelated(model:BModel, coll:any, options:any):void; + +} + +export class Store extends EventsMixin implements Events { + initializeRelation(model, relation, options); + + addModelScope(scope:any):void; + + removeModelScope(scope):void; + + addSubModels(subModelTypes:Model, superModelType:Model):void; + + setupSuperModel(modelType:Model):void; + + addReverseRelation(relation:any):void; + + addOrphanRelation(relation:any):void; + + processOrphanRelations():void; + + retroFitRelation(relation:Model, create:boolean):Collection; + + getCollection(type:Model, create:boolean):Collection; + + getObjectByName(name:string):any; + + + resolveIdForItem(type:any, item:any):any; + + static find(type:any, item:string):Model; + + static find(type:any, item:number):Model; + + static find(type:any, item:Model):Model; + + static find(type:any, item:any):Model; + + register(model:Model):void; + + checkId(model:Model, id:any):void; + + update(model:Model):void; + + unregister(model:Model, collection:Collection, options:any):void; + + reset():void; + +} diff --git a/types/backbone-relational/tslint.json b/types/backbone-relational/tslint.json index a41bf5d19a..65e27fce52 100644 --- a/types/backbone-relational/tslint.json +++ b/types/backbone-relational/tslint.json @@ -1,79 +1,24 @@ { "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 } } diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index 1025940214..f24d80ff4d 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -6,6 +6,7 @@ // Volker Nauruhn , // Ard Timmerman , // J. Joe Koullas +// Julian Gonggrijp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -407,20 +408,14 @@ export interface ObjectOptions extends RadioMixinOptions { * A base class which other classes can extend from. Object incorporates many * backbone conventions and utilities like initialize and Backbone.Events. */ -export class Object implements CommonMixin, RadioMixin, Backbone.Events { +export class Object extends Backbone.EventsMixin implements CommonMixin, RadioMixin, Backbone.Events { constructor(options?: ObjectOptions); - on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; - on(eventMap: EventsHash): any; + /** + * Faulty overgeneralization of Backbone.Events.on, for historical + * reasons. + */ on(eventName: any, callback?: any, context?: any): any; - off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; - unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - once(events: string, callback: (...args: any[]) => void, context?: any): any; - listenTo(object: any, events: string, callback: (...args: any[]) => void): any; - listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; - stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; /** * Receives a hash of event names and functions and/or function names, diff --git a/types/backbone.radio/index.d.ts b/types/backbone.radio/index.d.ts index ac953aa00b..e6682bd52e 100644 --- a/types/backbone.radio/index.d.ts +++ b/types/backbone.radio/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Backbone.Radio v0.8.3 // Project: https://github.com/marionettejs/backbone.radio // Definitions by: Peter Palotas +// Julian Gonggrijp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -71,18 +72,12 @@ declare module "backbone" { stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests; } - class Channel implements Commands, Requests, Backbone.Events { - on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; - on(eventMap: EventsHash): any; + class Channel extends Backbone.EventsMixin implements Commands, Requests, Backbone.Events { + /** + * Faulty overgeneralization of Backbone.Events.on, for historical + * reasons. + */ on(eventName: any, callback?: any, context?: any): any; - off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; - unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - once(events: string, callback: (...args: any[]) => void, context?: any): any; - listenTo(object: any, events: string, callback: (...args: any[]) => void): any; - listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; - stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; channelName: string; reset(): Channel; diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index 563c21634c..c36b92ff3f 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -15,6 +15,50 @@ function test_events() { object.off(); } +class PubSub implements Backbone.Events { + on: Backbone.Events_On; + off: Backbone.Events_Off; + trigger: Backbone.Events_Trigger; + bind: Backbone.Events_On; + unbind: Backbone.Events_Off; + + once: Backbone.Events_On; + listenTo: Backbone.Events_Listen; + listenToOnce: Backbone.Events_Listen; + stopListening: Backbone.Events_Stop; +} + +Object.assign(PubSub.prototype, Backbone.Events); + +function test_events_shorthands() { + let channel1 = new PubSub(); + let channel2 = new PubSub(); + let onChange = () => alert('whatever'); + + channel1.on("alert", (eventName: string) => alert("Triggered " + eventName)); + channel1.trigger("alert", "an event"); + + channel1.once('invalid', () => { }, this); + channel1.once('invalid', () => { }); + channel1.once({invalid: () => { }, success: () => { }}, this); + channel1.once({invalid: () => { }, success: () => { }}); + + channel1.off("change", onChange); + channel1.off("change"); + channel1.off(null, onChange); + channel1.off(null, null, this); + channel1.off(); + + channel2.listenTo(channel1, 'invalid', () => { }); + channel2.listenTo(channel1, {invalid: () => { }, success: () => { }}); + channel2.listenToOnce(channel1, 'invalid', () => { }); + channel2.listenToOnce(channel1, {invalid: () => { }, success: () => { }}); + + channel2.stopListening(channel1, 'invalid', () => { }); + channel2.stopListening(channel1, 'invalid'); + channel2.stopListening(channel1); +} + class SettingDefaults extends Backbone.Model { // 'defaults' could be set in one of the following ways: @@ -272,18 +316,22 @@ namespace v1Changes { var model = new Employee; model.once('invalid', () => { }, this); model.once('invalid', () => { }); + model.once({invalid: () => { }, success: () => { }}, this); + model.once({invalid: () => { }, success: () => { }}); } function test_listenTo() { var model = new Employee; var view = new Backbone.View(); view.listenTo(model, 'invalid', () => { }); + view.listenTo(model, {invalid: () => { }, success: () => { }}); } function test_listenToOnce() { var model = new Employee; var view = new Backbone.View(); view.listenToOnce(model, 'invalid', () => { }); + view.listenToOnce(model, {invalid: () => { }, success: () => { }}); } function test_stopListening() { @@ -398,7 +446,7 @@ namespace v1Changes { namespace Collection { function test_fetch() { var collection = new EmployeeCollection; - collection.fetch({ + collection.fetch({ reset: true, remove: false }); diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index a881284c8f..58e3735f2b 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -1,9 +1,11 @@ // Type definitions for Backbone 1.3.3 // Project: http://backbonejs.org/ +// https://github.com/jashkenas/backbone // Definitions by: Boris Yankov // Natan Vivo // kenjiru // jjoekoullas +// Julian Gonggrijp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -91,44 +93,113 @@ declare namespace Backbone { [routePattern: string]: string | {(...urlParts: string[]): void}; } + /** + * DOM events (used in the events property of a View) + */ interface EventsHash { [selector: string]: string | {(eventObject: JQuery.TriggeredEvent): void}; } - export const Events: Events; - interface Events { - on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; - on(eventMap: EventsHash): any; - off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; - unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - - once(events: string, callback: (...args: any[]) => void, context?: any): any; - listenTo(object: any, events: string, callback: (...args: any[]) => void): any; - listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; - stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; + /** + * JavaScript events (used in the methods of the Events interface) + */ + interface EventHandler { + (...args: any[]): void; + } + interface EventMap { + [event: string]: EventHandler; } - class ModelBase implements Events { - on(eventName: string, callback?: Function, context?: any): any; - on(eventMap: EventsHash): any; - on(eventName: any, callback?: any, context?: any): any - off(eventName?: string, callback?: Function, context?: any): any - trigger(eventName: string, ...args: any[]): any - bind(eventName: string, callback: Function, context?: any): any - unbind(eventName?: string, callback?: Function, context?: any): any - once(events: string, callback: Function, context?: any): any - listenTo(object: any, events: string, callback: Function):any - listenToOnce(object: any, events: string, callback: Function): any - stopListening(object?: any, events?: string, callback?: Function): any + export const Events: Events; + interface Events extends EventsMixin { } + /** + * Helper shorthands for classes that implement the Events interface. + * Define your class like this: + * + * import { + * Events, + * Events_On, + * Events_Off, + * Events_Trigger, + * Events_Listen, + * Events_Stop, + * } from 'backbone'; + * + * class YourClass implements Events { + * on: Events_On; + * off: Events_Off; + * trigger: Events_Trigger; + * bind: Events_On; + * unbind: Events_Off; + * + * once: Events_On; + * listenTo: Events_Listen; + * listenToOnce: Events_Listen; + * stopListening: Events_Stop; + * + * // ... (other methods) + * } + * + * Object.assign(YourClass.prototype, Events); // can also use _.extend + * + * If you are just writing a class type declaration that doesn't already + * extend some other base class, you can use the EventsMixin instead; + * see below. + */ + interface Events_On { + (this: T, eventName: string, callback: EventHandler, context?: any): T; + (this: T, eventMap: EventMap, context?: any): T; + } + interface Events_Off { + (this: T, eventName?: string, callback?: EventHandler, context?: any): T; + } + interface Events_Trigger { + (this: T, eventName: string, ...args: any[]): T; + } + interface Events_Listen { + (this: T, object: any, events: string, callback: EventHandler): T; + (this: T, object: any, eventMap: EventMap): T; + } + interface Events_Stop { + (this: T, object?: any, events?: string, callback?: EventHandler): T; + } + + /** + * Helper to avoid code repetition in type declarations. + * Backbone.Events cannot be extended, hence a separate abstract + * class with a different name. Both classes and interfaces can + * extend from this helper class to reuse the signatures. + * + * For class type declarations that already extend another base + * class, and for actual class definitions, please see the + * Events_* interfaces above. + */ + abstract class EventsMixin implements Events { + on(eventName: string, callback: EventHandler, context?: any): this; + on(eventMap: EventMap, context?: any): this; + off(eventName?: string, callback?: EventHandler, context?: any): this; + trigger(eventName: string, ...args: any[]): this; + bind(eventName: string, callback: EventHandler, context?: any): this; + bind(eventMap: EventMap, context?: any): this; + unbind(eventName?: string, callback?: EventHandler, context?: any): this; + + once(events: string, callback: EventHandler, context?: any): this; + once(eventMap: EventMap, context?: any): this; + listenTo(object: any, events: string, callback: EventHandler): this; + listenTo(object: any, eventMap: EventMap): this; + listenToOnce(object: any, events: string, callback: EventHandler): this; + listenToOnce(object: any, eventMap: EventMap): this; + stopListening(object?: any, events?: string, callback?: EventHandler): this; + } + + class ModelBase extends EventsMixin { parse(response: any, options?: any): any; toJSON(options?: any): any; sync(...arg: any[]): JQueryXHR; } - class Model extends ModelBase { + class Model extends ModelBase implements Events { /** * Do not use, prefer TypeScript's extend functionality. @@ -229,7 +300,7 @@ declare namespace Backbone { matches(attrs: any): boolean; } - class Collection extends ModelBase { + class Collection extends ModelBase implements Events { /** * Do not use, prefer TypeScript's extend functionality. @@ -367,7 +438,7 @@ declare namespace Backbone { without(...values: TModel[]): TModel[]; } - class Router extends EventSignatures { + class Router extends EventsMixin implements Events { /** * Do not use, prefer TypeScript's extend functionality. @@ -396,7 +467,7 @@ declare namespace Backbone { var history: History; - class History extends EventSignatures { + class History extends EventsMixin implements Events { handlers: any[]; interval: number; @@ -433,7 +504,7 @@ declare namespace Backbone { attributes?: {[id: string]: any}; } - class View extends EventSignatures { + class View extends EventsMixin implements Events { /** * Do not use, prefer TypeScript's extend functionality. @@ -485,21 +556,3 @@ declare namespace Backbone { function noConflict(): typeof Backbone; var $: JQueryStatic; } - -/** - * This is not for external use and is only here as a convenient way to - * specify signatures for internal implementers of Backbone.Events - */ -declare abstract class EventSignatures implements Backbone.Events { - on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; - on(eventMap: Backbone.EventsHash): any; - off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; - unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; - - once(events: string, callback: (...args: any[]) => void, context?: any): any; - listenTo(object: any, events: string, callback: (...args: any[]) => void): any; - listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; - stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; -} \ No newline at end of file diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json index d67ffb3a73..f5ae3a6788 100644 --- a/types/backbone/tslint.json +++ b/types/backbone/tslint.json @@ -8,73 +8,35 @@ "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-angle-bracket-type-assertion": 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 } } diff --git a/types/baidu-app/index.d.ts b/types/baidu-app/index.d.ts index ff71f9c012..ea9454d471 100644 --- a/types/baidu-app/index.d.ts +++ b/types/baidu-app/index.d.ts @@ -4287,7 +4287,7 @@ declare namespace swan { Methods, Props > = object & - ComponentOptions Data), Methods, Props> & + ComponentOptions & ThisType>>; interface ComponentRelation { diff --git a/types/bit-twiddle/bit-twiddle-tests.ts b/types/bit-twiddle/bit-twiddle-tests.ts new file mode 100644 index 0000000000..6f2f155c3b --- /dev/null +++ b/types/bit-twiddle/bit-twiddle-tests.ts @@ -0,0 +1,23 @@ +import * as bitTwiddle from "bit-twiddle"; + +bitTwiddle.INT_BITS; +bitTwiddle.INT_MAX; +bitTwiddle.INT_MIN; + +bitTwiddle.sign(5); +bitTwiddle.abs(-5); +bitTwiddle.min(1, 6); +bitTwiddle.max(6, 1); +bitTwiddle.isPow2(3); +bitTwiddle.log2(3); +bitTwiddle.log10(3); +bitTwiddle.popCount(4); +bitTwiddle.countTrailingZeros(3.0000003); +bitTwiddle.nextPow2(31.315); +bitTwiddle.prevPow2(31.315); +bitTwiddle.parity(123); +bitTwiddle.interleave2(12, 24); +bitTwiddle.deinterleave2(24, 12); +bitTwiddle.interleave3(24, 12, 6); +bitTwiddle.deinterleave3(24, 12); +bitTwiddle.nextCombination(41.935); diff --git a/types/bit-twiddle/index.d.ts b/types/bit-twiddle/index.d.ts new file mode 100644 index 0000000000..e89e9500b0 --- /dev/null +++ b/types/bit-twiddle/index.d.ts @@ -0,0 +1,101 @@ +// Type definitions for bit-twiddle 1.0 +// Project: https://github.com/mikolalysenko/bit-twiddle +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + +export const INT_BITS: number; +export const INT_MAX: number; +export const INT_MIN: number; + +/** + * Computes the sign of the integer. + */ +export function sign(value: number): number; + +/** + * Returns the absolute value of the integer. + */ +export function abs(value: number): number; + +/** + * Computes the minimum of integers x and y. + */ +export function min(x: number, y: number): number; + +/** + * Computes the maximum of integers x and y. + */ +export function max(x: number, y: number): number; + +/** + * Returns true if value is a power of 2, otherwise false. + */ +export function isPow2(value: number): boolean; + +/** + * Returns an integer approximation of the log-base 2 of value. + */ +export function log2(value: number): number; + +/** + * Returns an integer approximation of the log-base 10 of value. + */ +export function log10(value: number): number; + +/** + * Counts the number of bits set in value. + */ +export function popCount(value: number): number; + +/** + * Counts the number of trailing zeros. + */ +export function countTrailingZeros(value: number): number; + +/** + * Rounds value up to the next power of 2. + */ +export function nextPow2(value: number): number; + +/** + * Rounds value down to the previous power of 2. + */ +export function prevPow2(value: number): number; + +/** + * Computes the parity of the bits in value. + */ +export function parity(value: number): number; + +/** + * Reverses the bits of value. + */ +export function reverse(value: number): number; + +/** + * Interleaves a pair of 16 bit integers. Useful for fast quadtree style indexing. + * @see http://en.wikipedia.org/wiki/Z-order_curve + */ +export function interleave2(x: number, y: number): number; + +/** + * Deinterleaves the bits of value, returns the nth part. + * If both x and y are 16 bit. + */ +export function deinterleave2(x: number, y: number): number; + +/** + * Interleaves a triple of 10 bit integers. Useful for fast octree indexing. + */ +export function interleave3(x: number, y: number, z: number): number; + +/** + * Same deal as deinterleave2, only for triples instead of pairs. + */ +export function deinterleave3(x: number, y: number): number; + +/** + * Returns next combination ordered colexicographically. + */ +export function nextCombination(x: number): number; diff --git a/types/bit-twiddle/tsconfig.json b/types/bit-twiddle/tsconfig.json new file mode 100644 index 0000000000..f1b094fd42 --- /dev/null +++ b/types/bit-twiddle/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bit-twiddle-tests.ts" + ] +} diff --git a/types/bit-twiddle/tslint.json b/types/bit-twiddle/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/bit-twiddle/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index da33188dd1..8924a941df 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -113,12 +113,15 @@ import Bluebird = require("bluebird"); declare global { + type IterateFunction = (item: T, index: number, arrayLength: number) => (R | PromiseLike); /* * Patch all instance method */ interface Promise { - all: Bluebird["all"]; - any: Bluebird["any"]; + all(this: Promise>): Bluebird; + all(): Bluebird; + any(this: Promise>): Bluebird; + any(): Bluebird; asCallback: Bluebird["asCallback"]; bind: Bluebird["bind"]; call: Bluebird["call"]; @@ -128,9 +131,9 @@ declare global { delay: Bluebird["delay"]; disposer: Bluebird["disposer"]; done: Bluebird["done"]; - each: Bluebird["each"]; + each(this: Promise>, iterator: IterateFunction): Bluebird; error: Bluebird["error"]; - filter: Bluebird["filter"]; + filter(this: Promise>, filterer: IterateFunction, options?: Bluebird.ConcurrencyOption): Bluebird; // finally: Bluebird["finally"]; // Provided by lib.es2018.promise.d.ts get: Bluebird["get"]; isCancelled: Bluebird["isCancelled"]; @@ -139,17 +142,18 @@ declare global { isRejected: Bluebird["isRejected"]; isResolved: Bluebird["isResolved"]; lastly: Bluebird["lastly"]; - map: Bluebird["map"]; - mapSeries: Bluebird["mapSeries"]; + map(this: Promise>, mapper: IterateFunction, options?: Bluebird.ConcurrencyOption): Bluebird; + mapSeries(this: Promise>, iterator: IterateFunction): Bluebird; nodeify: Bluebird["nodeify"]; props: Bluebird["props"]; - race: Bluebird["race"]; + race(this: Promise>): Bluebird; + race(): Bluebird; reason: Bluebird["reason"]; - reduce: Bluebird["reduce"]; + reduce(this: Promise>, reducer: (memo: U, item: Q, index: number, arrayLength: number) => (U | PromiseLike), initialValue?: U): Bluebird; reflect: Bluebird["reflect"]; return: Bluebird["return"]; - some: Bluebird["some"]; - spread: Bluebird["spread"]; + some(this: Promise>, count: number): Bluebird; + spread(this: Bluebird>, fulfilledHandler: (...values: Q[]) => (U | PromiseLike)): Bluebird; suppressUnhandledRejections: Bluebird["suppressUnhandledRejections"]; tap: Bluebird["tap"]; tapCatch: Bluebird["tapCatch"]; diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 24c2b79a32..13a11c2e3e 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -37,8 +37,6 @@ type Constructor = new (...args: any[]) => E; type CatchFilter = ((error: E) => boolean) | (object & E); -type IterableItem = R extends Iterable ? U : never; -type IterableOrNever = Extract>; type Resolvable = R | PromiseLike; type IterateFunction = (item: T, index: number, arrayLength: number) => Resolvable; @@ -352,7 +350,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - call(propertyName: U, ...args: any[]): Bluebird any ? ReturnType : never>; + call(this: Bluebird, propertyName: U, ...args: any[]): Bluebird any ? ReturnType : never>; /** * This is a convenience method for doing: @@ -562,12 +560,17 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. */ - spread(fulfilledHandler: (...values: Array>) => Resolvable): Bluebird; + spread(this: Bluebird>, fulfilledHandler: (...values: Q[]) => Resolvable): Bluebird; /** * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - all(): Bluebird>; + all(this: Bluebird>): Bluebird; + + /** + * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + all(): Bluebird; /** * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. @@ -578,42 +581,59 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - any(): Bluebird>; + any(this: Bluebird>): Bluebird; + + /** + * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + any(): Bluebird; /** + * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - some(count: number): Bluebird>; + some(this: Bluebird>, count: number): Bluebird; + + /** + * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + some(count: number): Bluebird; /** * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - race(): Bluebird>; + race(this: Bluebird>): Bluebird; + + /** + * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + race(): Bluebird; /** * Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - map(mapper: IterateFunction, U>, options?: Bluebird.ConcurrencyOption): Bluebird ? U[] : never>; + map(this: Bluebird>, mapper: IterateFunction, options?: Bluebird.ConcurrencyOption): Bluebird; /** * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - reduce(reducer: (memo: U, item: IterableItem, index: number, arrayLength: number) => Resolvable, initialValue?: U): Bluebird ? U : never>; + reduce(this: Bluebird>, reducer: (memo: U, item: Q, index: number, arrayLength: number) => Resolvable, initialValue?: U): Bluebird; /** * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - filter(filterer: IterateFunction, boolean>, options?: Bluebird.ConcurrencyOption): Bluebird>; + filter(this: Bluebird>, filterer: IterateFunction, options?: Bluebird.ConcurrencyOption): Bluebird; /** * Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - each(iterator: IterateFunction, any>): Bluebird>; + each(this: Bluebird>, iterator: IterateFunction): Bluebird; /** * Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - mapSeries(iterator: IterateFunction, U>): Bluebird ? U[] : never>; + mapSeries(this: Bluebird>, iterator: IterateFunction): Bluebird; /** * Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 46c146272e..13ae21f5a4 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -143,6 +143,8 @@ pdfQueue .on('drained', () => undefined) .on('removed', (job: Queue.Job) => undefined); +pdfQueue.setMaxListeners(42); + // test different process methods const profileQueue = new Queue('profile'); diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index aab2385ea4..cd2d1a9047 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -17,6 +17,7 @@ // TypeScript Version: 2.8 import * as Redis from "ioredis"; +import { EventEmitter } from "events"; /** * This is the Queue constructor. @@ -384,7 +385,7 @@ declare namespace Bull { next: number; } - interface Queue { + interface Queue extends EventEmitter { /** * The name of the queue */ diff --git a/types/camljs/camljs-tests.ts b/types/camljs/camljs-tests.ts index 12afd10fbb..034949175c 100644 --- a/types/camljs/camljs-tests.ts +++ b/types/camljs/camljs-tests.ts @@ -1,4 +1,4 @@ - +import CamlBuilder from 'camljs' var caml = new CamlBuilder().Where() .Any( @@ -53,3 +53,37 @@ caml = CamlBuilder.Expression() .ToString(); caml = new CamlBuilder().Where().DateTimeField("Created").GreaterThan(new Date(Date.UTC(2013,0,1))).ToString(); + +// Aggregations and extended syntax of GroupBy +var query = new CamlBuilder() + .View(["Category", { count: "ID" }, { sum: "Amount" }]) + .Query() + .GroupBy("Category", true, 100) + .ToString(); + +// ContentTypeId field +var query = new CamlBuilder() + .Where() + .TextField("Title").EqualTo("Document") + .And() + .ContentTypeIdField().BeginsWith("0x101") + .ToString(); + +// joins +var query = new CamlBuilder() + .View(["Title", "Country", "Population"]) + .LeftJoin("Country", "Country").Select("y4r6", "Population") + .Query() + .Where() + .NumberField("Population").LessThan(10) + .ToString(); + +// RowLimit & Scope +var camlBuilder1 = new CamlBuilder() + .View(["ID", "Created"]) + .RowLimit(20, true) + .Scope(CamlBuilder.ViewScope.RecursiveAll) + .Query() + .Where() + .TextField("Title").BeginsWith("A") + .ToString(); diff --git a/types/camljs/index.d.ts b/types/camljs/index.d.ts index 73bbe03767..b8f4021ded 100644 --- a/types/camljs/index.d.ts +++ b/types/camljs/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for camljs -// Project: http://camljs.codeplex.com -// Definitions by: Andrey Markeev +// Project: https://github.com/andrei-markeev/camljs +// Definitions by: Andrey Markeev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.7 declare class CamlBuilder { constructor(); @@ -10,25 +10,43 @@ declare class CamlBuilder { Where(): CamlBuilder.IFieldExpression; /** Generate tag for SP.CamlQuery @param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned. - Specifying view fields is a good practice, as it decreases traffic between server and client. */ - View(viewFields?: string[]): CamlBuilder.IView; + Specifying view fields is a good practice, as it decreases traffic between server and client. + Additionally you can specify aggregated fields, e.g. { count: "" }, { sum: "" }, etc.. */ + View(viewFields?: CamlBuilder.ViewField[]): CamlBuilder.IView; /** Generate tag for SPServices */ ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString; /** Use for: 1. SPServices CAMLQuery attribute 2. Creating partial expressions 3. In conjunction with Any & All clauses - */ + */ static Expression(): CamlBuilder.IFieldExpression; static FromXml(xml: string): CamlBuilder.IRawQuery; } -declare namespace CamlBuilder { - interface IView extends IJoinable, IFinalizable { +declare module CamlBuilder { + type Aggregation = { + count: string; + } | { + sum: string; + } | { + avg: string; + } | { + max: string; + } | { + min: string; + } | { + stdev: string; + } | { + var: string; + }; + type ViewField = string | Aggregation; + interface IView extends IFinalizable { + /** Define query */ Query(): IQuery; + /** Define maximum amount of returned records */ RowLimit(limit: number, paged?: boolean): IView; + /** Define view scope */ Scope(scope: ViewScope): IView; - } - interface IJoinable { /** Join the list you're querying with another list. Joins are only allowed through a lookup field relation. @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. @@ -40,22 +58,39 @@ declare namespace CamlBuilder { @alias alias for the joined list */ LeftJoin(lookupFieldInternalName: string, alias: string): IJoin; } + interface IJoinable { + /** Join the list you're querying with another list. + Joins are only allowed through a lookup field relation. + @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. + @param alias Alias for the joined list + @param fromList (optional) List where the lookup column resides - use it only for nested joins */ + InnerJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin; + /** Join the list you're querying with another list. + Joins are only allowed through a lookup field relation. + @param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in. + @param alias Alias for the joined list + @param fromList (optional) List where the lookup column resides - use it only for nested joins */ + LeftJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin; + } interface IJoin extends IJoinable { /** Select projected field for using in the main Query body @param remoteFieldAlias By this alias, the field can be used in the main Query body. */ Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView; } - interface IProjectableView extends IView { + interface IProjectableView extends IJoinable { + /** Define query */ + Query(): IQuery; + /** Define maximum amount of returned records */ + RowLimit(limit: number, paged?: boolean): IView; + /** Define view scope */ + Scope(scope: ViewScope): IView; /** Select projected field for using in the main Query body @param remoteFieldAlias By this alias, the field can be used in the main Query body. */ Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView; } enum ViewScope { - /** */ Recursive = 0, - /** */ RecursiveAll = 1, - /** */ FilesOnly = 2, } interface IQuery extends IGroupable { @@ -85,8 +120,9 @@ declare namespace CamlBuilder { } interface IGroupable extends ISortable { /** Adds GroupBy clause to the query. - @param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */ - GroupBy(fieldInternalName: any): IGroupedQuery; + @param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. + @param groupLimit Return only first N groups */ + GroupBy(fieldInternalName: any, collapse?: boolean, groupLimit?: number): IGroupedQuery; } interface IExpression extends IGroupable { /** Adds And clause to the query. */ @@ -113,6 +149,12 @@ declare namespace CamlBuilder { Any(conditions: IExpression[]): IExpression; /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text */ TextField(internalName: string): ITextFieldExpression; + /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ContentTypeId */ + ContentTypeIdField(internalName?: string): ITextFieldExpression; + /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Choice */ + ChoiceField(internalName: string): ITextFieldExpression; + /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Computed */ + ComputedField(internalName: string): ITextFieldExpression; /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean */ BooleanField(internalName: string): IBooleanFieldExpression; /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is URL */ @@ -360,7 +402,7 @@ declare namespace CamlBuilder { Year = 4, } class Internal { - static createView(viewFields?: string[]): IView; + static createView(viewFields?: ViewField[]): IView; static createViewFields(viewFields: string[]): IFinalizableToString; static createWhere(): IFieldExpression; static createExpression(): IFieldExpression; @@ -401,3 +443,4 @@ declare namespace CamlBuilder { }; } } +export = CamlBuilder; diff --git a/types/camljs/tsconfig.json b/types/camljs/tsconfig.json index 5fbe5605e9..ed88508fc3 100644 --- a/types/camljs/tsconfig.json +++ b/types/camljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/canvas-confetti/canvas-confetti-tests.ts b/types/canvas-confetti/canvas-confetti-tests.ts index d29e57fbdb..2415b91b85 100644 --- a/types/canvas-confetti/canvas-confetti-tests.ts +++ b/types/canvas-confetti/canvas-confetti-tests.ts @@ -43,3 +43,12 @@ confetti({ y: 0.6 } }); + +const canvas = document.createElement('canvas'); +const myConfetti = confetti.create(canvas); + +myConfetti(); + +myConfetti({ + particleCount: 150 +}); diff --git a/types/canvas-confetti/index.d.ts b/types/canvas-confetti/index.d.ts index 3dddc6d750..f9dd65ea12 100644 --- a/types/canvas-confetti/index.d.ts +++ b/types/canvas-confetti/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for canvas-confetti 0.0 +// Type definitions for canvas-confetti 0.1 // Project: https://github.com/catdad/canvas-confetti#readme // Definitions by: Martin Tracey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -81,6 +81,14 @@ declare namespace confetti { */ y?: number; } + interface GlobalOptions { + resize: boolean; + } + + function create( + canvas: HTMLCanvasElement, + options?: GlobalOptions + ): (options?: Options) => Promise | null; } export = confetti; diff --git a/types/canvas-confetti/tsconfig.json b/types/canvas-confetti/tsconfig.json index 33c159b3e3..e83fb2ef8b 100644 --- a/types/canvas-confetti/tsconfig.json +++ b/types/canvas-confetti/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index 18527ed8c5..21b6f9d8d1 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -87,7 +87,8 @@ export namespace policies { interface DecisionInfo { decision: number; - consistency: number; + consistency?: number; + useCurrentHost?: boolean; } interface RequestInfo { @@ -115,8 +116,8 @@ export namespace policies { onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo; onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo; onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo; - rethrowResult(): { decision: retryDecision }; - retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean }; + rethrowResult(): DecisionInfo; + retryResult(consistency?: types.consistencies, useCurrentHost?: boolean): DecisionInfo; } } diff --git a/types/catbox/catbox-tests.ts b/types/catbox/catbox-tests.ts index e86d2a94af..af85cde068 100644 --- a/types/catbox/catbox-tests.ts +++ b/types/catbox/catbox-tests.ts @@ -18,6 +18,9 @@ const Memory: EnginePrototypeOrObject = { const client = new Client(Memory, { partition: 'cache' }); +client.start().then(() => {}); +client.stop().then(() => {}); + const cache = new Policy({ expiresIn: 5000, }, client, 'cache'); diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index bd41889e07..e90768be20 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -23,7 +23,7 @@ export class Client implements ClientApi { /** start() - creates a connection to the cache server. Must be called before any other method is available. */ start(): Promise; /** stop() - terminates the connection to the cache server. */ - stop(): void; + stop(): Promise; /** * get(key, callback) - retrieve an item from the cache engine if found where: * * key - a cache key object (see [ICacheKey]). diff --git a/types/chai-enzyme/index.d.ts b/types/chai-enzyme/index.d.ts index 783b7fce2f..b238b194c5 100644 --- a/types/chai-enzyme/index.d.ts +++ b/types/chai-enzyme/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/producthunt/chai-enzyme // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 /// diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 058bfd78ea..211b6a59d8 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -5246,7 +5246,7 @@ declare namespace chrome.runtime { export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { } - export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { } + export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void> { } export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { } diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index 1846fd4840..b6e66ff4db 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1441,6 +1441,12 @@ export interface MediaInformation { * The media tracks. */ tracks?: Track[]; + + /** + * VMAP ad request configuration. Used if breaks and breakClips are not + * provided. + */ + vmapAdsRequest?: VastAdsRequest; } /** diff --git a/types/co/co-tests.ts b/types/co/co-tests.ts new file mode 100644 index 0000000000..159a2e90fb --- /dev/null +++ b/types/co/co-tests.ts @@ -0,0 +1,30 @@ +import co = require('co'); + +function* gen(num: number, str: string, arr: number[], obj: object, fun: () => void) { + return num; +} + +co(gen, 42, 'forty-two', [42], { value: 42 }, () => {}) + .then((num: number) => {}, (err: Error) => {}) + .catch((err: Error) => {}); + +co.default(gen, 42, 'forty-two', [42], { value: 42 }, () => {}) + .then((num: number) => {}, (err: Error) => {}) + .catch((err: Error) => {}); + +co.co(gen, 42, 'forty-two', [42], { value: 42 }, () => {}) + .then((num: number) => {}, (err: Error) => {}) + .catch((err: Error) => {}); + +co.wrap(gen)(42, 'forty-two', [42], { value: 42 }, () => {}) + .then((num: number) => {}, (err: Error) => {}) + .catch((err: Error) => {}); + +// $ExpectError +co(gen, 42, 'forty-two', [42], { value: 42 }, () => {}).then((str: string) => {}); + +// $ExpectError +co.wrap(gen)(); + +// $ExpectError +co.wrap(gen)('forty-two'); diff --git a/types/co/index.d.ts b/types/co/index.d.ts new file mode 100644 index 0000000000..958c222a14 --- /dev/null +++ b/types/co/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for co 4.6 +// Project: https://github.com/tj/co#readme +// Definitions by: Doniyor Aliyev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 + +type ExtractType = T extends IterableIterator ? R : never; + +interface Co { + Generator>(fn: F, ...args: Parameters): Promise>>; + default: Co; + co: Co; + wrap: Generator>(fn: F) => (...args: Parameters) => Promise>>; +} + +declare const co: Co; + +export = co; diff --git a/types/terser/tsconfig.json b/types/co/tsconfig.json similarity index 94% rename from types/terser/tsconfig.json rename to types/co/tsconfig.json index 937a5d1350..bc5a88eb32 100644 --- a/types/terser/tsconfig.json +++ b/types/co/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "terser-tests.ts" + "co-tests.ts" ] } diff --git a/types/i18next-browser-languagedetector/tslint.json b/types/co/tslint.json similarity index 100% rename from types/i18next-browser-languagedetector/tslint.json rename to types/co/tslint.json diff --git a/types/cometd/AckExtension/index.d.ts b/types/cometd/AckExtension/index.d.ts new file mode 100644 index 0000000000..49a007a8f8 --- /dev/null +++ b/types/cometd/AckExtension/index.d.ts @@ -0,0 +1,12 @@ +import * as m from '..'; + +declare class AckExtension implements m.Extension { + constructor(); + + incoming: m.Listener; + outgoing: m.Listener; + registered: (name: string, cometd: m.CometD) => void; + unregistered: () => void; +} + +export default AckExtension; diff --git a/types/cometd/TimeSyncExtension/index.d.ts b/types/cometd/TimeSyncExtension/index.d.ts new file mode 100644 index 0000000000..74ebe4ef3e --- /dev/null +++ b/types/cometd/TimeSyncExtension/index.d.ts @@ -0,0 +1,40 @@ +import * as m from '..'; + +declare class TimeSyncExtension implements m.Extension { + constructor(); + + incoming: m.Listener; + outgoing: m.Listener; + registered: (name: string, cometd: m.CometD) => void; + unregistered: () => void; + + /** + * Get the estimated offset in ms from the clients clock to the + * servers clock. The server time is the client time plus the offset. + */ + getTimeOffset: () => number; + + /** + * Get an array of multiple offset samples used to calculate + * the offset. + */ + getTimeOffsetSamples: () => [number]; + + /** + * Get the estimated network lag in ms from the client to the server. + */ + getNetworkLag: () => number; + + /** + * Get the estimated server time in ms since the epoch. + */ + getServerTime: () => number; + + /** + * + * Get the estimated server time as a Date object + */ + getServerDate: () => Date; +} + +export default TimeSyncExtension; diff --git a/types/cometd/cometd-tests.ts b/types/cometd/cometd-tests.ts index ef56879d6f..e82cf16323 100644 --- a/types/cometd/cometd-tests.ts +++ b/types/cometd/cometd-tests.ts @@ -1,4 +1,6 @@ import { CometD, Listener, Message, SubscriptionHandle } from "cometd"; +import TimeSyncExtension from 'cometd/TimeSyncExtension'; +import AckExtension from 'cometd/AckExtension'; const cometd = new CometD(); @@ -11,7 +13,23 @@ cometd.configure({ url: "http://localhost:8080/cometd" }); -cometd.registerExtension("ack", { incoming: () => {}, outgoing: () => {} }); +cometd.registerExtension("ack", new AckExtension()); + +const timesync = new TimeSyncExtension(); +cometd.registerExtension("timesync", timesync); + +const timeSyncSubscription = cometd.addListener("/foo/bar", () => { + if (timesync.getNetworkLag() > 1000) { + cometd.publish("/mychannel", { timesyncStats: { + lag: timesync.getNetworkLag(), + serverTime: timesync.getServerTime(), + serverDate: timesync.getServerDate(), + timeOffset: timesync.getTimeOffset(), + timeOffsetSamples: timesync.getTimeOffsetSamples() + } + }); + } +}); cometd.unregisterTransport("websocket"); diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index 9dea5d9978..d7103f15cd 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for CometD 4.0 // Project: https://cometd.org -// Definitions by: Derek Cicerone , Daniel Perez Alvarez , Alex Henry +// Definitions by: Derek Cicerone +// Daniel Perez Alvarez +// Alex Henry +// Harald Gliebe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -88,6 +91,8 @@ export interface SubscriptionHandle { export interface Extension { incoming?: Listener; outgoing?: Listener; + registered?: (name: string, cometd: CometD) => void; + unregistered?: () => void; } export class CometD { diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 6533a1a225..da1896488a 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -18,6 +18,8 @@ }, "files": [ "index.d.ts", - "cometd-tests.ts" + "cometd-tests.ts", + "AckExtension/index.d.ts", + "TimeSyncExtension/index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/commercetools__enzyme-extensions/index.d.ts b/types/commercetools__enzyme-extensions/index.d.ts index 7c009f8e95..cf7362f0e9 100644 --- a/types/commercetools__enzyme-extensions/index.d.ts +++ b/types/commercetools__enzyme-extensions/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/commercetools/enzyme-extensions // Definitions by: Christian Rackerseder // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import * as enzyme from 'enzyme'; diff --git a/types/connect-datadog/index.d.ts b/types/connect-datadog/index.d.ts index c3aad8aac7..df18c0c208 100644 --- a/types/connect-datadog/index.d.ts +++ b/types/connect-datadog/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for connect-datadog 0.0 -// Project: https://github.com/AppPress/node-connect-datadog +// Project: https://github.com/datadog/node-connect-datadog // Definitions by: Moshe Good // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/cordova-sqlite-storage/index.d.ts b/types/cordova-sqlite-storage/index.d.ts index 6ba48b08d2..02d63be0c3 100644 --- a/types/cordova-sqlite-storage/index.d.ts +++ b/types/cordova-sqlite-storage/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for cordova-sqlite-storage 1.5 -// Project: https://github.com/litehelpers/Cordova-sqlite-storage +// Project: https://github.com/xpbrew/cordova-sqlite-storage // Definitions by: rafw87 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/cssesc/cssesc-tests.ts b/types/cssesc/cssesc-tests.ts new file mode 100644 index 0000000000..61475ed447 --- /dev/null +++ b/types/cssesc/cssesc-tests.ts @@ -0,0 +1,35 @@ +import cssesc = require("cssesc"); + +// $ExpectType string +cssesc('Ich ♥ Bücher'); + +// $ExpectType string +cssesc('123a2b', { + isIdentifier: true +}); + +// $ExpectType string +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + quotes: 'single' +}); + +// $ExpectType string +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + quotes: 'double' +}); + +// $ExpectType string +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + quotes: 'single', + wrap: true +}); + +// $ExpectType string +cssesc('lolwat"foo\'bar', { + escapeEverything: true +}); + +cssesc.options.escapeEverything = false; + +// $ExpectType string +cssesc.version; diff --git a/types/cssesc/index.d.ts b/types/cssesc/index.d.ts new file mode 100644 index 0000000000..25a9e1f455 --- /dev/null +++ b/types/cssesc/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for cssesc 3.0 +// Project: https://mths.be/cssesc +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = cssesc; + +declare function cssesc(string: string, options?: Readonly>): string; + +declare namespace cssesc { + interface Options { + escapeEverything: boolean; + isIdentifier: boolean; + quotes: string; + wrap: boolean; + } + + const options: Options; + + const version: string; +} diff --git a/types/internal-ip/tsconfig.json b/types/cssesc/tsconfig.json similarity index 93% rename from types/internal-ip/tsconfig.json rename to types/cssesc/tsconfig.json index 99d54932e0..16acf5e56a 100644 --- a/types/internal-ip/tsconfig.json +++ b/types/cssesc/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "internal-ip-tests.ts" + "cssesc-tests.ts" ] } diff --git a/types/internal-ip/tslint.json b/types/cssesc/tslint.json similarity index 100% rename from types/internal-ip/tslint.json rename to types/cssesc/tslint.json diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index df6870c70a..b4ca7de92f 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Cytoscape.js 3.2 +// Type definitions for Cytoscape.js 3.3 // Project: http://js.cytoscape.org/ // Definitions by: Fabian Schmidt and Fred Eisele // Shenghan Gao @@ -464,6 +464,27 @@ declare namespace cytoscape { */ endBatch(): void; + /** + * Attaches the instance to the specified container for visualisation. + * http://js.cytoscape.org/#cy.mount + * + * If the core instance is headless prior to calling cy.mount(), then + * the instance will no longer be headless and the visualisation will + * be shown in the specified container. If the core instance is + * non-headless prior to calling cy.mount(), then the visualisation + * is swapped from the prior container to the specified container. + */ + mount(element: Element): void; + + /** + * Remove the instance from its current container. + * http://js.cytoscape.org/#cy.unmount + * + * This function sets the instance to be headless after unmounting from + * the current container. + */ + unmount(): void; + /** * A convenience function to explicitly destroy the Core. * http://js.cytoscape.org/#cy.destroy diff --git a/types/d3-array/d3-array-tests.ts b/types/d3-array/d3-array-tests.ts index 11f208f869..b0d00d5d20 100644 --- a/types/d3-array/d3-array-tests.ts +++ b/types/d3-array/d3-array-tests.ts @@ -608,7 +608,8 @@ const testObject = { }; const p1: Array = d3Array.permute(testObject, ['name', 'val', 'when', 'more']); -const p2: Array = d3Array.permute(testObject, ['when', 'more']); +// $ExpectType: Array +const p2 = d3Array.permute(testObject, ['when', 'more']); // $ExpectError const p3 = d3Array.permute(testObject, ['when', 'unknown']); diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts deleted file mode 100644 index cee1b6e3ee..0000000000 --- a/types/dd-trace/dd-trace-tests.ts +++ /dev/null @@ -1,56 +0,0 @@ -import * as tracer from "dd-trace"; -import SpanContext = require("dd-trace/src/opentracing/span_context"); - -tracer.init({ - enabled: true, - service: "MyLovelyService", - hostname: "localhost", - port: 8126, - env: "dev", - logger: { - debug: msg => {}, - error: err => {}, - } -}); - -function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") { - tracer.use(plugin, { - service: "incoming-request", - headers: ["User-Agent"], - validateStatus: code => code !== 418, - }); -} - -tracer.use("graphql", { - depth: 1, - // Can’t use spread operator here due to https://github.com/Microsoft/TypeScript/issues/10727 - // tslint:disable-next-line:prefer-object-spread - variables: variables => Object.assign({}, variables, { password: "REDACTED" }), -}); - -tracer.use("http", { - splitByDomain: true, -}); - -tracer - .trace("web.request", { - service: "my_service", - childOf: new SpanContext({ traceId: 1337, spanId: 42 }), // childOf must be an instance of this type. See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 - tags: { - env: "dev", - }, - }) - .then(span => { - span.setTag("my_tag", "my_value"); - span.finish(); - }); - -const parentScope = tracer.scopeManager().active(); -const span = tracer.startSpan("memcached", { - childOf: parentScope && parentScope.span(), - tags: { - "service.name": "my-memcached", - "resource.name": "get", - "span.type": "memcached", - }, -}); diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts deleted file mode 100644 index a55b7f8de7..0000000000 --- a/types/dd-trace/index.d.ts +++ /dev/null @@ -1,275 +0,0 @@ -// Type definitions for dd-trace-js 0.7 -// Project: https://github.com/DataDog/dd-trace-js -// Definitions by: Colin Bradley -// Eloy Durán -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 - -// Prettified with: -// $ prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 --write --print-width 120 types/dd-trace/{,*}/*.ts* - -import { Tracer, Span, SpanContext } from "opentracing"; -import DatadogSpanContext = require("./src/opentracing/span_context"); - -declare var trace: TraceProxy; -export = trace; - -declare class TraceProxy extends Tracer { - /** - * Initializes the tracer. This should be called before importing other libraries. - */ - init(options?: TracerOptions): this; - - /** - * Enable and optionally configure a plugin. - * @param plugin The name of a built-in plugin. - * @param config Configuration options. - */ - use

(plugin: P, config: PluginConfiguration[P]): this; - - /** - * Initiate a trace and creates a new span. - * @param operationName The operation name to be used for this span. - * @param options Configuration options. These will take precedence over environment variables. - */ - trace(operationName: string, options: TraceOptions): Promise; - - /** - * Initiate a trace and creates a new span. - * @param operationName The operation name to be used for this span. - * @param options Configuration options. These will take precedence over environment variables. - */ - trace(operationName: string, options: TraceOptions, callback: (span: Span) => void): void; - - /** - * Get the span from the current context. - * @returns The current span or null if outside a trace context. - */ - currentSpan(): Span | null; - - /** - * Get the scope manager to manager context propagation for the tracer. - */ - scopeManager(): ScopeManager; -} - -interface TracerOptions { - /** - * Whether to enable the tracer. - * @default true - */ - enabled?: boolean; - - /** - * Enable debug logging in the tracer. - * @default false - */ - debug?: boolean; - - /** - * The service name to be used for this program. - */ - service?: string; - - /** - * The address of the trace agent that the tracer will submit to. - * @default 'localhost' - */ - hostname?: string; - - /** - * The port of the trace agent that the tracer will submit to. - * @default 8126 - */ - port?: number | string; - - /** - * Set an application’s environment e.g. prod, pre-prod, stage. - */ - env?: string; - - /** - * Percentage of spans to sample as a float between 0 and 1. - * @default 1 - */ - sampleRate?: number; - - /** - * Interval in milliseconds at which the tracer will submit traces to the agent. - * @default 2000 - */ - flushInterval?: number; - - /** - * Experimental features can be enabled all at once by using true or individually using key / value pairs. - * @default {} - */ - experimental?: ExperimentalOptions | boolean; - - /** - * Whether to load all built-in plugins. - * @default true - */ - plugins?: boolean; - - /** - * Custom logger to be used by the tracer (if debug = true), - * should support debug() and error() methods - * see https://datadog.github.io/dd-trace-js/#custom-logging__anchor - */ - logger?: { - debug: (message: string) => void; - error: (err: Error) => void; - }; - - /** - * Global tags that should be assigned to every span. - */ - tags?: { [key: string]: any }; -} - -interface ExperimentalOptions {} - -interface TraceOptions { - /** - * The service name to be used for this span. - * The service name from the tracer will be used if this is not provided. - */ - service?: string; - - /** - * The resource name to be used for this span. - * The operation name will be used if this is not provided. - */ - resource?: string; - - /** - * The span type to be used for this span. - */ - type?: string; - - /** - * The parent span or span context for the new span. Generally this is not needed as it will be - * fetched from the current context. - * If creating your own, this must be an instance of DatadogSpanContext from ./src/opentracing/span_context - * See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 - */ - childOf?: Span | SpanContext | DatadogSpanContext; - - /** - * Global tags that should be assigned to every span. - */ - tags?: { [key: string]: any } | string; -} - -declare class ScopeManager { - /** - * Get the current active scope or null if there is none. - * - * @todo The dd-trace source returns null, but opentracing's childOf span - * option is typed as taking undefined or a scope, so using undefined - * here instead. - */ - active(): Scope | undefined; - - /** - * Activate a new scope wrapping the provided span. - * - * @param span The span for which to activate the new scope. - * @param finishSpanOnClose Whether to automatically finish the span when the scope is closed. - */ - activate(span: Span, finishSpanOnClose?: boolean): Scope; -} - -declare class Scope { - /** - * Get the span wrapped by this scope. - */ - span(): Span; - - /** - * Close the scope, and finish the span if the scope was created with `finishSpanOnClose` set to true. - */ - close(): void; -} - -type Plugin = - | "amqp10" - | "amqplib" - | "bluebird" - | "elasticsearch" - | "express" - | "graphql" - | "hapi" - | "http" - | "ioredis" - | "koa" - | "memcached" - | "mongodb-core" - | "mysql" - | "mysql2" - | "pg" - | "q" - | "redis" - | "restify" - | "when"; - -interface BasePluginOptions { - /** - * The service name to be used for this plugin. - */ - service?: string; -} - -interface BaseWebFrameworkPluginOptions extends BasePluginOptions { - /** - * An array of headers to include in the span metadata. - */ - headers?: string[]; - - /** - * Callback function to determine if there was an error. It should take a - * status code as its only parameter and return `true` for success or `false` - * for errors. - */ - validateStatus?: (code: number) => boolean; -} - -interface ExpressPluginOptions extends BaseWebFrameworkPluginOptions {} - -interface HapiPluginOptions extends BaseWebFrameworkPluginOptions {} - -interface KoaPluginOptions extends BaseWebFrameworkPluginOptions {} - -interface RestifyPluginOptions extends BaseWebFrameworkPluginOptions {} - -interface GraphQLPluginOptions extends BasePluginOptions { - /** - * The maximum depth of fields/resolvers to instrument. Set to `0` to only - * instrument the operation or to -1 to instrument all fields/resolvers. - */ - depth?: number; - - /** - * A callback to enable recording of variables. By default, no variables are - * recorded. For example, using `variables => variables` would record all - * variables. - */ - variables?: (variables: T) => Partial; -} - -interface HTTPPluginOptions extends BasePluginOptions { - /** - * Use the remote endpoint host as the service name instead of the default. - */ - splitByDomain?: boolean; -} - -type PluginConfiguration = { [K in Plugin]: BasePluginOptions } & { - express: ExpressPluginOptions; - graphql: GraphQLPluginOptions; - hapi: HapiPluginOptions; - http: HTTPPluginOptions; - koa: KoaPluginOptions; - restify: RestifyPluginOptions; -}; diff --git a/types/dd-trace/src/opentracing/span_context.d.ts b/types/dd-trace/src/opentracing/span_context.d.ts deleted file mode 100644 index 7e2b06dd4d..0000000000 --- a/types/dd-trace/src/opentracing/span_context.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { SpanContext } from 'opentracing'; - -declare class DatadogSpanContext extends SpanContext { - /** - * Used to create references to parent spans. - * See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 - */ - constructor(props: SpanContextLike); -} - -interface SpanContextLike { - traceId: number; - - spanId: number; - - parentId?: number | null; - - sampled?: boolean; - - baggageItems?: { [key: string]: string }; - - trace?: { - started: number[], - finished: number[] - }; -} - -export = DatadogSpanContext; diff --git a/types/debug/index.d.ts b/types/debug/index.d.ts index 954ca3a35a..715e7c145e 100644 --- a/types/debug/index.d.ts +++ b/types/debug/index.d.ts @@ -38,7 +38,7 @@ declare namespace debug { (formatter: any, ...args: any[]): void; enabled: boolean; - log: (v: any) => string; + log: (...args: any[]) => any; namespace: string; extend: (namespace: string, delimiter?: string) => Debugger; } diff --git a/types/detect-browser/detect-browser-tests.ts b/types/detect-browser/detect-browser-tests.ts deleted file mode 100644 index 7453ed044a..0000000000 --- a/types/detect-browser/detect-browser-tests.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { BrowserName, BrowserInfo, detect } from 'detect-browser'; -const browser = detect(); - -if (browser) { - const name: string | undefined = browser.name; - const version: string | undefined = browser.version; - const os: string | undefined | null = browser.os; - const bot: true | undefined = browser.bot; -} - -const browserInfos: BrowserInfo[] = []; - -// Those that can happen when 'detect' hits on a browser - -browserInfos.push( - { - name: "chrome", - version: "1.2.3", - os: null - } -); - -browserInfos.push( - { - name: "edge", - version: "24.5.3", - os: "Sun OS" - } -); - -browserInfos.push( - { - name: "edge", - version: "13.0", - os: "Windows 10", - bot: true - } -); - -// Those that could be returned when it's a bot - -browserInfos.push( - { - name: "facebook", - version: "1.0.2", - os: "Linux", - bot: true - } -); - -browserInfos.push( - { - name: "crios", - version: "2.9.4", - os: undefined, - bot: true - } -); - -browserInfos.push( - { - bot: true - } -); diff --git a/types/detect-browser/index.d.ts b/types/detect-browser/index.d.ts deleted file mode 100644 index 943484b013..0000000000 --- a/types/detect-browser/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Type definitions for detect-browser 3.0 -// Project: https://github.com/DamonOehlman/detect-browser -// Definitions by: Rogier Schouten -// Brian Caruso -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export {}; - -export type BrowserName = - "aol" | - "android" | - "bb10" | - "chrome" | - "crios" | - "edge" | - "facebook" | - "firefox" | - "fxios" | - "ie" | - "instagram" | - "ios" | - "ios-webview" | - "kakaotalk" | - "node" | - "opera" | - "phantomjs" | - "safari" | - "samsung" | - "vivaldi" | - "yandexbrowser"; - -export interface BrowserInfo { - name?: string; - version?: string; - os?: string | null; - bot?: true; -} - -export function detect(): null | false | BrowserInfo; -export function detectOS(userAgentString: string): null | string; -export function parseUserAgent(userAgentString: string): null | BrowserInfo; -export function getNodeVersion(): false | BrowserInfo; diff --git a/types/detect-browser/tslint.json b/types/detect-browser/tslint.json deleted file mode 100644 index dc8ddaa586..0000000000 --- a/types/detect-browser/tslint.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "indent": [ - true, - "spaces", - 4 - ] - } -} diff --git a/types/devexpress-web/index.d.ts b/types/devexpress-web/index.d.ts index 5c2feff240..b165f1b44c 100644 --- a/types/devexpress-web/index.d.ts +++ b/types/devexpress-web/index.d.ts @@ -5,6 +5,7 @@ // TypeScript Version: 2.3 /// +/// /** * A client-side counterpart of the DashboardViewer extension. @@ -34356,7 +34357,7 @@ interface ASPxDesignerNavigateTab { * Provides access to a report opened in the current tab. * Value: A knockout observable object that specifies a report opened in the current tab. */ - report: any; + report: KnockoutObservable; /** * Provides access to an engine that manages undo and redo operations in the Web Report Designer. * Value: An object that specifies an undo/redo engine. @@ -34889,6 +34890,9 @@ interface ASPxClientMenuAction { * Value: A string that specifies the name of the CSS class. */ imageClassName: string; + /** + * Knockout template, where you can specify a required SVG icon and write logic to color it. + */ imageTemplateName: string; /** * Provides access to the action performed when a button is clicked. @@ -34897,9 +34901,8 @@ interface ASPxClientMenuAction { clickAction: Function; /** * Provides access to the value that specifies whether or not the command is disabled by default. - * Value: true, if the command is disabled by default; otherwise, false. */ - disabled: boolean; + disabled: KnockoutObservable; /** * Provides access to the value that specifies whether or not the command is visible in the user interface. * Value: true if the command is visible; otherwise false. @@ -38912,5 +38915,4 @@ declare var ASPxClientReportDocumentMap: ASPxClientReportDocumentMapStatic; declare var ASPxClientReportParametersPanel: ASPxClientReportParametersPanelStatic; declare var ASPxClientReportToolbar: ASPxClientReportToolbarStatic; declare var ASPxClientReportViewer: ASPxClientReportViewerStatic; -declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic; - +declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic; \ No newline at end of file diff --git a/types/discord-rpc/index.d.ts b/types/discord-rpc/index.d.ts index 2d63e363b7..dbb6beeb39 100644 --- a/types/discord-rpc/index.d.ts +++ b/types/discord-rpc/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for discord-rpc 3.0 // Project: https://github.com/discordjs/RPC#readme // Definitions by: Jason Bothell +// Jack Baron // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { EventEmitter } from 'events'; @@ -66,6 +67,10 @@ export class Client extends EventEmitter { subscribe(event: string, args: any, callback: (data: any) => void): Promise; destroy(): Promise; + + on(event: 'ready' | 'connected', listener: () => void): this; + once(event: 'ready' | 'connected', listener: () => void): this; + off(event: 'ready' | 'connected', listener: () => void): this; } export interface RPCClientOptions { diff --git a/types/drivelist/index.d.ts b/types/drivelist/index.d.ts index d2acd039df..808cdf10af 100644 --- a/types/drivelist/index.d.ts +++ b/types/drivelist/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for drivelist 6.4 -// Project: https://github.com/resin-io-modules/drivelist +// Project: https://github.com/balena-io-modules/drivelist // Definitions by: Xiao Deng // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 020b3d363a..778e160f66 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -8,8 +8,8 @@ /*! * filename: ej.web.all.d.ts -* version : 16.4.0.42 -* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. +* version : 16.4.0.52 +* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under diff --git a/types/ejs/tsconfig.json b/types/ejs/tsconfig.json index ea91455364..8724ff1613 100644 --- a/types/ejs/tsconfig.json +++ b/types/ejs/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "lru-cache": ["lru-cache/v4"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -20,4 +23,4 @@ "index.d.ts", "ejs-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/elliptic/index.d.ts b/types/elliptic/index.d.ts index 722568a6f6..7b1e885d6f 100644 --- a/types/elliptic/index.d.ts +++ b/types/elliptic/index.d.ts @@ -187,7 +187,7 @@ export class ec { export namespace ec { interface GenKeyPairOptions { - pers: any; + pers?: any; entropy: any; persEnc?: string; entropyEnc?: string; diff --git a/types/emojione/index.d.ts b/types/emojione/index.d.ts index 92399fdf9a..21d4726c2f 100644 --- a/types/emojione/index.d.ts +++ b/types/emojione/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for emojione 2.2 -// Project: https://github.com/Ranks/emojione, http://www.emojione.com +// Project: https://github.com/Ranks/emojione, https://www.emojione.com // Definitions by: Danilo Bargen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/enzyme-adapter-react-15.4/index.d.ts b/types/enzyme-adapter-react-15.4/index.d.ts index 2496fb1719..a6ea2334c2 100644 --- a/types/enzyme-adapter-react-15.4/index.d.ts +++ b/types/enzyme-adapter-react-15.4/index.d.ts @@ -2,7 +2,7 @@ // Project: http://airbnb.io/enzyme/ // Definitions by: Nabeelah Ali // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-adapter-react-15/index.d.ts b/types/enzyme-adapter-react-15/index.d.ts index 77312f3da0..891afc3c21 100644 --- a/types/enzyme-adapter-react-15/index.d.ts +++ b/types/enzyme-adapter-react-15/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/airbnb/enzyme, http://airbnb.io/enzyme // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-adapter-react-16/index.d.ts b/types/enzyme-adapter-react-16/index.d.ts index 257b292055..7208117e71 100644 --- a/types/enzyme-adapter-react-16/index.d.ts +++ b/types/enzyme-adapter-react-16/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/airbnb/enzyme, http://airbnb.io/enzyme // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-async-helpers/index.d.ts b/types/enzyme-async-helpers/index.d.ts index 595f29aa71..e5004f4c25 100644 --- a/types/enzyme-async-helpers/index.d.ts +++ b/types/enzyme-async-helpers/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/zth/enzyme-async-helpers // Definitions by: Kim Ehrenpohl // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import { ReactWrapper, EnzymeSelector } from 'enzyme'; diff --git a/types/enzyme-redux/index.d.ts b/types/enzyme-redux/index.d.ts index e231119b89..de3693fc6a 100644 --- a/types/enzyme-redux/index.d.ts +++ b/types/enzyme-redux/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Knegusen/enzyme-redux#readme // Definitions by: Dennis Axelsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import { ReactWrapper, ShallowWrapper } from 'enzyme'; import { ReactElement } from 'react'; diff --git a/types/enzyme-to-json/index.d.ts b/types/enzyme-to-json/index.d.ts index 1a8cafb23a..f7c4d75da3 100644 --- a/types/enzyme-to-json/index.d.ts +++ b/types/enzyme-to-json/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/adriantoine/enzyme-to-json#readme // Definitions by: Joscha Feth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 import { ReactWrapper, ShallowWrapper } from 'enzyme'; diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 87b4d032e8..14cfd6443c 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -10,7 +10,7 @@ import { ShallowRendererProps, ComponentClass as EnzymeComponentClass } from "enzyme"; -import { Component, ReactElement, HTMLAttributes, ComponentClass, StatelessComponent } from "react"; +import { Component, ReactElement, ReactNode, HTMLAttributes, ComponentClass, StatelessComponent } from "react"; // Help classes/interfaces interface MyComponentProps { @@ -35,6 +35,10 @@ interface MyComponentState { stateProperty: string; } +interface MyRenderPropProps { + children: (params: string) => ReactNode; +} + function toComponentType(Component: ComponentClass | StatelessComponent): ComponentClass | StatelessComponent { return Component; } @@ -59,6 +63,8 @@ class AnotherComponent extends Component { } } +class MyRenderPropComponent extends Component {} + const MyStatelessComponent = (props: StatelessProps) => ; const AnotherStatelessComponent = (props: AnotherStatelessProps) => ; @@ -477,6 +483,11 @@ function ShallowWrapperTest() { shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true }); shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true }); } + + function test_renderProp() { + let shallowWrapper = new ShallowWrapper(
} />); + shallowWrapper = shallowWrapper.renderProp('children')('test'); + } } // ReactWrapper diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 257beb21fc..71238871c7 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Enzyme 3.1 +// Type definitions for Enzyme 3.9 // Project: https://github.com/airbnb/enzyme // Definitions by: Marian Palkus // Cap3 @@ -8,8 +8,9 @@ // MartynasZilinskas // Torgeir Hovden // Martin Hochel +// Christian Rackerseder // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 /// import { ReactElement, Component, AllHTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react"; @@ -363,6 +364,8 @@ export interface CommonWrapper

> { length: number; } +export type Parameters = T extends (...args: infer A) => any ? A : never; + // tslint:disable-next-line no-empty-interface export interface ShallowWrapper

extends CommonWrapper { } export class ShallowWrapper

{ @@ -447,6 +450,11 @@ export class ShallowWrapper

{ * Returns a wrapper with the direct parent of the node in the current wrapper. */ parent(): ShallowWrapper; + + /** + * Returns a wrapper of the node rendered by the provided render prop. + */ + renderProp(prop: PropName): (...params: Parameters) => ShallowWrapper; } // tslint:disable-next-line no-empty-interface diff --git a/types/eth-sig-util/eth-sig-util-tests.ts b/types/eth-sig-util/eth-sig-util-tests.ts new file mode 100644 index 0000000000..33f5840d05 --- /dev/null +++ b/types/eth-sig-util/eth-sig-util-tests.ts @@ -0,0 +1,98 @@ +import * as util from 'eth-sig-util'; + +const hex32 = '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'; +const buffer32 = Buffer.from(hex32, 'hex'); + +util.concatSig(28, buffer32, buffer32); +util.normalize(hex32); +util.normalize(42); + +//////////////////////////////////////////////////////////////////////////////// +// Personal message signing utils + +const messageSig = util.personalSign(buffer32, { data: 'test data' }); +util.recoverPersonalSignature({ data: 'test data', sig: messageSig }); +util.extractPublicKey({ data: 'test data', sig: messageSig }); + +//////////////////////////////////////////////////////////////////////////////// +// EIP-712 legacy draft utils + +const legacyTypedData = [{ + type: 'uint32', + name: 'testValue', + value: 42, +}, { + type: 'string', + name: 'testName', + value: 'test value', +}]; +util.typedSignatureHash(legacyTypedData); +const typedSigLegacy = util.signTypedDataLegacy(buffer32, { data: legacyTypedData }); +util.recoverTypedSignatureLegacy({ data: legacyTypedData, sig: typedSigLegacy }); + +//////////////////////////////////////////////////////////////////////////////// +// Elliptic curve encryption utils + +util.getEncryptionPublicKey(hex32); +const encPubkey = util.getEncryptionPublicKey(buffer32); +const encMessage = util.encrypt(encPubkey, { data: 'test data' }, 'x25519-xsalsa20-poly1305'); +util.decrypt(encMessage, buffer32); +util.decrypt(encMessage, hex32); +const encData = util.encryptSafely(encPubkey, { data: legacyTypedData }, 'x25519-xsalsa20-poly1305'); +util.decryptSafely(encData, buffer32); +util.decryptSafely(encData, hex32); + +//////////////////////////////////////////////////////////////////////////////// +// EIP-712 current draft utils + +// Sample data from the official EIP-712 example: +// https://github.com/ethereum/EIPs/blob/master/assets/eip-712/Example.js +const typedData = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' } + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' } + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 1, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, +}; +const typedMessage = typedData.message; +const types = typedData.types; +const primaryType = typedData.primaryType; +util.TypedDataUtils.encodeData(primaryType, typedMessage, types); +util.TypedDataUtils.encodeType(primaryType, types); +util.TypedDataUtils.findTypeDependencies(primaryType, types); +util.TypedDataUtils.hashStruct(primaryType, typedMessage, types); +util.TypedDataUtils.hashType(primaryType, types); +util.TypedDataUtils.sanitizeData(typedData); +util.TypedDataUtils.sign(typedData); +const typedSig = util.signTypedData(buffer32, { data: typedData }); +util.recoverTypedSignature({ data: typedData, sig: typedSig }); diff --git a/types/eth-sig-util/index.d.ts b/types/eth-sig-util/index.d.ts new file mode 100644 index 0000000000..61369ddc86 --- /dev/null +++ b/types/eth-sig-util/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for eth-sig-util 2.1 +// Project: https://github.com/MetaMask/eth-sig-util#readme +// Definitions by: Artur Kozak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +/** + * @returns a 0x-prefixed 130-byte signature. + */ +export function concatSig(v: number, r: Buffer, s: Buffer): string; + +/** + * @param input a number or a hex string (either 0x-prefixed or not). + * @returns a 0x-prefixed hex string. + */ +export function normalize(input: string | number): string; + +//////////////////////////////////////////////////////////////////////////////// +// Personal message signing utils + +export interface MessageData { data: T; } + +export interface SignedMessageData extends MessageData { sig: string; } + +export function personalSign(privateKey: Buffer, message: MessageData): string; + +export function recoverPersonalSignature(message: SignedMessageData): string; + +export function extractPublicKey(message: SignedMessageData): string; + +//////////////////////////////////////////////////////////////////////////////// +// EIP-712 legacy draft utils + +export interface EIP712LegacyField { + type: string; + name: string; + value: any; +} + +export type EIP712LegacyData = ReadonlyArray; + +export function typedSignatureHash(data: EIP712LegacyData): string; + +export function signTypedDataLegacy( + privateKey: Buffer, + message: MessageData, +): string; + +export function recoverTypedSignatureLegacy( + message: SignedMessageData, +): string; + +//////////////////////////////////////////////////////////////////////////////// +// Elliptic curve encryption utils + +export type EncryptionType = 'x25519-xsalsa20-poly1305'; + +export interface EncryptedData { + version: EncryptionType; + nonce: string; + ephemPublicKey: string; + ciphertext: string; +} + +/** + * @param receiverPublicKey a 32-byte base64 string, e.g. from @see `getEncryptionPublicKey` + * @param data a utf-8 string to be encrypted + * @param version one of the supported encryption schemes, @see `EncryptionType` + */ +export function encrypt( + receiverPublicKey: string, + data: MessageData, + version: EncryptionType, +): EncryptedData; + +/** + * Same as @see `encrypt`, but encrypts a JSON object. + */ +export function encryptSafely( + receiverPublicKey: string, + data: MessageData, + version: EncryptionType, +): EncryptedData; + +/** + * @param encryptedData result of @see `encrypt`. + * @param receiverPrivateKey should be a 32-byte Buffer or *not* 0x-prefixed hex string. + */ +export function decrypt( + encryptedData: EncryptedData, + receiverPrivateKey: string | Buffer, +): string; + +/** + * @param encryptedData result of @see `encryptSafely`. + * @param receiverPrivateKey should be a 32-byte Buffer or *not* 0x-prefixed hex string. + */ +export function decryptSafely( + encryptedData: EncryptedData, + receiverPrivateKey: string | Buffer, +): any; + +/** + * @param privateKey should be a 32-byte Buffer or *not* 0x-prefixed hex string. + * @returns a 32-byte public key as a base64 string. + */ +export function getEncryptionPublicKey(privateKey: string | Buffer): string; + +//////////////////////////////////////////////////////////////////////////////// +// EIP-712 current draft utils + +export interface EIP712TypeProperty { + name: string; + type: string; +} + +/** + * Maps type name to an array describing its properties' types. + * Should include the `EIP712Domain` struct description. + */ +export interface EIP712Types { + [name: string]: ReadonlyArray; +} + +export interface EIP712Message { + [key: string]: any; +} + +/** + * The standard requires to use at least one of these fields. + * @see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator + */ +export interface EIP712Domain { + name?: string; + version?: string; + chainId?: string | number; + verifyingContract?: string; + salt?: string; +} + +export interface EIP712TypedData { + types: EIP712Types; + primaryType: string; + domain: EIP712Domain; + message: EIP712Message; +} + +export namespace TypedDataUtils { + function encodeData(primaryType: string, data: EIP712Message, types: EIP712Types): Buffer; + + function encodeType(primaryType: string, types: EIP712Types): string; + + function findTypeDependencies( + primaryType: string, types: EIP712Types, + ): string[]; + + function hashStruct(primaryType: string, data: EIP712Message, types: EIP712Types): Buffer; + + function hashType(primaryType: string, types: EIP712Types): Buffer; + + function sanitizeData(data: EIP712TypedData): EIP712TypedData; + + /** + * @returns hash of the typed data as defined by EIP712 (contrary to the function's name) + * @see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification + */ + function sign(data: EIP712TypedData): Buffer; +} + +/** + * A JSON Schema object equivalent to the EIP712Message type. + */ +export const TYPED_MESSAGE_SCHEMA: any; + +export function signTypedData( + privateKey: Buffer, + msgParams: MessageData, +): string; + +export function recoverTypedSignature( + msgParams: SignedMessageData, +): string; diff --git a/types/eth-sig-util/tsconfig.json b/types/eth-sig-util/tsconfig.json new file mode 100644 index 0000000000..18e346c208 --- /dev/null +++ b/types/eth-sig-util/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "eth-sig-util-tests.ts" + ] +} diff --git a/types/internal-ip/v2/tslint.json b/types/eth-sig-util/tslint.json similarity index 100% rename from types/internal-ip/v2/tslint.json rename to types/eth-sig-util/tslint.json diff --git a/types/ethereumjs-abi/ethereumjs-abi-tests.ts b/types/ethereumjs-abi/ethereumjs-abi-tests.ts index f48cdd323c..28626b6304 100644 --- a/types/ethereumjs-abi/ethereumjs-abi-tests.ts +++ b/types/ethereumjs-abi/ethereumjs-abi-tests.ts @@ -1,5 +1,17 @@ -import { methodID, soliditySHA256, soliditySHA3 } from 'ethereumjs-abi'; +import * as abi from 'ethereumjs-abi'; -methodID('foo', ['uint256', 'string']); -soliditySHA3(['uint256', 'string'], [0, 'Alice']); -soliditySHA256(['uint256', 'string'], [0, 'Alice']); +const types = ['uint256', 'string']; +const values = [0, 'Alice']; +const signature = 'foo(uint256,string):(uint256)'; +abi.eventID('foo', types); +abi.methodID('foo', types); +abi.soliditySHA3(types, values); +abi.soliditySHA256(types, values); +abi.solidityRIPEMD160(types, values); +const simpleEncoded = abi.simpleEncode(signature, ...values); +abi.simpleDecode(signature, simpleEncoded); +const rawEncoded = abi.rawEncode(types, values); +abi.rawDecode(types, rawEncoded); +abi.solidityPack(types, values); +const serpentSig = abi.toSerpent(['int256', 'bytes']); +abi.fromSerpent(serpentSig); diff --git a/types/ethereumjs-abi/index.d.ts b/types/ethereumjs-abi/index.d.ts index 98ea94a6fa..6380068984 100644 --- a/types/ethereumjs-abi/index.d.ts +++ b/types/ethereumjs-abi/index.d.ts @@ -1,12 +1,21 @@ // Type definitions for ethereumjs-abi 0.6 // Project: https://github.com/ethereumjs/ethereumjs-abi, https://github.com/axic/ethereumjs-abi // Definitions by: Leonid Logvinov +// Artur Kozak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// export function soliditySHA3(argTypes: string[], args: any[]): Buffer; export function soliditySHA256(argTypes: string[], args: any[]): Buffer; +export function solidityRIPEMD160(argTypes: string[], args: any[]): Buffer; +export function eventID(name: string, types: string[]): Buffer; export function methodID(name: string, types: string[]): Buffer; export function simpleEncode(signature: string, ...args: any[]): Buffer; -export function rawDecode(signature: string[], data: Buffer): any[]; +export function simpleDecode(signature: string, data: Buffer): any[]; +export function rawEncode(types: string[], values: any[]): Buffer; +export function rawDecode(types: string[], data: Buffer): any[]; +export function stringify(types: string[], values: any[]): string; +export function solidityPack(types: string[], values: any[]): Buffer; +export function fromSerpent(signature: string): string[]; +export function toSerpent(types: string[]): string; diff --git a/types/eureka-js-client/eureka-js-client-tests.ts b/types/eureka-js-client/eureka-js-client-tests.ts index f9382655cb..5e4329e50a 100644 --- a/types/eureka-js-client/eureka-js-client-tests.ts +++ b/types/eureka-js-client/eureka-js-client-tests.ts @@ -10,13 +10,13 @@ const client = new Eureka({ port: 8080, vipAddress: 'jq.test.something.com', dataCenterInfo: { - name: 'MyOwn', - }, + name: 'MyOwn' + } }, eureka: { // eureka server host / port host: '192.168.99.100', - port: 32768, + port: 32768 } }); @@ -34,13 +34,13 @@ const newerClient = new Eureka({ vipAddress: 'jq.test.something.com', dataCenterInfo: { '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo', - name: 'MyOwn', - }, + name: 'MyOwn' + } }, eureka: { // eureka server host / port host: '192.168.99.100', - port: 32768, + port: 32768 } }); @@ -49,6 +49,17 @@ const ymlInitClient = new Eureka({ filename: 'eureka-config' }); +// example using middleware to set-up HTTP authentication (https://www.npmjs.com/package/eureka-js-client#providing-custom-request-middleware) +const middlewareClient = new Eureka({ + requestMiddleware: (requestOpts, done) => { + requestOpts.auth = { + user: 'username', + password: 'somepassword' + }; + done(requestOpts); + } +}); + // Test callbacks newerClient.start((err: Error) => {}); newerClient.start(() => {}); diff --git a/types/eureka-js-client/index.d.ts b/types/eureka-js-client/index.d.ts index ff63b02340..f6a9ec8a85 100644 --- a/types/eureka-js-client/index.d.ts +++ b/types/eureka-js-client/index.d.ts @@ -3,10 +3,11 @@ // Definitions by: Ilko Hoffmann // Karl O. // Tom Barton +// Josh Sullivan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class Eureka { - constructor(config: EurekaClient.EurekaConfig | EurekaClient.EurekaYmlConfig) + constructor(config: EurekaClient.EurekaConfig | EurekaClient.EurekaYmlConfig | EurekaClient.EurekaMiddlewareConfig); start(cb?: (err: Error, ...rest: any[]) => void): void; stop(cb?: (err: Error, ...rest: any[]) => void): void; getInstancesByAppId(appId: string): EurekaClient.EurekaInstanceConfig[]; @@ -19,6 +20,7 @@ export namespace EurekaClient { type DataCenterName = 'Netflix' | 'Amazon' | 'MyOwn'; interface EurekaConfig { + requestMiddleware?: EurekaMiddlewareConfig; instance: EurekaInstanceConfig; eureka: EurekaClientConfig; } @@ -80,8 +82,11 @@ export namespace EurekaClient { cwd: string; filename?: string; } + interface EurekaMiddlewareConfig { + requestMiddleware: (requestOpts: any, done: (opts: any) => void) => void; + } interface LegacyPortWrapper { - '$': number; + $: number; '@enabled': boolean; } interface PortWrapper { diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 10045e57e6..f2ce8d8197 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -412,6 +412,7 @@ async () => { { resize: { width: 300 } }, { resize: { height: 300 } }, { resize: { height: 300, width: 300 } }, + { crop: { originX: 0, originY: 0, height: 300, width: 300 } } ], { compress: 0.75 }); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8b488f9b59..7e75c1b7d6 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1952,14 +1952,16 @@ export namespace ImageManipulator { } interface Flip { - flip?: { vertical?: boolean; horizontal?: boolean }; + flip: { vertical?: boolean; horizontal?: boolean }; } interface Crop { - originX: number; - originY: number; - width: number; - height: number; + crop: { + originX: number; + originY: number; + width: number; + height: number; + }; } interface ImageResult { diff --git a/types/express-urlrewrite/express-urlrewrite-tests.ts b/types/express-urlrewrite/express-urlrewrite-tests.ts new file mode 100644 index 0000000000..e1c4c780be --- /dev/null +++ b/types/express-urlrewrite/express-urlrewrite-tests.ts @@ -0,0 +1,22 @@ +import * as express from "express"; + +import rewrite = require("express-urlrewrite"); + +declare const app: express.Application; + +app.use(rewrite(/^\/i(\w+)/, "/items/$1")); + +app.use(rewrite("/:src..:dst", "/commits/$1/to/$2")); +app.use(rewrite("/:src..:dst", "/commits/:src/to/:dst")); + +app.use(rewrite("/js/*", "/public/assets/js/$1")); + +app.use(rewrite("/file\\?param=:param", "/file/:param")); + +app.use(rewrite("/path", "/anotherpath?param=some")); + +app.get("/route/:var", rewrite("/rewritten/:var")); + +declare const someMw: express.Handler; + +app.get("/rewritten/:var", someMw); diff --git a/types/express-urlrewrite/index.d.ts b/types/express-urlrewrite/index.d.ts new file mode 100644 index 0000000000..12e74c6ed5 --- /dev/null +++ b/types/express-urlrewrite/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for express-urlrewrite 1.2 +// Project: https://github.com/kapouer/express-urlrewrite +// Definitions by: Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as express from "express"; + +declare function rewrite(s: string): express.Handler; +declare function rewrite(s: string | RegExp, t: string): express.Handler; + +export = rewrite; diff --git a/types/express-urlrewrite/tsconfig.json b/types/express-urlrewrite/tsconfig.json new file mode 100644 index 0000000000..0e5659e0eb --- /dev/null +++ b/types/express-urlrewrite/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-urlrewrite-tests.ts" + ] +} diff --git a/types/p-map/tslint.json b/types/express-urlrewrite/tslint.json similarity index 100% rename from types/p-map/tslint.json rename to types/express-urlrewrite/tslint.json diff --git a/types/favicons/index.d.ts b/types/favicons/index.d.ts index 782ad0cb7c..730841dff9 100644 --- a/types/favicons/index.d.ts +++ b/types/favicons/index.d.ts @@ -9,7 +9,7 @@ import { Duplex } from "stream"; declare namespace favicons { - interface Configuration { + interface Configuration { /** Path for overriding default icons path @default "/" */ path: string; /** Your application's name @default null */ @@ -38,6 +38,8 @@ declare namespace favicons { version: string; /** Print logs to console? @default false */ logging: boolean; + /** Use nearest neighbor resampling to preserve hard edges on pixel art @default false */ + pixel_art: boolean; /** * Platform Options: * - offset - offset in percentage @@ -66,18 +68,18 @@ declare namespace favicons { }>; } - interface FavIconResponse { + interface FavIconResponse { images: Array<{ name: string; contents: Buffer }>; files: Array<{ name: string; contents: Buffer }>; html: string[]; } - type Callback = (error: Error | null, response: FavIconResponse) => void; + type Callback = (error: Error | null, response: FavIconResponse) => void; /** You can programmatically access Favicons configuration (icon filenames, HTML, manifest files, etc) with this export */ - const config: Configuration; + const config: Configuration; - function stream(configuration?: Configuration): Duplex; + function stream(configuration?: Configuration): Duplex; } /** * Generate favicons diff --git a/types/firefox-webext-browser/index.d.ts b/types/firefox-webext-browser/index.d.ts index 1dfe1eb809..c0a8896e56 100644 --- a/types/firefox-webext-browser/index.d.ts +++ b/types/firefox-webext-browser/index.d.ts @@ -3188,7 +3188,7 @@ declare namespace browser.storage { * @param changes Object mapping each key that changed to its corresponding `storage.StorageChange` for that item. * @param areaName The name of the storage area (`"sync"`, `"local"` or `"managed"`) the changes are for. */ - const onChanged: WebExtEvent<(changes: StorageChange, areaName: string) => void>; + const onChanged: WebExtEvent<(changes: {[key: string]: StorageChange}, areaName: string) => void>; } /** diff --git a/types/giraffe/index.d.ts b/types/giraffe/index.d.ts index abce777c20..2f0223321c 100644 --- a/types/giraffe/index.d.ts +++ b/types/giraffe/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Giraffe // Project: https://github.com/barc/backbone.giraffe // Definitions by: Matt McCray +// Julian Gonggrijp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -145,18 +146,12 @@ declare namespace Giraffe { namespace Contrib { - class Controller implements GiraffeObject, Backbone.Events { - on(eventName: string, callback?: (...args: any[]) => void, context?: any); - on(eventMap: Backbone.EventsHash); + class Controller extends Backbone.EventsMixin implements GiraffeObject, Backbone.Events { + /** + * Faulty overgeneralization of Backbone.Events.on, for historical + * reasons. + */ on(eventName: any, callback?: any, context?: any) - off(eventName?: string, callback?: (...args: any[]) => void, context?: any) - trigger(eventName: string, ...args: any[]) - bind(eventName: string, callback: (...args: any[]) => void, context?: any) - unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any) - once(events: string, callback: (...args: any[]) => void, context?: any): any; - listenTo(object: any, events: string, callback: (...args: any[]) => void): any; - listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; - stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; app: App; } diff --git a/types/got/index.d.ts b/types/got/index.d.ts index 0c847d6489..a9f289b831 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -36,6 +36,7 @@ declare class HTTPError extends StdError { statusCode: number; statusMessage: string; headers: http.IncomingHttpHeaders; + body: Buffer | string | object; } declare class MaxRedirectsError extends StdError { diff --git a/types/gulp-gh-pages/gulp-gh-pages-tests.ts b/types/gulp-gh-pages/gulp-gh-pages-tests.ts index e541f18508..6fee2842e0 100644 --- a/types/gulp-gh-pages/gulp-gh-pages-tests.ts +++ b/types/gulp-gh-pages/gulp-gh-pages-tests.ts @@ -19,5 +19,8 @@ gulp.src("test.css") gulp.src("test.css") .pipe(ghPages({push: false})); +gulp.src("test.css") + .pipe(ghPages({ force: true })); + gulp.src("test.css") .pipe(ghPages({message: "master"})); diff --git a/types/gulp-gh-pages/index.d.ts b/types/gulp-gh-pages/index.d.ts index f01b9890f1..782f9e9b56 100644 --- a/types/gulp-gh-pages/index.d.ts +++ b/types/gulp-gh-pages/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for gulp-gh-pages // Project: https://github.com/rowoot/gulp-gh-pages // Definitions by: Asana +// Ntnyq // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -12,6 +13,7 @@ interface Options { branch?: string; cacheDir?: string; push?: boolean; + force?: boolean; message?: string; } diff --git a/types/dd-trace/package.json b/types/handlebars-helpers/package.json similarity index 60% rename from types/dd-trace/package.json rename to types/handlebars-helpers/package.json index 90deb3c97b..bd9f09c2c3 100644 --- a/types/dd-trace/package.json +++ b/types/handlebars-helpers/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "opentracing": ">=0.14.1" + "handlebars": ">=4.1.0" } } diff --git a/types/handlebars-helpers/tsconfig.json b/types/handlebars-helpers/tsconfig.json index e822854459..6b03737014 100644 --- a/types/handlebars-helpers/tsconfig.json +++ b/types/handlebars-helpers/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es2015" ], "noImplicitAny": true, "noImplicitThis": false, diff --git a/types/hexo/package.json b/types/hexo/package.json new file mode 100644 index 0000000000..f06689a6b9 --- /dev/null +++ b/types/hexo/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "moment": "^2.19.4" + } +} diff --git a/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts b/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts deleted file mode 100644 index eadfcea369..0000000000 --- a/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as i18next from "i18next"; -import * as LngDetector from "i18next-browser-languagedetector"; - -const options: LngDetector.DetectorOptions = { - // order and from where user language should be detected - order: ["querystring", "cookie", "localStorage", "navigator", "htmlTag"], - - // keys or params to lookup language from - lookupQuerystring: "lng", - lookupCookie: "i18next", - lookupLocalStorage: "i18nextLng", - - // cache user language on - caches: ["localStorage", "cookie"], - excludeCacheFor: ["cimode"], // languages to not persist (cookie, localStorage) - - // optional expire and domain for set cookie - cookieMinutes: 10, - cookieDomain: "myDomain", - - // optional htmlTag with lang attribute, the default is: - htmlTag: document.documentElement -}; - -i18next.use(LngDetector).init({ - detection: options -}); - -const customDetector: LngDetector.CustomDetector = { - name: "myDetectorsName", - - lookup(options: LngDetector.DetectorOptions) { - // options -> are passed in options - return "en"; - }, - - cacheUserLanguage(lng: string, options: LngDetector.DetectorOptions) { - // options -> are passed in options - // lng -> current language, will be called after init and on changeLanguage - - // store it - } -}; - -const customDetector2: LngDetector.CustomDetector = { - name: "myDetectorsName", - lookup(options: LngDetector.DetectorOptions) { - return undefined; - } -}; - -const lngDetector = new LngDetector(null, options); - -lngDetector.init(options); -lngDetector.addDetector(customDetector); - -i18next - .use(lngDetector) - .init({ - detection: options - }); diff --git a/types/i18next-browser-languagedetector/index.d.ts b/types/i18next-browser-languagedetector/index.d.ts deleted file mode 100644 index 88dbe79d8d..0000000000 --- a/types/i18next-browser-languagedetector/index.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Type definitions for i18next-browser-languagedetector 2.0 -// Project: http://i18next.com/, https://github.com/i18next/i18next-browser-languagedetector -// Definitions by: Cyril Schumacher , Giedrius Grabauskas -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -declare namespace i18nextBrowserLanguageDetector { - interface DetectorOptions { - /** - * order and from where user language should be detected - */ - order?: Array<"querystring" | "cookie" | "localStorage" | "navigator" | "htmlTag" | string>; - - /** - * keys or params to lookup language from - */ - lookupQuerystring?: string; - lookupCookie?: string; - lookupLocalStorage?: string; - - /** - * cache user language on - */ - caches?: string[]; - - /** - * languages to not persist (cookie, localStorage) - */ - excludeCacheFor?: string[]; - - /** - * optional expire and domain for set cookie - * @default 10 - */ - cookieMinutes?: number; - cookieDomain?: string; - - /** - * optional htmlTag with lang attribute - * @default document.documentElement - */ - htmlTag?: HTMLElement; - } - - interface CustomDetector { - name: string; - cacheUserLanguage?(lng: string, options: DetectorOptions): void; - lookup(options: DetectorOptions): string | undefined; - } -} - -declare class i18nextBrowserLanguageDetector { - constructor(services?: any, options?: i18nextBrowserLanguageDetector.DetectorOptions); - /** - * Adds detector. - */ - addDetector(detector: i18nextBrowserLanguageDetector.CustomDetector): i18nextBrowserLanguageDetector; - - /** - * Initializes detector. - */ - init(options?: i18nextBrowserLanguageDetector.DetectorOptions): void; -} - -export = i18nextBrowserLanguageDetector; diff --git a/types/i18next-browser-languagedetector/v0/i18next-browser-languagedetector-tests.ts b/types/i18next-browser-languagedetector/v0/i18next-browser-languagedetector-tests.ts deleted file mode 100644 index 0217ca74ce..0000000000 --- a/types/i18next-browser-languagedetector/v0/i18next-browser-languagedetector-tests.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as i18next from 'i18next'; -import LngDetector from 'i18next-browser-languagedetector'; - -const options = { - // order and from where user language should be detected - order: ['querystring', 'cookie', 'localStorage', 'navigator'], - - // keys or params to lookup language from - lookupQuerystring: 'lng', - lookupCookie: 'i18next', - lookupLocalStorage: 'i18nextLng', - - // cache user language on - caches: ['localStorage', 'cookie'], - - // optional expire and domain for set cookie - cookieMinutes: 10, - cookieDomain: 'myDomain' -}; -const myDetector = { - name: 'myDetectorsName', - - lookup(options: {}) { - // options -> are passed in options - return 'en'; - }, - - cacheUserLanguage(lng: string, options: {}) { - // options -> are passed in options - // lng -> current language, will be called after init and on changeLanguage - - // store it - } -}; - -i18next.use(LngDetector).init({ - detection: options -}); - -const lngDetector = new LngDetector(null, options); -lngDetector.init(options); -lngDetector.addDetector(myDetector); diff --git a/types/i18next-browser-languagedetector/v0/index.d.ts b/types/i18next-browser-languagedetector/v0/index.d.ts deleted file mode 100644 index 8b0f6b6317..0000000000 --- a/types/i18next-browser-languagedetector/v0/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Type definitions for i18next-browser-languagedetector 0.0 -// Project: http://i18next.com/ -// Definitions by: Cyril Schumacher , Giedrius Grabauskas -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import * as i18next from "i18next"; - -declare namespace I18next { - interface I18nextStatic extends i18nextBrowserLanguageDetector.I18nextStatic { } - interface I18nextOptions extends i18nextBrowserLanguageDetector.I18nextOptions { } -} - -declare namespace i18nextBrowserLanguageDetector { - /** Interface for Language detector options. */ - interface LanguageDetectorOptions { - caches?: string[] | boolean; - cookieDomain?: string; - cookieExpirationDate?: Date; - lookupCookie?: string; - lookupFromPathIndex?: number; - lookupQuerystring?: string; - lookupSession?: string; - order?: string[]; - } - - /** Interface for custom detector. */ - interface CustomDetector { - name: string; - - // todo: Checks parameters type. - cacheUserLanguage(lng: string, options: {}): void; - lookup(options: {}): string; - } - - /** i18next options. */ - interface I18nextOptions { - detection?: LanguageDetectorOptions; - } - - /** i18next interface. */ - interface I18nextStatic { - use(module: LngDetector): I18nextStatic; - } - - /** i18next language detection. */ - class LngDetector { - constructor(services?: any, options?: LanguageDetectorOptions); - - /** Adds detector. */ - addDetector(detector: CustomDetector): LngDetector; - - /** Initializes detector. */ - init(options?: LanguageDetectorOptions): void; - } -} - -export default i18nextBrowserLanguageDetector.LngDetector; diff --git a/types/i18next-browser-languagedetector/v0/tslint.json b/types/i18next-browser-languagedetector/v0/tslint.json deleted file mode 100644 index af6baaddc0..0000000000 --- a/types/i18next-browser-languagedetector/v0/tslint.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "interface-name": [ - false - ], - "no-empty-interface": [ - false - ] - } -} diff --git a/types/ignite-ui/index.d.ts b/types/ignite-ui/index.d.ts index 29d809964a..44620024ca 100644 --- a/types/ignite-ui/index.d.ts +++ b/types/ignite-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Ignite UI 18.1 +// Type definitions for Ignite UI 18.2 // Project: https://github.com/IgniteUI/ignite-ui // Definitions by: Ignite UI // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10897,6 +10897,12 @@ interface SeriesPointerUpEvent { interface SeriesPointerUpEventUIParam {} +interface CalloutStyleUpdatingEvent { + (event: Event, ui: CalloutStyleUpdatingEventUIParam): void; +} + +interface CalloutStyleUpdatingEventUIParam {} + interface IgCategoryChart { /** * Gets or sets the id of a template element to use for tooltips, or markup representing the tooltip template. @@ -11066,6 +11072,12 @@ interface IgCategoryChart { */ isVerticalZoomEnabled?: boolean; + /** + * Gets or sets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + */ + isSeriesHighlightingEnabled?: boolean; + /** * Gets or sets the rectangle representing the current scroll and zoom state of the chart. * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. @@ -11197,6 +11209,79 @@ interface IgCategoryChart { alignsGridLinesToPixels?: boolean; trendLinePeriod?: number; + /** + * Gets or sets the style of tooltip to be displayed. + * + * Valid values: + * "default" Display default tooltip for each series in the chart. + * "item" Display individual tooltips for all series in the chart. + * "category" Display combined tooltip for all series in the chart. + * "none" Display no tooltips in the chart. + */ + toolTipType?: string; + + /** + * Gets or sets the crosshairs to be displayed. + * + * Valid values: + * "default" Display default number of crosshair lines in the chart. + * "none" Display no crosshair lines in the chart. + * "horizontal" Display horizontal line of crosshairs in the chart. + * "vertical" Display vertical line of crosshairs in the chart. + * "both" Display both horizontal and vertical lines of crosshairs in the chart. + */ + crosshairsDisplayMode?: string; + + /** + * Gets or sets whether crosshairs will snap to the nearest data point. + */ + crosshairsSnapToData?: boolean; + + /** + * Gets or sets whether annotations are shown along the axis for crosshair values + */ + crosshairsAnnotationEnabled?: boolean; + + /** + * Gets or sets whether annotations for the final value of each series is displayed on the axis. + */ + finalValueAnnotationsVisible?: boolean; + + /** + * Gets or sets if callouts should be displayed. + */ + calloutsVisible?: boolean; + + /** + * Gets or sets if event annotations should be displayed. + */ + calloutStyleUpdatingEventEnabled?: boolean; + + /** + * Gets or sets the collection of callout data to be annotated. + */ + calloutsItemsSource?: any; + + /** + * Gets or sets the member path of the X data for the callouts. + */ + calloutsXMemberPath?: string; + + /** + * Gets or sets the member path of the Y data for the callouts. + */ + calloutsYMemberPath?: string; + + /** + * Gets or sets the member path of the label data for the callouts. + */ + calloutsLabelMemberPath?: string; + + /** + * Gets or sets the member path of the content data for the callouts. + */ + calloutsContentMemberPath?: string; + /** * Gets or sets function which takes an context object and returns a formatted label for the X-axis. */ @@ -11343,7 +11428,7 @@ interface IgCategoryChart { xAxisLabel?: any; /** - * Gets or sets the format for labels along the Y-axis. + * Gets or sets the property or string from which the labels are derived. */ yAxisLabel?: any; @@ -11750,6 +11835,16 @@ interface IgCategoryChart { */ yAxisAbbreviateLargeNumbers?: boolean; + /** + * Gets or sets whether the category should be highlighted when hovered + */ + isCategoryHighlightingEnabled?: boolean; + + /** + * Gets or sets whether the item should be highlighted when hovered + */ + isItemHighlightingEnabled?: boolean; + /** * The width of the chart. */ @@ -11832,6 +11927,11 @@ interface IgCategoryChart { */ seriesPointerUp?: SeriesPointerUpEvent; + /** + * Occurs when the style of a callout is updated. + */ + calloutStyleUpdating?: CalloutStyleUpdatingEvent; + /** * Event which is raised before data binding. * Return false in order to cancel data binding. @@ -12406,6 +12506,20 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; + /** + * Gets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isSeriesHighlightingEnabled"): boolean; + + /** + * Sets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isSeriesHighlightingEnabled", optionValue: boolean): void; + /** * Gets the rectangle representing the current scroll and zoom state of the chart. * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. @@ -12646,6 +12760,154 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "trendLinePeriod"): number; igCategoryChart(optionLiteral: 'option', optionName: "trendLinePeriod", optionValue: number): void; + /** + * Gets the style of tooltip to be displayed. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "toolTipType"): string; + + /** + * Sets the style of tooltip to be displayed. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "toolTipType", optionValue: string): void; + + /** + * Gets the crosshairs to be displayed. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "crosshairsDisplayMode"): string; + + /** + * Sets the crosshairs to be displayed. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "crosshairsDisplayMode", optionValue: string): void; + + /** + * Gets whether crosshairs will snap to the nearest data point. + */ + igCategoryChart(optionLiteral: 'option', optionName: "crosshairsSnapToData"): boolean; + + /** + * Sets whether crosshairs will snap to the nearest data point. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "crosshairsSnapToData", optionValue: boolean): void; + + /** + * Gets whether annotations are shown along the axis for crosshair values + */ + igCategoryChart(optionLiteral: 'option', optionName: "crosshairsAnnotationEnabled"): boolean; + + /** + * Sets whether annotations are shown along the axis for crosshair values + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "crosshairsAnnotationEnabled", optionValue: boolean): void; + + /** + * Gets whether annotations for the final value of each series is displayed on the axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "finalValueAnnotationsVisible"): boolean; + + /** + * Sets whether annotations for the final value of each series is displayed on the axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "finalValueAnnotationsVisible", optionValue: boolean): void; + + /** + * Gets if callouts should be displayed. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsVisible"): boolean; + + /** + * Sets if callouts should be displayed. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsVisible", optionValue: boolean): void; + + /** + * Gets if event annotations should be displayed. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutStyleUpdatingEventEnabled"): boolean; + + /** + * Sets if event annotations should be displayed. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutStyleUpdatingEventEnabled", optionValue: boolean): void; + + /** + * Gets the collection of callout data to be annotated. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsItemsSource"): any; + + /** + * Sets the collection of callout data to be annotated. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsItemsSource", optionValue: any): void; + + /** + * Gets the member path of the X data for the callouts. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsXMemberPath"): string; + + /** + * Sets the member path of the X data for the callouts. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsXMemberPath", optionValue: string): void; + + /** + * Gets the member path of the Y data for the callouts. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsYMemberPath"): string; + + /** + * Sets the member path of the Y data for the callouts. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsYMemberPath", optionValue: string): void; + + /** + * Gets the member path of the label data for the callouts. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsLabelMemberPath"): string; + + /** + * Sets the member path of the label data for the callouts. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsLabelMemberPath", optionValue: string): void; + + /** + * Gets the member path of the content data for the callouts. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsContentMemberPath"): string; + + /** + * Sets the member path of the content data for the callouts. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutsContentMemberPath", optionValue: string): void; + /** * Gets function which takes an context object and returns a formatted label for the X-axis. */ @@ -12995,12 +13257,12 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabel", optionValue: any): void; /** - * Gets the format for labels along the Y-axis. + * Gets the property or string from which the labels are derived. */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabel"): any; /** - * Sets the format for labels along the Y-axis. + * Sets the property or string from which the labels are derived. * * @optionValue New value to be set. */ @@ -13758,6 +14020,30 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers", optionValue: boolean): void; + /** + * Gets whether the category should be highlighted when hovered + */ + igCategoryChart(optionLiteral: 'option', optionName: "isCategoryHighlightingEnabled"): boolean; + + /** + * Sets whether the category should be highlighted when hovered + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isCategoryHighlightingEnabled", optionValue: boolean): void; + + /** + * Gets whether the item should be highlighted when hovered + */ + igCategoryChart(optionLiteral: 'option', optionName: "isItemHighlightingEnabled"): boolean; + + /** + * Sets whether the item should be highlighted when hovered + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isItemHighlightingEnabled", optionValue: boolean): void; + /** * The width of the chart. */ @@ -13954,6 +14240,18 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerUp", optionValue: SeriesPointerUpEvent): void; + /** + * Occurs when the style of a callout is updated. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutStyleUpdating"): CalloutStyleUpdatingEvent; + + /** + * Occurs when the style of a callout is updated. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "calloutStyleUpdating", optionValue: CalloutStyleUpdatingEvent): void; + /** * Event which is raised before data binding. * Return false in order to cancel data binding. @@ -15245,7 +15543,7 @@ interface IgDataChartSeries { * Valid values: * "maximum" Consolidated items will be positioned using their maximum value. * "minimum" Consolidated items will be positioned using their minimum value. - * "median" Consolidated items will be positioned using their median value. + * "median" Consolidated items will be positioned at the midpoint of the range. * "relativeMinimum" Consolidated items will be positioned using the value nearest to the reference value of the corresponding axis. * "relativeMaximum" Consolidated items will be positioned using the value farthest from the reference value of the corresponding axis. */ @@ -15319,6 +15617,273 @@ interface IgDataChartSeries { */ hitTestMode?: string; + /** + * Gets or sets the brush that specifies how the backgrounds for the callouts of the layer are painted. + */ + calloutBackground?: string; + + /** + * Gets or sets the strategy to use for avoiding collisions between the callouts in this layer. Leave unset for an automatic value. + * + * Valid values: + * "auto" automatically decide the collision strategy. + * "simulatedAnnealing" use a simulated annealing based collision strategy. This is higher quality, but takes longer, and is performed time-sliced in the background until an acceptable quality is reached. + * "greedy" use a greedy algorithm to avoid collisions. This is cheap and predictable, but of comparatively low quality. + * "greedyCenterOfMass" use a greedy algorithm with localized center of mass hints to avoid collisions. This is relatively cheap to perform, compared to the simulated annealing approach, but is of comparatively lower quality. + */ + calloutCollisionMode?: string; + + /** + * Gets or sets the brush that specifies how the leader lines for the callouts of the layer are painted. + */ + calloutLeaderBrush?: string; + + /** + * Gets or sets the brush that specifies how the outlines for the callouts of the layer are painted. + */ + calloutOutline?: string; + + /** + * Gets or sets the left padding to use withing the callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + calloutPaddingLeft?: number; + + /** + * Gets or sets the top padding to use withing the callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + calloutPaddingTop?: number; + + /** + * Gets or sets the right padding to use withing the callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + calloutPaddingRight?: number; + + /** + * Gets or sets the bottom padding to use withing the callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + calloutPaddingBottom?: number; + + /** + * Gets or sets the padding to add to the callout positioning. Leaving this NaN will use an automatic value related to the axis label margins. + */ + calloutPositionPadding?: number; + + /** + * Gets or sets the stroke thickness for the callout backing. Leave unset for an automatic value. + */ + calloutStrokeThickness?: number; + + /** + * Gets or sets the color to use for the callout text. Leave unset for an automatic value. + */ + calloutTextColor?: string; + + /** + * Gets or sets the content mapping property for the callouts. + */ + contentMemberPath?: string; + + /** + * Gets or sets whether to allow the callouts to be variable distances from the target points, for suppporting collision modes. + */ + isCalloutOffsettingEnabled?: boolean; + + /** + * Gets or sets the key mapping property for the callouts. + */ + keyMemberPath?: string; + + /** + * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value. + */ + axisAnnotationBackground?: string; + + /** + * Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value. + */ + xAxisAnnotationBackground?: string; + + /** + * Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value. + */ + yAxisAnnotationBackground?: string; + + /** + * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value. + */ + axisAnnotationOutline?: string; + + /** + * Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value. + */ + xAxisAnnotationOutline?: string; + + /** + * Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value. + */ + yAxisAnnotationOutline?: string; + + /** + * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value. + */ + axisAnnotationTextColor?: string; + + /** + * Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value. + */ + xAxisAnnotationTextColor?: string; + + /** + * Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value. + */ + yAxisAnnotationTextColor?: string; + + /** + * Gets or sets the left padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + axisAnnotationPaddingLeft?: number; + + /** + * Gets or sets the left padding to use withing the x axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + xAxisAnnotationPaddingLeft?: number; + + /** + * Gets or sets the left padding to use withing the y axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + yAxisAnnotationPaddingLeft?: number; + + /** + * Gets or sets the top padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + axisAnnotationPaddingTop?: number; + + /** + * Gets or sets the top padding to use withing the x axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + xAxisAnnotationPaddingTop?: number; + + /** + * Gets or sets the top padding to use withing the y axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + yAxisAnnotationPaddingTop?: number; + + /** + * Gets or sets the right padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + axisAnnotationPaddingRight?: number; + + /** + * Gets or sets the right padding to use withing the x axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + xAxisAnnotationPaddingRight?: number; + + /** + * Gets or sets the right padding to use withing the y axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + yAxisAnnotationPaddingRight?: number; + + /** + * Gets or sets the bottom padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + axisAnnotationPaddingBottom?: number; + + /** + * Gets or sets the bottom padding to use withing the x axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + xAxisAnnotationPaddingBottom?: number; + + /** + * Gets or sets the bottom padding to use withing the y axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. + */ + yAxisAnnotationPaddingBottom?: number; + + /** + * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value. + */ + axisAnnotationStrokeThickness?: number; + + /** + * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value. + */ + xAxisAnnotationStrokeThickness?: number; + + /** + * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value. + */ + yAxisAnnotationStrokeThickness?: number; + + /** + * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value. + * + * Valid values: + * "auto" a mode is selected automatically + * "finalVisible" displays the last value visible. + * "finalVisibleInterpolated" displays an interploated last value for when the series leaves view. + * "final" displays the last value in the series, whether visible or not. + */ + finalValueSelectionMode?: string; + + /** + * Gets or sets the color to use for the horizontal line. Leave null for an automatic value. + */ + horizontalLineStroke?: string; + + /** + * Gets or sets the color to use for the vertical line. Leave null for an automatic value. + */ + verticalLineStroke?: string; + + /** + * Gets or sets whether to draw annotations over the axes where the crosshair meets with them. + */ + isAxisAnnotationEnabled?: boolean; + + /** + * Sets or gets a function which takes an object that produces a formatted label for displaying in the axis annotation. + */ + axisAnnoationFormatLabel?: any; + + /** + * Sets or gets a function which takes an object that produces a formatted label for displaying in the x axis annotation. + */ + xAxisAnnoationFormatLabel?: any; + + /** + * Sets or gets a function which takes an object that produces a formatted label for displaying in the y axis annotation. + */ + yAxisAnnoationFormatLabel?: any; + + /** + * Sets or gets a function which allows you to decide upon the label that gets used for an automatically created callout. + */ + calloutLabelUpdating?: any; + + /** + * Sets or gets a function which allows you to decide upon the content that gets used for an automatically created callout. + */ + calloutContentUpdating?: any; + + /** + * Sets or gets a function which allows you to decide upon the series that gets used for a data bound callout. + */ + calloutSeriesSelecting?: any; + + /** + * Gets or sets the precision to use displaying values for interpolated crosshair positions. + */ + axisAnnotationInterpolatedValuePrecision?: number; + + /** + * Gets or sets the precision to use displaying values for interpolated crosshair positions. + */ + xAxisAnnotationInterpolatedValuePrecision?: number; + + /** + * Gets or sets the precision to use displaying values for interpolated crosshair positions. + */ + yAxisAnnotationInterpolatedValuePrecision?: number; + /** * Option for IgDataChartSeries */ @@ -39491,6 +40056,12 @@ interface IgFinancialChart { */ isVerticalZoomEnabled?: boolean; + /** + * Gets or sets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + */ + isSeriesHighlightingEnabled?: boolean; + /** * Gets or sets the rectangle representing the current scroll and zoom state of the chart. * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. @@ -39622,6 +40193,79 @@ interface IgFinancialChart { alignsGridLinesToPixels?: boolean; trendLinePeriod?: number; + /** + * Gets or sets the style of tooltip to be displayed. + * + * Valid values: + * "default" Display default tooltip for each series in the chart. + * "item" Display individual tooltips for all series in the chart. + * "category" Display combined tooltip for all series in the chart. + * "none" Display no tooltips in the chart. + */ + toolTipType?: string; + + /** + * Gets or sets the crosshairs to be displayed. + * + * Valid values: + * "default" Display default number of crosshair lines in the chart. + * "none" Display no crosshair lines in the chart. + * "horizontal" Display horizontal line of crosshairs in the chart. + * "vertical" Display vertical line of crosshairs in the chart. + * "both" Display both horizontal and vertical lines of crosshairs in the chart. + */ + crosshairsDisplayMode?: string; + + /** + * Gets or sets whether crosshairs will snap to the nearest data point. + */ + crosshairsSnapToData?: boolean; + + /** + * Gets or sets whether annotations are shown along the axis for crosshair values + */ + crosshairsAnnotationEnabled?: boolean; + + /** + * Gets or sets whether annotations for the final value of each series is displayed on the axis. + */ + finalValueAnnotationsVisible?: boolean; + + /** + * Gets or sets if callouts should be displayed. + */ + calloutsVisible?: boolean; + + /** + * Gets or sets if event annotations should be displayed. + */ + calloutStyleUpdatingEventEnabled?: boolean; + + /** + * Gets or sets the collection of callout data to be annotated. + */ + calloutsItemsSource?: any; + + /** + * Gets or sets the member path of the X data for the callouts. + */ + calloutsXMemberPath?: string; + + /** + * Gets or sets the member path of the Y data for the callouts. + */ + calloutsYMemberPath?: string; + + /** + * Gets or sets the member path of the label data for the callouts. + */ + calloutsLabelMemberPath?: string; + + /** + * Gets or sets the member path of the content data for the callouts. + */ + calloutsContentMemberPath?: string; + /** * Gets or sets function which takes an context object and returns a formatted label for the X-axis. */ @@ -39768,7 +40412,7 @@ interface IgFinancialChart { xAxisLabel?: any; /** - * Gets or sets the format for labels along the Y-axis. + * Gets or sets the property or string from which the labels are derived. */ yAxisLabel?: any; @@ -40025,7 +40669,7 @@ interface IgFinancialChart { chartTypePickerTemplate?: any; trendLineTypePickerTemplate?: any; volumeTypePickerTemplate?: any; - indicatorPickerTemplate?: any; + indicatorMenuTemplate?: any; overlayPickerTemplate?: any; toolbarHeight?: number; @@ -40129,11 +40773,11 @@ interface IgFinancialChart { yAxisAbbreviateLargeNumbers?: boolean; /** - * The type of series to display in the zoom slider pane. + * Gets or sets type of series to display in the zoom slider pane. * * Valid values: * "none" Do not display the zoom slider pane. - * "auto" + * "auto" In the zoom slider pane, match the series type in the price pane. * "bar" Display financial bar series in the zoom slider pane. * "candle" Display candle series in the zoom slider pane. * "column" Display column series in the zoom slider pane. @@ -40256,9 +40900,37 @@ interface IgFinancialChart { * When CustomIndicatorNames is set, the ApplyCustomIndicators event will be raised for each custom indicator name. */ customIndicatorNames?: any; - zoomSliderXAxisMajorStroke?: any; + + /** + * Gets or sets stroke brush of major gridlines on x-axis of the zoom slider pane + */ + zoomSliderXAxisMajorStroke?: string; + + /** + * Gets or sets thickness of major gridlines on x-axis of the zoom slider pane + */ zoomSliderXAxisMajorStrokeThickness?: number; + /** + * Gets or sets weather or not a legend is visible between toolbar and chart's plot area + */ + isLegendVisible?: boolean; + + /** + * Gets or sets a legend displayed between toolbar and chart's plot area + */ + financialChartLegend?: any; + + /** + * Gets or sets minimum value on x-axis + */ + xAxisMinimumValue?: any; + + /** + * Gets or sets maximum value on x-axis + */ + xAxisMaximumValue?: any; + /** * The width of the chart. */ @@ -40341,6 +41013,11 @@ interface IgFinancialChart { */ seriesPointerUp?: SeriesPointerUpEvent; + /** + * Occurs when the style of a callout is updated. + */ + calloutStyleUpdating?: CalloutStyleUpdatingEvent; + /** * Event raised by the chart when custom indicator data is needed from the application. * During series rendering, event will be raised once for each value in the CustomIndicatorNames collection. @@ -40921,6 +41598,20 @@ interface JQuery { */ igFinancialChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; + /** + * Gets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isSeriesHighlightingEnabled"): boolean; + + /** + * Sets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isSeriesHighlightingEnabled", optionValue: boolean): void; + /** * Gets the rectangle representing the current scroll and zoom state of the chart. * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. @@ -41161,6 +41852,154 @@ interface JQuery { igFinancialChart(optionLiteral: 'option', optionName: "trendLinePeriod"): number; igFinancialChart(optionLiteral: 'option', optionName: "trendLinePeriod", optionValue: number): void; + /** + * Gets the style of tooltip to be displayed. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "toolTipType"): string; + + /** + * Sets the style of tooltip to be displayed. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "toolTipType", optionValue: string): void; + + /** + * Gets the crosshairs to be displayed. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "crosshairsDisplayMode"): string; + + /** + * Sets the crosshairs to be displayed. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "crosshairsDisplayMode", optionValue: string): void; + + /** + * Gets whether crosshairs will snap to the nearest data point. + */ + igFinancialChart(optionLiteral: 'option', optionName: "crosshairsSnapToData"): boolean; + + /** + * Sets whether crosshairs will snap to the nearest data point. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "crosshairsSnapToData", optionValue: boolean): void; + + /** + * Gets whether annotations are shown along the axis for crosshair values + */ + igFinancialChart(optionLiteral: 'option', optionName: "crosshairsAnnotationEnabled"): boolean; + + /** + * Sets whether annotations are shown along the axis for crosshair values + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "crosshairsAnnotationEnabled", optionValue: boolean): void; + + /** + * Gets whether annotations for the final value of each series is displayed on the axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "finalValueAnnotationsVisible"): boolean; + + /** + * Sets whether annotations for the final value of each series is displayed on the axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "finalValueAnnotationsVisible", optionValue: boolean): void; + + /** + * Gets if callouts should be displayed. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsVisible"): boolean; + + /** + * Sets if callouts should be displayed. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsVisible", optionValue: boolean): void; + + /** + * Gets if event annotations should be displayed. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutStyleUpdatingEventEnabled"): boolean; + + /** + * Sets if event annotations should be displayed. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutStyleUpdatingEventEnabled", optionValue: boolean): void; + + /** + * Gets the collection of callout data to be annotated. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsItemsSource"): any; + + /** + * Sets the collection of callout data to be annotated. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsItemsSource", optionValue: any): void; + + /** + * Gets the member path of the X data for the callouts. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsXMemberPath"): string; + + /** + * Sets the member path of the X data for the callouts. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsXMemberPath", optionValue: string): void; + + /** + * Gets the member path of the Y data for the callouts. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsYMemberPath"): string; + + /** + * Sets the member path of the Y data for the callouts. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsYMemberPath", optionValue: string): void; + + /** + * Gets the member path of the label data for the callouts. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsLabelMemberPath"): string; + + /** + * Sets the member path of the label data for the callouts. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsLabelMemberPath", optionValue: string): void; + + /** + * Gets the member path of the content data for the callouts. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsContentMemberPath"): string; + + /** + * Sets the member path of the content data for the callouts. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutsContentMemberPath", optionValue: string): void; + /** * Gets function which takes an context object and returns a formatted label for the X-axis. */ @@ -41510,12 +42349,12 @@ interface JQuery { igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabel", optionValue: any): void; /** - * Gets the format for labels along the Y-axis. + * Gets the property or string from which the labels are derived. */ igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabel"): any; /** - * Sets the format for labels along the Y-axis. + * Sets the property or string from which the labels are derived. * * @optionValue New value to be set. */ @@ -42016,8 +42855,8 @@ interface JQuery { igFinancialChart(optionLiteral: 'option', optionName: "trendLineTypePickerTemplate", optionValue: any): void; igFinancialChart(optionLiteral: 'option', optionName: "volumeTypePickerTemplate"): any; igFinancialChart(optionLiteral: 'option', optionName: "volumeTypePickerTemplate", optionValue: any): void; - igFinancialChart(optionLiteral: 'option', optionName: "indicatorPickerTemplate"): any; - igFinancialChart(optionLiteral: 'option', optionName: "indicatorPickerTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "indicatorMenuTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "indicatorMenuTemplate", optionValue: any): void; igFinancialChart(optionLiteral: 'option', optionName: "overlayPickerTemplate"): any; igFinancialChart(optionLiteral: 'option', optionName: "overlayPickerTemplate", optionValue: any): void; igFinancialChart(optionLiteral: 'option', optionName: "toolbarHeight"): number; @@ -42218,13 +43057,13 @@ interface JQuery { igFinancialChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers", optionValue: boolean): void; /** - * The type of series to display in the zoom slider pane. + * Gets type of series to display in the zoom slider pane. */ igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderType"): string; /** - * The type of series to display in the zoom slider pane. + * Sets type of series to display in the zoom slider pane. * * @optionValue New value to be set. */ @@ -42502,11 +43341,79 @@ interface JQuery { * @optionValue New value to be set. */ igFinancialChart(optionLiteral: 'option', optionName: "customIndicatorNames", optionValue: any): void; - igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke"): any; - igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke", optionValue: any): void; + + /** + * Gets stroke brush of major gridlines on x-axis of the zoom slider pane + */ + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke"): string; + + /** + * Sets stroke brush of major gridlines on x-axis of the zoom slider pane + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke", optionValue: string): void; + + /** + * Gets thickness of major gridlines on x-axis of the zoom slider pane + */ igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStrokeThickness"): number; + + /** + * Sets thickness of major gridlines on x-axis of the zoom slider pane + * + * @optionValue New value to be set. + */ igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStrokeThickness", optionValue: number): void; + /** + * Gets weather or not a legend is visible between toolbar and chart's plot area + */ + igFinancialChart(optionLiteral: 'option', optionName: "isLegendVisible"): boolean; + + /** + * Sets weather or not a legend is visible between toolbar and chart's plot area + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isLegendVisible", optionValue: boolean): void; + + /** + * Gets a legend displayed between toolbar and chart's plot area + */ + igFinancialChart(optionLiteral: 'option', optionName: "financialChartLegend"): any; + + /** + * Sets a legend displayed between toolbar and chart's plot area + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "financialChartLegend", optionValue: any): void; + + /** + * Gets minimum value on x-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMinimumValue"): any; + + /** + * Sets minimum value on x-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMinimumValue", optionValue: any): void; + + /** + * Gets maximum value on x-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMaximumValue"): any; + + /** + * Sets maximum value on x-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMaximumValue", optionValue: any): void; + /** * The width of the chart. */ @@ -42703,6 +43610,18 @@ interface JQuery { */ igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerUp", optionValue: SeriesPointerUpEvent): void; + /** + * Occurs when the style of a callout is updated. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutStyleUpdating"): CalloutStyleUpdatingEvent; + + /** + * Occurs when the style of a callout is updated. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "calloutStyleUpdating", optionValue: CalloutStyleUpdatingEvent): void; + /** * Event raised by the chart when custom indicator data is needed from the application. * During series rendering, event will be raised once for each value in the CustomIndicatorNames collection. @@ -47643,6 +48562,53 @@ interface IgGridFilteringColumnSetting { */ columnKey?: string; + /** + * Specifies the type of editor to use for the column. + * + * + * Valid values: + * "text" An igTextEditor will be created + * "mask" An igMaskEditor will be created + * "date" An igDateEditor will be created + * "datepicker" An igDatePicker will be created + * "timepicker" An igTimePikcer will be created + * "numeric" An igNumericEditor will be created + * "checkbox" An igCheckboxEditor will be created + * "currency" An igCurrencyEditor will be created + * "percent" An igPercentEditor will be created + * "combo" An igCombo editor is created. Both the JS and CSS files used by ui.igCombo should be available. + * "rating" An igRating editor is created. Both the JS and CSS files used by ui.igRating should be available. + */ + editorType?: string; + + /** + * Specifies а custom editor provider instance. More information about editor providers can be found [here](http://www.igniteui.com/help/implementing-custom-editor-provider) and [here](http://www.igniteui.com/help/working-with-combo-editor-provider). + * It should either extend $.ig.EditorProvider or have definitions for the following methods: + * $.ig.EditorProvider = $.ig.EditorProvider|| $.ig.EditorProvider.extend({ + * createEditor: function (callbacks, key, editorOptions, tabIndex, format, element) {}, + * attachErrorEvents: function (errorShowing, errorShown, errorHidden) {}, + * getEditor: function () {}, + * refreshValue: function () {}, + * getValue: function () {}, + * setValue: function (val) {}, + * setSize: function (width, height) {}, + * setFocus: function () {}, + * removeFromParent: function () {}, + * destroy: function () {}, + * validator: function () {}, + * validate: function (noLabel) {}, + * isValid: function () {} + * }); + * + */ + editorProvider?: any; + + /** + * Specifies options to initialize the corresponding editor with. + * + */ + editorOptions?: any; + /** * Identifies the grid column by index. Either key or index must be set in every column setting. * @@ -47688,6 +48654,10 @@ interface IgGridFilteringColumnSetting { * "thisYear" * "nextYear" * "lastYear" + * "at" + * "notAt" + * "atBefore" + * "atAfter" */ condition?: string|boolean; @@ -47961,6 +48931,30 @@ interface IgGridFilteringLocale { */ nextYearLabel?: string; + /** + * 'At' label that is used for the predefined filtering conditions in the filter dropdowns. + * + */ + atLabel?: string; + + /** + * 'Not at' label that is used for the predefined filtering conditions in the filter dropdowns. + * + */ + notAtLabel?: string; + + /** + * 'At or before' label that is used for the predefined filtering conditions in the filter dropdowns. + * + */ + atBeforeLabel?: string; + + /** + * 'At or after' label that is used for the predefined filtering conditions in the filter dropdowns. + * + */ + atAfterLabel?: string; + /** * 'Clear' label that is used for the predefined filtering conditions in the filter dropdowns. * @@ -48447,8 +49441,8 @@ interface IgGridFiltering { * * * Valid values: - * "string" The dialog window width in pixels (370px). - * "number" The dialog window width in pixels as a number (370). + * "string" The dialog window width in pixels (500px). + * "number" The dialog window width in pixels as a number (500). */ filterDialogWidth?: string|number; @@ -48546,13 +49540,14 @@ interface IgGridFiltering { locale?: IgGridFilteringLocale; /** - * Custom template for add condition area in the filter dialog. The default template is "

${label1}
${label2}
". + * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * */ filterDialogAddConditionTemplate?: string; /** - * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "" + * and it is used when [filterDialogAddConditionTemplate](ui.iggridfiltering#options:filterDialogAddConditionTemplate) is applied * */ filterDialogAddConditionDropDownTemplate?: string; @@ -48562,13 +49557,14 @@ interface IgGridFiltering { * Each DOM element which is used for selecting filter conditions/columns/filter expressions has "data-*" attribute. * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with . - * The default template is " ". + * The default template is " ". * */ filterDialogFilterTemplate?: string; /** - * Custom template for options in condition list in filter dialog. The default template is "". + * Custom template for options in condition list in filter dialog. The default template is "" + * and it is used for custimizing DOM elemenent with attribute "data-af-cond". * */ filterDialogFilterConditionTemplate?: string; @@ -49246,13 +50242,13 @@ interface JQuery { igGridFiltering(optionLiteral: 'option', optionName: "locale", optionValue: IgGridFilteringLocale): void; /** - * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate"): string; /** - * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * * * @optionValue New value to be set. @@ -49260,13 +50256,15 @@ interface JQuery { igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate", optionValue: string): void; /** - * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "" + * and it is used when [filterDialogAddConditionTemplate](ui.iggridfiltering#options:filterDialogAddConditionTemplate) is applied * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionDropDownTemplate"): string; /** - * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "" + * and it is used when [filterDialogAddConditionTemplate](ui.iggridfiltering#options:filterDialogAddConditionTemplate) is applied * * * @optionValue New value to be set. @@ -49278,7 +50276,7 @@ interface JQuery { * Each DOM element which is used for selecting filter conditions/columns/filter expressions has "data-*" attribute. * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with . - * The default template is " ". + * The default template is " ". * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate"): string; @@ -49288,7 +50286,7 @@ interface JQuery { * Each DOM element which is used for selecting filter conditions/columns/filter expressions has "data-*" attribute. * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with . - * The default template is " ". + * The default template is " ". * * * @optionValue New value to be set. @@ -49296,13 +50294,15 @@ interface JQuery { igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate", optionValue: string): void; /** - * Custom template for options in condition list in filter dialog. The default template is "". + * Custom template for options in condition list in filter dialog. The default template is "" + * and it is used for custimizing DOM elemenent with attribute "data-af-cond". * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterConditionTemplate"): string; /** - * Custom template for options in condition list in filter dialog. The default template is "". + * Custom template for options in condition list in filter dialog. The default template is "" + * and it is used for custimizing DOM elemenent with attribute "data-af-cond". * * * @optionValue New value to be set. @@ -49717,7 +50717,7 @@ interface IgGridColumnGroupOptions { interface IgGridColumn { /** - * Header text for the specified column. + * Header text for the specified column. HTML and special characters should not be included as part of the header text content, because the browsers can interpret it and break the grid UI. * */ headerText?: string; @@ -49742,6 +50742,7 @@ interface IgGridColumn { * Gets/Sets the type of formatting for cells of the column. Default value is null. Checkout [Formatting Dates, Numbers and Strings](http://www.igniteui.com/help/formatting-dates-numbers-and-strings) for details on the valid formatting specifiers. * * If dataType is "date", then supported formats are following: "date", "dateLong", "dateTime", "time", "timeLong", "MM/dd/yyyy", "MMM-d, yy, h:mm:ss tt", "dddd d MMM", etc. + * If dataType is "time", then supported formats are following: "date", "dateLong", "dateTime", "time", "timeLong", "MMM-d, yy, h:mm:ss tt", etc. * If dataType is "number", then supported numeric formats are following: "number", "currency", "percent", "int", "double", "0.00", "#.0####", "0", "#.#######", etc. * The value of "double" will be similar to "number", but with unlimited maximum number of decimal places. * The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. @@ -49751,7 +50752,7 @@ interface IgGridColumn { format?: string; /** - * Data type of the column cell values: string, number, bool, date, object. + * Data type of the column cell values: string, number, bool, date, time, object. * * * Valid values: @@ -49759,6 +50760,7 @@ interface IgGridColumn { * "number" Used when the data for the column is of type number * "boolean" Used when the data for the column is of type boolean * "date" Used when the data for the column is of type date + * "time" Used when the data for the column is of type date and but only the time portion is important * "object" Used when the data for the column is of type object */ dataType?: string; @@ -50629,11 +51631,12 @@ interface IgGrid { aggregateTransactions?: boolean; /** - * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * Sets gets ability to automatically format text in cells for numeric, date and time columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * * * Valid values: * "date" formats only Date columns + * "time" formats only Time columns * "number" formats only number columns * "dateandnumber" formats both Date and number columns * "true" formats Date and number columns @@ -51958,14 +52961,14 @@ interface JQuery { igGrid(optionLiteral: 'option', optionName: "aggregateTransactions", optionValue: boolean): void; /** - * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * Sets gets ability to automatically format text in cells for numeric, date and time columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * */ igGrid(optionLiteral: 'option', optionName: "autoFormat"): string|boolean; /** - * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * Sets gets ability to automatically format text in cells for numeric, date and time columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * * * @optionValue New value to be set. @@ -62382,9 +63385,25 @@ class EditorProviderDatePicker { } } +declare namespace Infragistics { +class EditorProviderTimePicker { + createEditor(callbacks: Object, key: Object, editorOptions: Object, tabIndex: Object, format: Object, element: Object, offset: Object): void; + setValue(value: Object, fe: Object, newOffset: Object): void; + textChanged(evt: Object, ui: Object): void; + setSize(width: Object, height: Object): void; + setFocus(): void; + removeFromParent(): void; + destroy(): void; + refreshValue(): void; + validator(): void; + isValid(): void; +} +} + declare namespace Infragistics { class EditorProviderBoolean { createEditor(callbacks: Object, key: Object, editorOptions: Object, tabIndex: Object, format: Object, element: Object): void; + keyDown(evt: Object, ui: Object): void; valueChanged(evt: Object, ui: Object): void; refreshValue(): void; getValue(): void; @@ -62724,7 +63743,7 @@ interface IgGridSortingLocale { * Custom sorted column tooltip in [igTemplating](http://www.igniteui.com/help/igtemplating-overview) format. * */ - sortedColumnTooltipFormat?: string; + sortedColumnTooltip?: string; /** * Unsorted column tooltip. @@ -64604,7 +65623,7 @@ interface IgGridSummariesMethods { selectCheckBox($checkbox: Object, isToSelect: boolean): void; /** - * Summary calculate the whole data for the specified column key, columnMethods and dataType (used when datasource is remote and dataType is date) + * Summary calculate the whole data for the specified column key, columnMethods and dataType (used when datasource is remote and dataType is date or time) * * @param ck ColumnKey * @param columnMethods Array of column methods objects @@ -65498,6 +66517,7 @@ interface IgGridUpdatingColumnSetting { * "mask" An igMaskEditor will be created * "date" An igDateEditor will be created * "datepicker" An igDatePicker will be created + * "timepicker" An igTimePikcer will be created * "numeric" An igNumericEditor will be created * "checkbox" An igCheckboxEditor will be created * "currency" An igCurrencyEditor will be created @@ -84998,6 +86018,12 @@ interface IgShapeChart { */ isVerticalZoomEnabled?: boolean; + /** + * Gets or sets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + */ + isSeriesHighlightingEnabled?: boolean; + /** * Gets or sets the rectangle representing the current scroll and zoom state of the chart. * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. @@ -85129,6 +86155,79 @@ interface IgShapeChart { alignsGridLinesToPixels?: boolean; trendLinePeriod?: number; + /** + * Gets or sets the style of tooltip to be displayed. + * + * Valid values: + * "default" Display default tooltip for each series in the chart. + * "item" Display individual tooltips for all series in the chart. + * "category" Display combined tooltip for all series in the chart. + * "none" Display no tooltips in the chart. + */ + toolTipType?: string; + + /** + * Gets or sets the crosshairs to be displayed. + * + * Valid values: + * "default" Display default number of crosshair lines in the chart. + * "none" Display no crosshair lines in the chart. + * "horizontal" Display horizontal line of crosshairs in the chart. + * "vertical" Display vertical line of crosshairs in the chart. + * "both" Display both horizontal and vertical lines of crosshairs in the chart. + */ + crosshairsDisplayMode?: string; + + /** + * Gets or sets whether crosshairs will snap to the nearest data point. + */ + crosshairsSnapToData?: boolean; + + /** + * Gets or sets whether annotations are shown along the axis for crosshair values + */ + crosshairsAnnotationEnabled?: boolean; + + /** + * Gets or sets whether annotations for the final value of each series is displayed on the axis. + */ + finalValueAnnotationsVisible?: boolean; + + /** + * Gets or sets if callouts should be displayed. + */ + calloutsVisible?: boolean; + + /** + * Gets or sets if event annotations should be displayed. + */ + calloutStyleUpdatingEventEnabled?: boolean; + + /** + * Gets or sets the collection of callout data to be annotated. + */ + calloutsItemsSource?: any; + + /** + * Gets or sets the member path of the X data for the callouts. + */ + calloutsXMemberPath?: string; + + /** + * Gets or sets the member path of the Y data for the callouts. + */ + calloutsYMemberPath?: string; + + /** + * Gets or sets the member path of the label data for the callouts. + */ + calloutsLabelMemberPath?: string; + + /** + * Gets or sets the member path of the content data for the callouts. + */ + calloutsContentMemberPath?: string; + /** * Gets or sets function which takes an context object and returns a formatted label for the X-axis. */ @@ -85275,7 +86374,7 @@ interface IgShapeChart { xAxisLabel?: any; /** - * Gets or sets the format for labels along the Y-axis. + * Gets or sets the property or string from which the labels are derived. */ yAxisLabel?: any; @@ -85715,6 +86814,11 @@ interface IgShapeChart { */ seriesPointerUp?: SeriesPointerUpEvent; + /** + * Occurs when the style of a callout is updated. + */ + calloutStyleUpdating?: CalloutStyleUpdatingEvent; + /** * Event which is raised before data binding. * Return false in order to cancel data binding. @@ -86325,6 +87429,20 @@ interface JQuery { */ igShapeChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; + /** + * Gets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + */ + igShapeChart(optionLiteral: 'option', optionName: "isSeriesHighlightingEnabled"): boolean; + + /** + * Sets whether the chart can highlight series through user interactions. + * This property applies to Category Chart and Financial Chart controls. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "isSeriesHighlightingEnabled", optionValue: boolean): void; + /** * Gets the rectangle representing the current scroll and zoom state of the chart. * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. @@ -86565,6 +87683,154 @@ interface JQuery { igShapeChart(optionLiteral: 'option', optionName: "trendLinePeriod"): number; igShapeChart(optionLiteral: 'option', optionName: "trendLinePeriod", optionValue: number): void; + /** + * Gets the style of tooltip to be displayed. + */ + + igShapeChart(optionLiteral: 'option', optionName: "toolTipType"): string; + + /** + * Sets the style of tooltip to be displayed. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "toolTipType", optionValue: string): void; + + /** + * Gets the crosshairs to be displayed. + */ + + igShapeChart(optionLiteral: 'option', optionName: "crosshairsDisplayMode"): string; + + /** + * Sets the crosshairs to be displayed. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "crosshairsDisplayMode", optionValue: string): void; + + /** + * Gets whether crosshairs will snap to the nearest data point. + */ + igShapeChart(optionLiteral: 'option', optionName: "crosshairsSnapToData"): boolean; + + /** + * Sets whether crosshairs will snap to the nearest data point. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "crosshairsSnapToData", optionValue: boolean): void; + + /** + * Gets whether annotations are shown along the axis for crosshair values + */ + igShapeChart(optionLiteral: 'option', optionName: "crosshairsAnnotationEnabled"): boolean; + + /** + * Sets whether annotations are shown along the axis for crosshair values + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "crosshairsAnnotationEnabled", optionValue: boolean): void; + + /** + * Gets whether annotations for the final value of each series is displayed on the axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "finalValueAnnotationsVisible"): boolean; + + /** + * Sets whether annotations for the final value of each series is displayed on the axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "finalValueAnnotationsVisible", optionValue: boolean): void; + + /** + * Gets if callouts should be displayed. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsVisible"): boolean; + + /** + * Sets if callouts should be displayed. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsVisible", optionValue: boolean): void; + + /** + * Gets if event annotations should be displayed. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutStyleUpdatingEventEnabled"): boolean; + + /** + * Sets if event annotations should be displayed. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutStyleUpdatingEventEnabled", optionValue: boolean): void; + + /** + * Gets the collection of callout data to be annotated. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsItemsSource"): any; + + /** + * Sets the collection of callout data to be annotated. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsItemsSource", optionValue: any): void; + + /** + * Gets the member path of the X data for the callouts. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsXMemberPath"): string; + + /** + * Sets the member path of the X data for the callouts. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsXMemberPath", optionValue: string): void; + + /** + * Gets the member path of the Y data for the callouts. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsYMemberPath"): string; + + /** + * Sets the member path of the Y data for the callouts. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsYMemberPath", optionValue: string): void; + + /** + * Gets the member path of the label data for the callouts. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsLabelMemberPath"): string; + + /** + * Sets the member path of the label data for the callouts. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsLabelMemberPath", optionValue: string): void; + + /** + * Gets the member path of the content data for the callouts. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsContentMemberPath"): string; + + /** + * Sets the member path of the content data for the callouts. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutsContentMemberPath", optionValue: string): void; + /** * Gets function which takes an context object and returns a formatted label for the X-axis. */ @@ -86914,12 +88180,12 @@ interface JQuery { igShapeChart(optionLiteral: 'option', optionName: "xAxisLabel", optionValue: any): void; /** - * Gets the format for labels along the Y-axis. + * Gets the property or string from which the labels are derived. */ igShapeChart(optionLiteral: 'option', optionName: "yAxisLabel"): any; /** - * Sets the format for labels along the Y-axis. + * Sets the property or string from which the labels are derived. * * @optionValue New value to be set. */ @@ -87815,6 +89081,18 @@ interface JQuery { */ igShapeChart(optionLiteral: 'option', optionName: "seriesPointerUp", optionValue: SeriesPointerUpEvent): void; + /** + * Occurs when the style of a callout is updated. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutStyleUpdating"): CalloutStyleUpdatingEvent; + + /** + * Occurs when the style of a callout is updated. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "calloutStyleUpdating", optionValue: CalloutStyleUpdatingEvent): void; + /** * Event which is raised before data binding. * Return false in order to cancel data binding. @@ -90679,6 +91957,13 @@ interface JQuery { igSplitter(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; igSplitter(methodName: string, ...methodParams: any[]): any; } +interface IgSpreadsheetBrushes { + /** + * Option for IgSpreadsheetBrushes + */ + [optionName: string]: any; +} + interface ActivePaneChangedEvent { (event: Event, ui: ActivePaneChangedEventUIParam): void; } @@ -90786,6 +92071,11 @@ interface EditModeExitingEventUIParam { * Gets the cell for which the control is exiting edit mode. */ cell?: string; + + /** + * Gets the edit text that will be used to update the cell(s). + */ + editText?: string; } interface EditModeExitedEvent { @@ -90994,6 +92284,12 @@ interface IgSpreadsheet { */ activeCell?: string; + /** + * Returns or sets an object with brushes for areas of the spreadsheet. The property name should be an item in the [SpreadsheetResourceId enumeration](ig.spreadsheet.SpreadsheetResourceId) and the property value a string representing a brush. These brushes override any css styling for the associated object. + * + */ + brushes?: IgSpreadsheetBrushes; + /** * Returns or sets a boolean indicating whether the scroll lock key is toggled. * This property is used when certain keys are pressed while the control has focus. For example @@ -91294,6 +92590,11 @@ interface IgSpreadsheetMethods { */ executeAction(action: Object): boolean; + /** + * Exports visual data from the spreadsheet to aid in unit testing + */ + exportVisualData(): void; + /** * Shows the filter dialog for the specified relative column of the [filterSettings](ig.excel.worksheet#methods:filterSettings) of the [activeWorksheet](ui.igspreadsheet#options:activeWorksheet). * @@ -91310,6 +92611,20 @@ interface IgSpreadsheetMethods { */ showFilterDialogForTable(worksheetTableColumn: Object, spreadsheetFilterDialogOption: Object): void; + /** + * Shows the top or bottom dialog for the specified relative column of the [filterSettings](ig.excel.worksheet#methods:filterSettings) of the [activeWorksheet](ui.igspreadsheet#options:activeWorksheet). + * + * @param relativeColumnIndex A zero based column index relative to the [region](ig.excel.worksheetFilterSettings#methods:region) of the active worksheet. + */ + showTopOrBottomDialogForWorksheet(relativeColumnIndex: number): void; + + /** + * Shows the top or bottom dialog for the specified relative column of the [filterSettings](ig.excel.Worksheet#methods:filterSettings) of the [activeWorksheet](ui.igspreadsheet#options:activeWorksheet). + * + * @param worksheetTableColumn A [region](ig.excel.WorksheetTableColumn) whose filter is to be viewed or changed. + */ + showTopOrBottomDialogForTable(worksheetTableColumn: Object): void; + /** * Forces any pending deferred work to render on the spreadsheet before continuing */ @@ -91350,8 +92665,11 @@ interface JQuery { igSpreadsheet(methodName: "getIsRenamingWorksheet"): boolean; igSpreadsheet(methodName: "getPanes"): void; igSpreadsheet(methodName: "executeAction", action: Object): boolean; + igSpreadsheet(methodName: "exportVisualData"): void; igSpreadsheet(methodName: "showFilterDialogForWorksheet", relativeColumnIndex: number, spreadsheetFilterDialogOption: Object): void; igSpreadsheet(methodName: "showFilterDialogForTable", worksheetTableColumn: Object, spreadsheetFilterDialogOption: Object): void; + igSpreadsheet(methodName: "showTopOrBottomDialogForWorksheet", relativeColumnIndex: number): void; + igSpreadsheet(methodName: "showTopOrBottomDialogForTable", worksheetTableColumn: Object): void; igSpreadsheet(methodName: "flush"): void; igSpreadsheet(methodName: "destroy"): void; igSpreadsheet(methodName: "changeLocale", $container: Object): void; @@ -91405,6 +92723,20 @@ interface JQuery { */ igSpreadsheet(optionLiteral: 'option', optionName: "activeCell", optionValue: string): void; + /** + * Returns an object with brushes for areas of the spreadsheet. The property name should be an item in the [SpreadsheetResourceId enumeration](ig.spreadsheet.SpreadsheetResourceId) and the property value a string representing a brush. These brushes override any css styling for the associated object. + * + */ + igSpreadsheet(optionLiteral: 'option', optionName: "brushes"): IgSpreadsheetBrushes; + + /** + * Returns or sets an object with brushes for areas of the spreadsheet. The property name should be an item in the [SpreadsheetResourceId enumeration](ig.spreadsheet.SpreadsheetResourceId) and the property value a string representing a brush. These brushes override any css styling for the associated object. + * + * + * @optionValue New value to be set. + */ + igSpreadsheet(optionLiteral: 'option', optionName: "brushes", optionValue: IgSpreadsheetBrushes): void; + /** * Returns a boolean indicating whether the scroll lock key is toggled. * This property is used when certain keys are pressed while the control has focus. For example @@ -97640,8 +98972,8 @@ interface IgTreeGridFiltering { * * * Valid values: - * "string" The dialog window width in pixels (370px). - * "number" The dialog window width in pixels as a number (370). + * "string" The dialog window width in pixels (500px). + * "number" The dialog window width in pixels as a number (500). */ filterDialogWidth?: string|number; @@ -97738,13 +99070,14 @@ interface IgTreeGridFiltering { featureChooserTextAdvancedFilter?: string; /** - * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * */ filterDialogAddConditionTemplate?: string; /** - * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "" + * and it is used when [filterDialogAddConditionTemplate](ui.iggridfiltering#options:filterDialogAddConditionTemplate) is applied * */ filterDialogAddConditionDropDownTemplate?: string; @@ -97754,13 +99087,14 @@ interface IgTreeGridFiltering { * Each DOM element which is used for selecting filter conditions/columns/filter expressions has "data-*" attribute. * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with . - * The default template is " ". + * The default template is " ". * */ filterDialogFilterTemplate?: string; /** - * Custom template for options in condition list in filter dialog. The default template is "". + * Custom template for options in condition list in filter dialog. The default template is "" + * and it is used for custimizing DOM elemenent with attribute "data-af-cond". * */ filterDialogFilterConditionTemplate?: string; @@ -98529,13 +99863,13 @@ interface JQuery { igTreeGridFiltering(optionLiteral: 'option', optionName: "featureChooserTextAdvancedFilter", optionValue: string): void; /** - * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate"): string; /** - * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * * * @optionValue New value to be set. @@ -98543,13 +99877,15 @@ interface JQuery { igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate", optionValue: string): void; /** - * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "" + * and it is used when [filterDialogAddConditionTemplate](ui.iggridfiltering#options:filterDialogAddConditionTemplate) is applied * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionDropDownTemplate"): string; /** - * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "" + * and it is used when [filterDialogAddConditionTemplate](ui.iggridfiltering#options:filterDialogAddConditionTemplate) is applied * * * @optionValue New value to be set. @@ -98561,7 +99897,7 @@ interface JQuery { * Each DOM element which is used for selecting filter conditions/columns/filter expressions has "data-*" attribute. * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with . - * The default template is " ". + * The default template is " ". * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate"): string; @@ -98571,7 +99907,7 @@ interface JQuery { * Each DOM element which is used for selecting filter conditions/columns/filter expressions has "data-*" attribute. * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with . - * The default template is " ". + * The default template is " ". * * * @optionValue New value to be set. @@ -98579,13 +99915,15 @@ interface JQuery { igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate", optionValue: string): void; /** - * Custom template for options in condition list in filter dialog. The default template is "". + * Custom template for options in condition list in filter dialog. The default template is "" + * and it is used for custimizing DOM elemenent with attribute "data-af-cond". * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterConditionTemplate"): string; /** - * Custom template for options in condition list in filter dialog. The default template is "". + * Custom template for options in condition list in filter dialog. The default template is "" + * and it is used for custimizing DOM elemenent with attribute "data-af-cond". * * * @optionValue New value to be set. @@ -100078,11 +101416,12 @@ interface IgTreeGrid { aggregateTransactions?: boolean; /** - * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * Sets gets ability to automatically format text in cells for numeric, date and time columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * * * Valid values: * "date" formats only Date columns + * "time" formats only Time columns * "number" formats only number columns * "dateandnumber" formats both Date and number columns * "true" formats Date and number columns @@ -101613,14 +102952,14 @@ interface JQuery { igTreeGrid(optionLiteral: 'option', optionName: "aggregateTransactions", optionValue: boolean): void; /** - * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * Sets gets ability to automatically format text in cells for numeric, date and time columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * */ igTreeGrid(optionLiteral: 'option', optionName: "autoFormat"): string|boolean; /** - * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * Sets gets ability to automatically format text in cells for numeric, date and time columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * * * @optionValue New value to be set. @@ -113340,6 +114679,12 @@ interface IgZoomSlider { height?: string|number; panTransitionDuration?: number; maxZoomWidth?: number; + + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ pixelScalingRatio?: number; actualPixelScalingRatio?: number; windowRect?: any; @@ -113387,6 +114732,10 @@ interface IgZoomSlider { thumbCalloutTextStyle?: any; propertyChanged?: PropertyChangedEvent; resolvingAxisValue?: ResolvingAxisValueEvent; + + /** + * Occurs just after the current ZoomSlider's window rectangle is changed. + */ windowRectChanged?: WindowRectChangedEvent; /** @@ -113447,7 +114796,21 @@ interface JQuery { igZoomSlider(optionLiteral: 'option', optionName: "panTransitionDuration", optionValue: number): void; igZoomSlider(optionLiteral: 'option', optionName: "maxZoomWidth"): number; igZoomSlider(optionLiteral: 'option', optionName: "maxZoomWidth", optionValue: number): void; + + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ igZoomSlider(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ igZoomSlider(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; igZoomSlider(optionLiteral: 'option', optionName: "actualPixelScalingRatio"): number; igZoomSlider(optionLiteral: 'option', optionName: "actualPixelScalingRatio", optionValue: number): void; @@ -113541,7 +114904,17 @@ interface JQuery { igZoomSlider(optionLiteral: 'option', optionName: "propertyChanged", optionValue: PropertyChangedEvent): void; igZoomSlider(optionLiteral: 'option', optionName: "resolvingAxisValue"): ResolvingAxisValueEvent; igZoomSlider(optionLiteral: 'option', optionName: "resolvingAxisValue", optionValue: ResolvingAxisValueEvent): void; + + /** + * Occurs just after the current ZoomSlider's window rectangle is changed. + */ igZoomSlider(optionLiteral: 'option', optionName: "windowRectChanged"): WindowRectChangedEvent; + + /** + * Occurs just after the current ZoomSlider's window rectangle is changed. + * + * @optionValue New value to be set. + */ igZoomSlider(optionLiteral: 'option', optionName: "windowRectChanged", optionValue: WindowRectChangedEvent): void; igZoomSlider(options: IgZoomSlider): JQuery; igZoomSlider(optionLiteral: 'option', optionName: string): any; @@ -113578,6 +114951,7 @@ interface IgniteUIStatic { loader(resources: string, callback: Function): IgLoader; loader(): IgLoader; OlapUtilities: any; + formatter(val: Date|number|string, type: string, format: string, notTemplate?: boolean, enableUTCDates?: boolean, dateOffset?: any, displayStyle?: string, labelText?: string, tabIndex?: string|number, reg?: any): string; } interface JQueryStatic { diff --git a/types/imap-simple/index.d.ts b/types/imap-simple/index.d.ts index 398bcb6a26..f346d51e52 100644 --- a/types/imap-simple/index.d.ts +++ b/types/imap-simple/index.d.ts @@ -55,7 +55,7 @@ export class ImapSimple extends NodeJS.EventEmitter { getBoxes(callback: (err: Error, boxes: Imap.MailBoxes) => void): void; getBoxes(): Promise; - /** Search for and retrieve mail in the previously opened mailbox. */ + /** Search for and retrieve mail in the currently open mailbox. */ search(searchCriteria: any[], fetchOptions: Imap.FetchOptions, callback: (err: Error, messages: Message[]) => void): void; search(searchCriteria: any[], fetchOptions: Imap.FetchOptions): Promise; diff --git a/types/indefinite/indefinite-tests.ts b/types/indefinite/indefinite-tests.ts new file mode 100644 index 0000000000..881a09f666 --- /dev/null +++ b/types/indefinite/indefinite-tests.ts @@ -0,0 +1,9 @@ +import { indefinite } from "indefinite"; + +const anApple = indefinite("apple"); // "an apple" +const aBanana = indefinite('banana'); // "a banana" +const AnApple = indefinite('apple', { capitalize: true }); // "An apple" +const anEight = indefinite("8"); // "an 8" +const anEightAsNumber = indefinite(8); // "an 8" +const a1892 = indefinite("1892"); // "a 1892" -> read "a one thousand eight hundred ninety-two" +const a1892AsColloquial = indefinite("1892", { numbers: "colloquial" }); // "an 1892" -> read "an eighteen ninety-two" diff --git a/types/indefinite/index.d.ts b/types/indefinite/index.d.ts new file mode 100644 index 0000000000..50f5fdbbf4 --- /dev/null +++ b/types/indefinite/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for indefinite 2.2 +// Project: https://github.com/tandrewnichols/indefinite +// Definitions by: omaishar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + capitalize?: boolean; + caseInsensitive?: boolean; + numbers?: "colloquial"; +} +export function indefinite(word: string | number, opts?: Options): string; diff --git a/types/p-map/tsconfig.json b/types/indefinite/tsconfig.json similarity index 75% rename from types/p-map/tsconfig.json rename to types/indefinite/tsconfig.json index ed62309b29..94477767e2 100644 --- a/types/p-map/tsconfig.json +++ b/types/indefinite/tsconfig.json @@ -7,17 +7,17 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", - "p-map-tests.ts" + "indefinite-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/p-throttle/tslint.json b/types/indefinite/tslint.json similarity index 100% rename from types/p-throttle/tslint.json rename to types/indefinite/tslint.json diff --git a/types/ink-spinner/index.d.ts b/types/ink-spinner/index.d.ts new file mode 100644 index 0000000000..db68c31c04 --- /dev/null +++ b/types/ink-spinner/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for ink-spinner 2.0 +// Project: https://github.com/vadimdemedes/ink-spinner#readme +// Definitions by: Łukasz Ostrowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Chalk } from 'chalk'; +import * as cliSpinners from 'cli-spinners'; +import { Component } from 'ink'; + +type StringifyPartial = { + [P in keyof T]?: string; +}; + +type BooleansPartial = { + [P in keyof T]?: boolean; +}; + +type TupleOfNumbersPartial = { + [P in keyof T]?: [number, number, number]; +}; +// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html +type Omit = Pick>; + +type ChalkColorModels = Pick; +type ChalkKeywordsAndHexes = Pick; +type ChalkCommons = Omit; + +interface SpinnerProps { + type?: cliSpinners.SpinnerName; +} + +type ChalkProps = BooleansPartial + & StringifyPartial + & TupleOfNumbersPartial; + +declare class Spinner extends Component { } + +export = Spinner; diff --git a/types/ink-spinner/ink-spinner-tests.tsx b/types/ink-spinner/ink-spinner-tests.tsx new file mode 100644 index 0000000000..3d91bdf1bb --- /dev/null +++ b/types/ink-spinner/ink-spinner-tests.tsx @@ -0,0 +1,10 @@ +/** @jsx h */ +import { h } from 'ink'; +import Spinner from 'ink-spinner'; +// NOTE: `import Spinner = require('ink-spinner');` will work as well. +// If importing using ES6 default import as above, +// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true` + +const Demo = () => { + return ; +}; diff --git a/types/ink-spinner/package.json b/types/ink-spinner/package.json new file mode 100644 index 0000000000..6c2f5b70e4 --- /dev/null +++ b/types/ink-spinner/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chalk": "^2.1.0" + } +} diff --git a/types/ink-spinner/tsconfig.json b/types/ink-spinner/tsconfig.json new file mode 100644 index 0000000000..3b72485a18 --- /dev/null +++ b/types/ink-spinner/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "jsx": "react", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ink-spinner-tests.tsx" + ] +} diff --git a/types/ink-spinner/tslint.json b/types/ink-spinner/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ink-spinner/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ink-text-input/index.d.ts b/types/ink-text-input/index.d.ts new file mode 100644 index 0000000000..9aaadd330e --- /dev/null +++ b/types/ink-text-input/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ink-text-input 2.0 +// Project: https://github.com/vadimdemedes/ink-text-input#readme +// Definitions by: Łukasz Ostrowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component } from 'ink'; + +interface TextInputProps { + focus?: boolean; + onChange?: (value: string) => void; + onSubmit?: (value: string) => void; + placeholder?: string; + value?: string; +} + +declare class TextInput extends Component { } + +export = TextInput; diff --git a/types/ink-text-input/ink-text-input-tests.tsx b/types/ink-text-input/ink-text-input-tests.tsx new file mode 100644 index 0000000000..82b63854a2 --- /dev/null +++ b/types/ink-text-input/ink-text-input-tests.tsx @@ -0,0 +1,47 @@ +/** @jsx h */ +import { h, Component } from 'ink'; +import TextInput from 'ink-text-input'; +// NOTE: `import TextInput = require('ink-text-input');` will work as well +// For importing using ES6 default import as above, +// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true` + +interface QueryState { + query: string; +} + +class SearchQuery extends Component { + constructor() { + super(); + + this.state = { + query: '' + }; + + this.handleChange = this.handleChange.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + } + + render(props: {}, state: QueryState) { + return ( +
+ Enter your query: + + +
+ ); + } + + private handleChange(value: string) { + this.setState({ + query: value, + }); + } + + private handleSubmit(value: string) { + console.log(value); + } +} diff --git a/types/ink-text-input/tsconfig.json b/types/ink-text-input/tsconfig.json new file mode 100644 index 0000000000..2582b4325e --- /dev/null +++ b/types/ink-text-input/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "jsx": "react", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ink-text-input-tests.tsx" + ] +} diff --git a/types/ink-text-input/tslint.json b/types/ink-text-input/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ink-text-input/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/internal-ip/index.d.ts b/types/internal-ip/index.d.ts deleted file mode 100644 index 1bed7e9059..0000000000 --- a/types/internal-ip/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Type definitions for internal-ip 3.0 -// Project: https://github.com/sindresorhus/internal-ip#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export const v6: IPGetterFn; -export const v4: IPGetterFn; - -export interface IPGetterFn { // tslint:disable-line:interface-name - (): Promise; - sync(): string | null; -} diff --git a/types/internal-ip/internal-ip-tests.ts b/types/internal-ip/internal-ip-tests.ts deleted file mode 100644 index 1b383de2f3..0000000000 --- a/types/internal-ip/internal-ip-tests.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as internalIp from 'internal-ip'; - -internalIp.v6().then(ip => { - // $ExpectType string | null - ip; -}); -// $ExpectType string | null -internalIp.v6.sync(); - -internalIp.v4().then(ip => { - // $ExpectType string | null - ip; -}); -// $ExpectType string | null -internalIp.v4.sync(); diff --git a/types/internal-ip/v2/index.d.ts b/types/internal-ip/v2/index.d.ts deleted file mode 100644 index a82dd8c913..0000000000 --- a/types/internal-ip/v2/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Type definitions for internal-ip 2.0 -// Project: https://github.com/sindresorhus/internal-ip#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export function v6(): Promise; -export function v4(): Promise; diff --git a/types/internal-ip/v2/internal-ip-tests.ts b/types/internal-ip/v2/internal-ip-tests.ts deleted file mode 100644 index e94ec9f510..0000000000 --- a/types/internal-ip/v2/internal-ip-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as internalIp from 'internal-ip'; - -let str: string; -internalIp.v6().then(ip => { - str = ip; -}); - -internalIp.v4().then(ip => { - str = ip; -}); diff --git a/types/iobroker/index.d.ts b/types/iobroker/index.d.ts index 71fa1b4d78..c3f9cee9d3 100644 --- a/types/iobroker/index.d.ts +++ b/types/iobroker/index.d.ts @@ -900,7 +900,7 @@ declare global { q?: boolean; addID?: boolean; limit?: number; - ignoreNull: boolean; + ignoreNull?: boolean; sessionId?: any; aggregate?: "minmax" | "min" | "max" | "average" | "total" | "count" | "none"; } @@ -1627,11 +1627,11 @@ declare global { removeAllListeners(event?: "ready" | "unload" | "stateChange" | "objectChange" | "message"): this; } // end interface Adapter - type ReadyHandler = () => void; - type ObjectChangeHandler = (id: string, obj: ioBroker.Object | null | undefined) => void; - type StateChangeHandler = (id: string, obj: State | null | undefined) => void; - type MessageHandler = (obj: Message) => void; - type UnloadHandler = (callback: EmptyCallback) => void; + type ReadyHandler = () => void | Promise; + type ObjectChangeHandler = (id: string, obj: ioBroker.Object | null | undefined) => void | Promise; + type StateChangeHandler = (id: string, obj: State | null | undefined) => void | Promise; + type MessageHandler = (obj: Message) => void | Promise; + type UnloadHandler = (callback: EmptyCallback) => void | Promise; type EmptyCallback = () => void; type ErrorCallback = (err?: string) => void; @@ -1682,7 +1682,8 @@ declare global { type SetStateCallback = (err: string | null, id?: string) => void; type SetStateChangedCallback = (err: string | null, id: string, notChanged: boolean) => void; type DeleteStateCallback = (err: string | null, id?: string) => void; - type GetHistoryCallback = (err: string | null, result: Array<(State & { id?: string })>, step: number, sessionId?: string) => void; + type GetHistoryResult = Array<(State & { id?: string })>; + type GetHistoryCallback = (err: string | null, result: GetHistoryResult, step: number, sessionId?: string) => void; /** Contains the return values of readDir */ interface ReadDirResult { diff --git a/types/iobroker/iobroker-tests.ts b/types/iobroker/iobroker-tests.ts index 0302a5041a..49af1f6ebd 100644 --- a/types/iobroker/iobroker-tests.ts +++ b/types/iobroker/iobroker-tests.ts @@ -20,6 +20,16 @@ adapter ; adapter.removeAllListeners(); +// Test adapter constructor options +let adapterOptions: ioBroker.AdapterOptions = { + name: "foo", + ready: readyHandler, + stateChange: stateChangeHandler, + objectChange: objectChangeHandler, + message: messageHandler, + unload: unloadHandler, +}; + function readyHandler() { } function stateChangeHandler(id: string, state: ioBroker.State | null | undefined) { @@ -260,6 +270,8 @@ adapter.subscribeForeignStatesAsync("*").catch(handleError); adapter.unsubscribeStatesAsync("*").catch(handleError); adapter.unsubscribeForeignStatesAsync("*").catch(handleError); +adapter.getHistory("state.id", {}, (err, result: ioBroker.GetHistoryResult) => {}); + // Repro from https://github.com/ioBroker/adapter-core/issues/3 const repro1: ioBroker.ObjectChangeHandler = (id, obj) => { if (!obj || !obj.common) return; diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index d5f829c8fe..cbe5b0f8e2 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -272,7 +272,7 @@ declare namespace IORedis { hgetBuffer(key: KeyType, field: string, callback: (err: Error, res: Buffer) => void): void; hgetBuffer(key: KeyType, field: string): Promise; - hmset(key: KeyType, field: string, value: any, ...args: string[]): Promise<0 | 1>; + hmset(key: KeyType, ...args: any[]): Promise<0 | 1>; hmset(key: KeyType, data: any, callback: (err: Error, res: 0 | 1) => void): void; hmset(key: KeyType, data: any): Promise<0 | 1>; @@ -313,9 +313,13 @@ declare namespace IORedis { getset(key: KeyType, value: any, callback: (err: Error, res: string | null) => void): void; getset(key: KeyType, value: any): Promise; - mset(key: KeyType, value: any, ...args: string[]): any; + mset(...args: any[]): any; + mset(data: any, callback: (err: Error, res: string) => void): void; + mset(data: any): Promise; - msetnx(key: KeyType, value: any, ...args: string[]): any; + msetnx(...args: any[]): any; + msetnx(data: any, callback: (err: Error, res: 0 | 1) => void): void; + msetnx(data: any): Promise<0 | 1>; randomkey(callback: (err: Error, res: string) => void): void; randomkey(): Promise; @@ -489,6 +493,8 @@ declare namespace IORedis { xack(key: KeyType, group: string, ...ids: string[]): any; xadd(key: KeyType, id: string, ...args: string[]): any; + xadd(key: KeyType, maxLenOption: 'MAXLEN' | 'maxlen', count: number, ...args: string[]): any; + xadd(key: KeyType, maxLenOption: 'MAXLEN' | 'maxlen', approximate: '~', count: number, ...args: string[]): any; xclaim(key: KeyType, group: string, consumer: string, minIdleTime: number, ...args: any[]): any; @@ -673,7 +679,7 @@ declare namespace IORedis { hget(key: KeyType, field: string, callback?: (err: Error, res: string | string) => void): Pipeline; hgetBuffer(key: KeyType, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline; - hmset(key: KeyType, field: string, value: any, ...args: string[]): Pipeline; + hmset(key: KeyType, ...args: any[]): Pipeline; hmset(key: KeyType, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; hmget(key: KeyType, ...fields: string[]): Pipeline; @@ -702,9 +708,11 @@ declare namespace IORedis { getset(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline; - mset(key: KeyType, value: any, ...args: string[]): Pipeline; + mset(...args: any[]): Pipeline; + mset(data: any, callback?: (err: Error, res: string) => void): Pipeline; - msetnx(key: KeyType, value: any, ...args: string[]): Pipeline; + msetnx(...args: any[]): Pipeline; + msetnx(data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; randomkey(callback?: (err: Error, res: string) => void): Pipeline; diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index 9950a8543f..fdb1fafcc1 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -154,6 +154,9 @@ redis.multi([ const keys = ['foo', 'bar']; redis.mget(...keys); +redis.mset(...['foo', 'bar']); +redis.mset({ foo: 'bar' }); + new Redis.Cluster([ 'localhost' ]); @@ -177,6 +180,8 @@ new Redis.Cluster([{ redis.xack('streamName', 'groupName', 'id'); redis.xadd('streamName', '*', 'field', 'name'); +redis.xadd('streamName', 'MAXLEN', 100, '*', 'field', 'name'); +redis.xadd('streamName', 'MAXLEN', '~', 100, '*', 'field', 'name'); redis.xclaim('streamName', 'groupName', 'consumerName', 3600000, 'id'); redis.xdel('streamName', 'id'); redis.xgroup('CREATE', 'streamName', 'groupName', '$'); diff --git a/types/is-blank/index.d.ts b/types/is-blank/index.d.ts new file mode 100644 index 0000000000..eedfa5bd6d --- /dev/null +++ b/types/is-blank/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for is-blank 2.1 +// Project: https://github.com/johnotander/is-blank#readme +// Definitions by: Christian Gambardella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isBlank(input: any): boolean; +export = isBlank; diff --git a/types/is-blank/is-blank-tests.ts b/types/is-blank/is-blank-tests.ts new file mode 100644 index 0000000000..367571922a --- /dev/null +++ b/types/is-blank/is-blank-tests.ts @@ -0,0 +1,17 @@ +import isBlank = require('is-blank'); + +isBlank([]); // => true +isBlank({}); // => true +isBlank(0); // => true +isBlank(() => {}); // => true +isBlank(null); // => true +isBlank(undefined); // => true +isBlank(''); // => true +isBlank(' '); // => true +isBlank('\r\t\n '); // => true + +isBlank(['a', 'b']); // => false +isBlank({ a: 'b' }); // => false +isBlank('string'); // => false +isBlank(42); // => false +isBlank((a: number, b: number) => a + b); diff --git a/types/p-throttle/tsconfig.json b/types/is-blank/tsconfig.json similarity index 93% rename from types/p-throttle/tsconfig.json rename to types/is-blank/tsconfig.json index 81852e4d18..58f358a499 100644 --- a/types/p-throttle/tsconfig.json +++ b/types/is-blank/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "p-throttle-tests.ts" + "is-blank-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/is-blank/tslint.json b/types/is-blank/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-blank/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-natural-number/index.d.ts b/types/is-natural-number/index.d.ts new file mode 100644 index 0000000000..37f8e19a26 --- /dev/null +++ b/types/is-natural-number/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for is-natural-number 4.0 +// Project: https://github.com/shinnn/is-natural-number.js +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Options { + /** + * Setting this option true makes 0 regarded as a natural number. + */ + includeZero: boolean; +} + +/** + * Rreturns true if the first argument is one of the natural numbers. + * If not, or the argument is not a number, it returns false. + */ +declare function isNaturalNumber(number: number|string, option?: Options): boolean; + +export = isNaturalNumber; diff --git a/types/is-natural-number/is-natural-number-tests.ts b/types/is-natural-number/is-natural-number-tests.ts new file mode 100644 index 0000000000..ac0f0db8eb --- /dev/null +++ b/types/is-natural-number/is-natural-number-tests.ts @@ -0,0 +1,6 @@ +import isNaturalNumber = require("is-natural-number"); + +isNaturalNumber(5); +isNaturalNumber("5"); +isNaturalNumber(0, {includeZero: true}); +isNaturalNumber("0", {includeZero: true}); diff --git a/types/is-natural-number/tsconfig.json b/types/is-natural-number/tsconfig.json new file mode 100644 index 0000000000..0d7327abc4 --- /dev/null +++ b/types/is-natural-number/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-natural-number-tests.ts" + ] +} diff --git a/types/is-natural-number/tslint.json b/types/is-natural-number/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-natural-number/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-odd/index.d.ts b/types/is-odd/index.d.ts new file mode 100644 index 0000000000..e912f69557 --- /dev/null +++ b/types/is-odd/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for is-odd 3.0 +// Project: https://github.com/jonschlinkert/is-odd +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Return true if a given number is odd or not. + */ +declare function isOdd(value: number|string): boolean; + +export = isOdd; diff --git a/types/is-odd/is-odd-tests.ts b/types/is-odd/is-odd-tests.ts new file mode 100644 index 0000000000..0717501894 --- /dev/null +++ b/types/is-odd/is-odd-tests.ts @@ -0,0 +1,4 @@ +import isOdd = require("is-odd"); + +isOdd(5); +isOdd("5"); diff --git a/types/is-odd/tsconfig.json b/types/is-odd/tsconfig.json new file mode 100644 index 0000000000..163790caf2 --- /dev/null +++ b/types/is-odd/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-odd-tests.ts" + ] +} diff --git a/types/is-odd/tslint.json b/types/is-odd/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/is-odd/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/isotope-layout/index.d.ts b/types/isotope-layout/index.d.ts index 5662da48f7..e10c0ea7c7 100644 --- a/types/isotope-layout/index.d.ts +++ b/types/isotope-layout/index.d.ts @@ -284,6 +284,10 @@ declare global { * Get the Isotope instance from a jQuery object. Isotope instances are useful to access Isotope properties. */ data(methodName: 'isotope'): Isotope; + /** + * Filters, sorts, and lays out items. + */ + isotope(): JQuery; /** * Lays out specified items. * @param elements Array of Isotope.Items diff --git a/types/isotope-layout/isotope-layout-tests.ts b/types/isotope-layout/isotope-layout-tests.ts index d37475cefa..c39b8851db 100644 --- a/types/isotope-layout/isotope-layout-tests.ts +++ b/types/isotope-layout/isotope-layout-tests.ts @@ -81,6 +81,7 @@ $grid = $('.grid').isotope({ }); // test methods using jquery +$grid.isotope(); $grid.isotope('addItems', $('.items')); $grid.isotope('appended', $('.items')[0]); $grid.isotope('hideItemElements', [ new HTMLElement() ]); diff --git a/types/jasmine-data_driven_tests/index.d.ts b/types/jasmine-data_driven_tests/index.d.ts index 8c719de652..553987ef60 100644 --- a/types/jasmine-data_driven_tests/index.d.ts +++ b/types/jasmine-data_driven_tests/index.d.ts @@ -34,6 +34,6 @@ interface JasmineDataDrivenTest { assertion: (arg0: T, arg1: U, done: () => void) => void): void; ( description: string, - dataset: T[], + dataset: T[] | Array<[T]>, assertion: (value: T, done: () => void) => void): void; } diff --git a/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts b/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts index 6689159b58..0523a28af0 100644 --- a/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts +++ b/types/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts @@ -37,6 +37,13 @@ xall("A data driven test can be pending", } ); +all("A data set must consist of array-wrapped arrays, if test expects single array input", + [[[1, 2]], [[3, 4]], [[5, 6]]], + (numberArray: number[]) => { + expect(numberArray.length).toBe(2); + } +); + describe("A suite", () => { let a: number; diff --git a/types/jasmine-enzyme/index.d.ts b/types/jasmine-enzyme/index.d.ts index d64a73e6f6..4884aa2152 100644 --- a/types/jasmine-enzyme/index.d.ts +++ b/types/jasmine-enzyme/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/formidablelabs/enzyme-matchers/packages/jasmine-enzyme // Definitions by: Umar Bolatov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 /// /// diff --git a/types/jenkins/index.d.ts b/types/jenkins/index.d.ts index 4e1c42fa3e..1155b430b0 100644 --- a/types/jenkins/index.d.ts +++ b/types/jenkins/index.d.ts @@ -15,7 +15,7 @@ declare namespace create { log(name: string, n: number, start: number, callback: (err: Error, data: any) => void): void; log(name: string, n: number, start: number, type: 'text' | 'html', callback: (err: Error, data: any) => void): void; log(name: string, n: number, start: number, type: 'text' | 'html', meta: boolean, callback: (err: Error, data: any) => void): void; - logStream(name: string, n: number, type?: 'text' | 'html', delay?: number): NodeJS.ReadableStream; + logStream(name: string, n: number, options?: { type?: 'text' | 'html', delay?: number }): NodeJS.ReadableStream; stop(name: string, n: number, callback: (err: Error) => void): void; term(name: string, n: number, callback: (err: Error) => void): void; }; diff --git a/types/jenkins/jenkins-tests.ts b/types/jenkins/jenkins-tests.ts index 93fc61bb07..8f3ffe4555 100644 --- a/types/jenkins/jenkins-tests.ts +++ b/types/jenkins/jenkins-tests.ts @@ -34,6 +34,20 @@ log.on('end', () => { console.log('end'); }); +const log2 = jenkins.build.logStream('example', 1, { type: 'html', delay: 2 * 1000 }); + +log2.on('data', (text: string) => { + process.stdout.write(text); +}); + +log2.on('error', (err: Error) => { + console.log('error', err); +}); + +log2.on('end', () => { + console.log('end'); +}); + jenkins.build.stop('example', 1, (err) => { if (err) throw err; }); diff --git a/types/jest-environment-puppeteer/index.d.ts b/types/jest-environment-puppeteer/index.d.ts index 79c25e32d8..bcc37c8f9e 100644 --- a/types/jest-environment-puppeteer/index.d.ts +++ b/types/jest-environment-puppeteer/index.d.ts @@ -1,14 +1,43 @@ -// Type definitions for jest-environment-puppeteer 2.2 +// Type definitions for jest-environment-puppeteer 4.0 // Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer // Definitions by: Josh Goldberg +// Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { Browser, Page } from "puppeteer"; +import { Browser, Page, BrowserContext } from 'puppeteer'; + +interface JestPuppeteer { + /** + * Reset global.page + * + * ```ts + * beforeEach(async () => { + * await jestPuppeteer.resetPage() + * }) + * ``` + */ + resetPage(): Promise; + + /** + * Suspends test execution and gives you opportunity to see what's going on in the browser + * - Jest is suspended (no timeout) + * - A debugger instruction to Chromium, if Puppeteer has been launched with { devtools: true } it will stop + * + * ```ts + * it('should put test in debug mode', async () => { + * await jestPuppeteer.debug() + * }) + * ``` + */ + debug(): Promise; +} declare global { const browser: Browser; + const context: BrowserContext; const page: Page; + const jestPuppeteer: JestPuppeteer; } -export { }; +export {}; diff --git a/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts index 3de8c3661a..fb424d580b 100644 --- a/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts +++ b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts @@ -2,3 +2,7 @@ import * as puppeteer from "puppeteer"; const myBrowser: puppeteer.Browser = browser; const myPage: puppeteer.Page = page; +const myContext: puppeteer.BrowserContext = context; + +jestPuppeteer.debug(); +jestPuppeteer.resetPage(); diff --git a/types/jest-in-case/jest-in-case-tests.ts b/types/jest-in-case/jest-in-case-tests.ts index ac99bc4683..b38ccff0bc 100644 --- a/types/jest-in-case/jest-in-case-tests.ts +++ b/types/jest-in-case/jest-in-case-tests.ts @@ -13,8 +13,8 @@ function subtract(minuend: number, subtrahend: number) { beforeEach(() => { jest.spyOn(global, 'describe').mockImplementation((title, fn) => (fn as () => void)()); jest.spyOn(global, 'test').mockImplementation((name, fn) => (fn as () => void)()); - global.test.skip = jest.fn((name, fn) => fn()); - global.test.only = jest.fn((name, fn) => fn()); + global.test.skip = jest.fn((_: string, fn: jest.EmptyFunction) => fn()); + global.test.only = jest.fn((_: string, fn: jest.EmptyFunction) => fn()); }); afterEach(() => { diff --git a/types/jest-specific-snapshot/index.d.ts b/types/jest-specific-snapshot/index.d.ts index 0e0a43d895..25c168f5d2 100644 --- a/types/jest-specific-snapshot/index.d.ts +++ b/types/jest-specific-snapshot/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/igor-dv/jest-specific-snapshot#readme // Definitions by: Janeene Beeforth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 +// TypeScript Version: 3.1 /// diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index deb9c92619..da84c876af 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -121,7 +121,7 @@ declare namespace jest { /** * Creates a mock function. Optionally takes a mock implementation. */ - function fn(implementation: (...args: Y) => T): Mock; + function fn(implementation?: (...args: Y) => T): Mock; /** * Use the automatic mocking system to generate a mocked version of the given module. */ @@ -220,9 +220,10 @@ declare namespace jest { * spy.mockRestore(); * }); */ - function spyOn>(object: T, method: M, accessType: 'get'): SpyInstance; - function spyOn>(object: T, method: M, accessType: 'set'): SpyInstance; - function spyOn>(object: T, method: M): T[M] extends (...args: any[]) => any ? SpyInstance, ArgsType> : never; + function spyOn>>(object: T, method: M, accessType: 'get'): SpyInstance[M], []>; + function spyOn>>(object: T, method: M, accessType: 'set'): SpyInstance[M]]>; + function spyOn>>(object: T, method: M): Required[M] extends (...args: any[]) => any ? + SpyInstance[M]>, ArgsType[M]>> : never; /** * Indicates that the module system should never return a mocked version of * the specified module from require() (e.g. that it should always return the real module). @@ -263,10 +264,11 @@ declare namespace jest { } interface Each { - (cases: any[]): (name: string, fn: (...args: any[]) => any) => void; + (cases: any[]): (name: string, fn: (...args: any[]) => any, timeout?: number) => void; (strings: TemplateStringsArray, ...placeholders: any[]): ( name: string, - fn: (arg: any) => any + fn: (arg: any) => any, + timeout?: number ) => void; } @@ -978,20 +980,29 @@ declare namespace jest { } /** - * Represents the result of a single call to a mock function. + * Represents the result of a single call to a mock function with a return value. */ - interface MockResult { - /** - * True if the function threw. - * False if the function returned. - */ - isThrow: boolean; - /** - * The value that was either thrown or returned by the function. - */ + interface MockResultReturn { + type: 'return'; + value: T; + } + /** + * Represents the result of a single incomplete call to a mock function. + */ + interface MockResultIncomplete { + type: 'incomplete'; + value: undefined; + } + /** + * Represents the result of a single call to a mock function with a thrown error. + */ + interface MockResultThrow { + type: 'throw'; value: any; } + type MockResult = MockResultReturn | MockResultThrow | MockResultIncomplete; + interface MockContext { calls: Y[]; instances: T[]; @@ -999,7 +1010,7 @@ declare namespace jest { /** * List of results of calls to the mock function. */ - results: MockResult[]; + results: Array>; } } @@ -1616,6 +1627,7 @@ declare namespace jest { numPendingTests: number; numPendingTestSuites: number; numRuntimeErrorTestSuites: number; + numTodoTests: number; numTotalTests: number; numTotalTestSuites: number; snapshot: SnapshotSummary; diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index c643ca6a57..039d996f5c 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -308,10 +308,15 @@ const mock7 = jest.fn((arg: number) => arg); const mock8: jest.Mock = jest.fn((arg: number) => arg); // $ExpectType Mock, [number, string, {}, [], boolean]> const mock9 = jest.fn((a: number, _b: string, _c: {}, _iReallyDontCare: [], _makeItStop: boolean) => Promise.resolve(_makeItStop)); -// $ExpectType Mock -const mock10 = jest.fn((arg: never) => { throw new Error(arg); }); +// $ExpectType Mock +const mock10 = jest.fn(() => { throw new Error(); }); // $ExpectType Mock const mock11 = jest.fn((arg: unknown) => arg); +interface TestApi { + test(x: number): string; +} +// $ExpectType Mock +const mock12 = jest.fn, jest.ArgsType>(); // $ExpectType number mock1('test'); @@ -344,11 +349,15 @@ const mockContextVoid = jest.fn().mock; const mockContextString = jest.fn(() => "").mock; jest.fn().mockClear(); - jest.fn().mockReset(); - jest.fn().mockRestore(); +jest.fn().mockImplementation((test: number) => test); +jest.fn().mockResolvedValue(1); +interface SpyInterface { + prop?: number; + method?: (arg1: boolean) => void; +} const spiedTarget = { returnsVoid(): void { }, setValue(value: string): void { @@ -358,7 +367,6 @@ const spiedTarget = { return ""; } }; - class SpiedTargetClass { private _value = 3; private _value2 = ''; @@ -375,6 +383,7 @@ class SpiedTargetClass { this._value2 = value2; } } + const spiedTarget2 = new SpiedTargetClass(); // $ExpectError @@ -420,11 +429,17 @@ const spy5 = jest.spyOn(spiedTarget2, "value", "get"); spy5.mockReturnValue('5'); // $ExpectType SpyInstance -const spy6 = jest.spyOn(spiedTarget2, "value", "set"); +jest.spyOn(spiedTarget2, "value", "set"); -// should compile -jest.fn().mockImplementation((test: number) => test); -jest.fn().mockResolvedValue(1); +let spyInterfaceImpl: SpyInterface = {}; +// $ExpectError +jest.spyOn(spyInterfaceImpl, "method", "get"); +// $ExpectError +jest.spyOn(spyInterfaceImpl, "prop"); +// $ExpectType SpyInstance +jest.spyOn(spyInterfaceImpl, "prop", "get"); +// $ExpectType SpyInstance +jest.spyOn(spyInterfaceImpl, "method"); interface Type1 { a: number; } interface Type2 { b: number; } @@ -480,6 +495,19 @@ mocked.test4.mockRejectedValue(new Error()); // $ExpectError mocked.test4.mockRejectedValueOnce(new Error()); +const mockResult = jest.fn(() => 1).mock.results[0]; +switch (mockResult.type) { + case 'return': + mockResult.value; // $ExpectType number + break; + case 'incomplete': + mockResult.value; // $ExpectType undefined + break; + case 'throw': + mockResult.value; // $ExpectType any + break; +} + /* Snapshot serialization */ const snapshotSerializerPlugin: jest.SnapshotSerializerPlugin = { @@ -1342,6 +1370,14 @@ test.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])( } ); +test.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])( + ".add(%i, %i)", + (a, b, expected) => { + expect(a + b).toBe(expected); + }, + 5000 +); + test.each` a | b | expected ${1} | ${1} | ${2} @@ -1351,6 +1387,15 @@ test.each` expect(a + b).toBe(expected); }); +test.each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`("returns $expected when $a is added $b", ({ a, b, expected }: Case) => { + expect(a + b).toBe(expected); +}, 5000); + test.only.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])( ".add(%i, %i)", (a, b, expected) => { diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 4ecf403a6f..c943fbfa33 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -15,6 +15,7 @@ // Peter Thorson // Will Garcia // Simon Schick +// Alejandro Fernandez Haro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -704,7 +705,7 @@ export interface ArraySchema extends AnySchema { * `schema` - the validation rules required to satisfy the assertion. If the `schema` includes references, they are resolved against * the array item being tested, not the value of the `ref` target. */ - assertItem(schema: SchemaLike): this; + has(schema: SchemaLike): this; /** * Allow this array to be sparse. * enabled can be used with a falsy value to go back to the default behavior. diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 4dbc784756..b4f01cfe56 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -312,7 +312,7 @@ anySchema = Joi.any(); arrSchema = Joi.array(); -arrSchema = arrSchema.assertItem(Joi.any()); +arrSchema = arrSchema.has(Joi.any()); arrSchema = arrSchema.sparse(); arrSchema = arrSchema.sparse(bool); arrSchema = arrSchema.single(); diff --git a/types/jsdoc-to-markdown/index.d.ts b/types/jsdoc-to-markdown/index.d.ts new file mode 100644 index 0000000000..78b4d7d045 --- /dev/null +++ b/types/jsdoc-to-markdown/index.d.ts @@ -0,0 +1,137 @@ +// Type definitions for jsdoc-to-markdown 4.0 +// Project: https://github.com/jsdoc2md/jsdoc-to-markdown +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +export type StyleListFormat = "none" | "grouped" | "table" | "dl"; +export type RenderListFormat = "list" | "table"; +export type MemberIndexFormat = "grouped" | "list"; + +export interface RenderOptions { + /** + * Raw template data to use. Useful when you already have template data, obtained from .getTemplateData. + * Either files, source or data must be supplied. + */ + data?: object[]; + /** + * The template the supplied documentation will be rendered into. + * Use the default or supply your own template for full control over the output. + */ + template?: string; + /** + * The initial heading depth. + * For example, with a value of 2 the top-level markdown headings look like "## The heading". + */ + headingDepth?: number; + /** + * Specifies the default language used in '@example' blocks (for syntax-highlighting purposes). + * In gfm mode, each '@example' is wrapped in a fenced-code block. Example usage: --example-lang js. + * Use the special value none for no specific language. + * While using this option, you can override the supplied language + * for any '@example' by specifying the @lang subtag, + * e.g @example @lang hbs. Specifying @example @lang off will disable code blocks for that example. + */ + exampleLang?: string; + /** + * Use an installed package containing helper and/or partial overrides. + */ + plugin?: string|string[]; + /** + * handlebars helper files to override or extend the default set. + */ + helper?: string|string[]; + /** + * handlebars partial files to override or extend the default set. + */ + partial?: string|string[]; + /** + * Format identifier names in the code style, + * (i.e. format using backticks or ). + */ + nameFormat?: string; + /** + * By default, dmd generates github-flavoured markdown. + * Not all markdown parsers render gfm correctly. + * If your generated docs look incorrect on sites other than Github + * (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. + */ + noGfm?: boolean; + /** + * Put
breaks between identifiers. Improves readability on bulky docs. + */ + seperators?: boolean; + moduleIndexFormat?: StyleListFormat; + globalIndexFormat?: StyleListFormat; + /** + * Two options to render parameter lists: 'list' or 'table' (default). + * Table format works well in most cases but switch to list if things begin to look crowded / squashed. + */ + paramListFormat?: RenderListFormat; + propertyListFormat?: RenderListFormat; + memberIndexFormat?: MemberIndexFormat; +} + +export interface JsdocOptions { + /** + * By default results are cached to speed up repeat invocations. + * Set to true to disable this. + */ + noCache?: boolean; + /** + * One or more filenames to process. + * Accepts globs (e.g. *.js). Either files, source or data must be supplied. + */ + files: string|string[]; + /** + * A string containing source code to process. + * Either files, source or data must be supplied. + */ + source?: string; + /** + * The path to the jsdoc configuration file. + * Default: path/to/jsdoc/conf.json. + */ + configure?: string; +} + +export class JsdocToMarkdown { + /** + * Returns markdown documentation from jsdoc-annoted source code. + */ + render(options: RenderOptions|JsdocOptions): Promise; + /** + * Sync version of render. + */ + renderSync(options: RenderOptions|JsdocOptions): string; + /** + * Returns the template data (jsdoc-parse output) which is fed into the output template (dmd). + */ + getTemplateData(options: JsdocOptions): Promise; + /** + * Sync version of getTemplateData. + */ + getTemplateDataSync(options: JsdocOptions): object[]; + /** + * Returns raw data direct from the underlying jsdoc3. + */ + getJsdocData(options: JsdocOptions): Promise; + /** + * Sync version of getJsdocData. + */ + getJsdocDataSync(options: JsdocOptions): object[]; + /** + * By default, the output of each invocation of the main generation methods (render, getTemplateData etc) + * is stored in the cache (your system's temporary directory). + * Future jsdoc2md invocations with the same input options and source code will return the output immediately from cache, + * making the tool much faster/cheaper. If the input options or source code changes, + * fresh output will be generated. This method clears the cache, + * which you should never need to do unless the cache is failing for some reason. + * On Mac OSX, the system tmpdir clears itself every few days meaning your jsdoc2md cache will also be routinely cleared. + */ + clear(): Promise; + /** + * Returns all jsdoc namepaths found in the supplied source code. + */ + getNamepaths(options: JsdocOptions): Promise; +} diff --git a/types/jsdoc-to-markdown/jsdoc-to-markdown-tests.ts b/types/jsdoc-to-markdown/jsdoc-to-markdown-tests.ts new file mode 100644 index 0000000000..e37d899bd4 --- /dev/null +++ b/types/jsdoc-to-markdown/jsdoc-to-markdown-tests.ts @@ -0,0 +1,23 @@ +import { JsdocToMarkdown, StyleListFormat } from "jsdoc-to-markdown"; + +const jsdoc2md = new JsdocToMarkdown(); + +const JsdocDataOptions = { + files: "file.js" +}; + +const RenderOptions = { + data: [], + plugin: "", + helper: [""], + moduleIndexFormat: "table" as StyleListFormat +}; + +jsdoc2md.render(JsdocDataOptions); +jsdoc2md.renderSync(RenderOptions); +jsdoc2md.getTemplateData(JsdocDataOptions); +jsdoc2md.getTemplateDataSync(JsdocDataOptions); +jsdoc2md.getJsdocData(JsdocDataOptions); +jsdoc2md.getJsdocDataSync(JsdocDataOptions); +jsdoc2md.clear(); +jsdoc2md.getNamepaths(JsdocDataOptions); diff --git a/types/jsdoc-to-markdown/tsconfig.json b/types/jsdoc-to-markdown/tsconfig.json new file mode 100644 index 0000000000..eabb42ab3b --- /dev/null +++ b/types/jsdoc-to-markdown/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsdoc-to-markdown-tests.ts" + ] +} diff --git a/types/jsdoc-to-markdown/tslint.json b/types/jsdoc-to-markdown/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/jsdoc-to-markdown/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/jsoneditor/index.d.ts b/types/jsoneditor/index.d.ts index f095cb8434..3c74a3d789 100644 --- a/types/jsoneditor/index.d.ts +++ b/types/jsoneditor/index.d.ts @@ -1,54 +1,199 @@ -// Type definitions for jsoneditor v5.19.0 +// Type definitions for jsoneditor v5.28.2 // Project: https://github.com/josdejong/jsoneditor // Definitions by: Alejandro Sánchez // Errietta Kostala +// Adam Vigneaux // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// +import { Ajv } from "ajv"; + declare module 'jsoneditor' { - export interface JSONEditorNode { + type JSONPath = (string|number)[]; + + export interface Node { field: string; - value: string; - path: Array; + value?: string; + path: JSONPath; } export type JSONEditorMode = 'tree' | 'view' | 'form' | 'code' | 'text'; + export interface NodeName { + path: string; + type: 'object'|'array'; + size: number; + } + + export interface ValidationError { + path: JSONPath; + message: string; + } + + export interface Template { + text: string; + title: string; + className?: string; + field: string; + value: any; + } + + export type AutoCompleteCompletion = null|string[]|{startFrom: number, options: string[]}; + + export type AutoCompleteOptionsGetter = ( + text: string, path: JSONPath, input: string, editor: JSONEditor, + ) => AutoCompleteCompletion|Promise; + + export interface AutoCompleteOptions { + /** + * @default [39, 35, 9] + */ + confirmKeys?: number[]; + caseSensitive?: boolean; + getOptions?: AutoCompleteOptionsGetter; + } + + export interface SelectionPosition { + row: number; + column: number; + } + + export interface SerializableNode { + value: any; + path: JSONPath; + } + + // Based on the API of https://github.com/Sphinxxxx/vanilla-picker + export interface Color { + rgba: Array; + hsla: Array; + rgbString: string; + rgbaString: string; + hslString: string; + hslaString: string; + hex: string; + } + export interface JSONEditorOptions { ace?: AceAjax.Ace; - ajv?: any; // Any for now, since ajv typings aren't A-Ok + ajv?: Ajv; onChange?: () => void; - onEditable?: (node: JSONEditorNode) => boolean | {field: boolean, value: boolean}; + onChangeJSON?: (json: any) => void; + onChangeText?: (jsonString: string) => void; + onEditable?: (node: Node) => boolean|{field: boolean, value: boolean}; onError?: (error: Error) => void; onModeChange?: (newMode: JSONEditorMode, oldMode: JSONEditorMode) => void; + onNodeName?: (nodeName: NodeName) => string|undefined; + onValidate?: (json: any) => ValidationError[]|Promise; + /** + * @default false + */ escapeUnicode?: boolean; + /** + * @default false + */ sortObjectKeys?: boolean; + /** + * @default true + */ history?: boolean; + /** + * @default 'tree' + */ mode?: JSONEditorMode; - modes?: Array; + modes?: JSONEditorMode[]; + /** + * @default undefined + */ name?: string; - schema?: Object; - schemaRefs?: Object; + schema?: object; + schemaRefs?: object; + /** + * @default true + */ search?: boolean; + /** + * @default 2 + */ indentation?: number; theme?: string; + templates?: Template[]; + autocomplete?: AutoCompleteOptions; + /** + * @default true + */ + mainMenuBar?: boolean; + /** + * @default true + */ + navigationBar?: boolean; + /** + * @default true + */ + statusBar?: boolean; + onTextSelectionChange?: (start: SelectionPosition, end: SelectionPosition, text: string) => void; + onSelectionChange?: (start: SerializableNode, end: SerializableNode) => void; + onEvent?: (node: Node, event: string) => void; + /** + * @default true + */ + colorPicker?: boolean; + onColorPicker?: (parent: HTMLElement, color: string, onChange: (color: Color) => void) => void; + /** + * @default true + */ + timestampTag?: boolean; + language?: string; + languages?: { + [lang: string]: { + [key: string]: string; + }; + }; + modalAnchor?: HTMLElement; + /** + * @default true + */ + enableSort?: boolean; + /** + * @default true + */ + enableTransform?: boolean; + /** + * @default 100 + */ + maxVisibleChilds?: number; + } export default class JSONEditor { - constructor(container: HTMLElement, options?: JSONEditorOptions, json?: Object); + constructor(container: HTMLElement, options?: JSONEditorOptions, json?: any); collapseAll(): void; destroy(): void; expandAll(): void; focus(): void; - set(json: Object): void; - setMode(mode: JSONEditorMode): void; - setName(name?: string): void; - setSchema(schema: Object): void; - setText(jsonString: string): void; get(): any; getMode(): JSONEditorMode; - getName(): string; + getName(): string|undefined; + getNodesByRange(start: {path: JSONPath}, end: {path: JSONPath}): Array; + getSelection(): {start: SerializableNode, end: SerializableNode}; getText(): string; + getTextSelection(): {start: SelectionPosition, end: SelectionPosition, text: string}; + refresh(): void; + set(json: any): void; + setMode(mode: JSONEditorMode): void; + setName(name?: string): void; + setSchema(schema: object, schemaRefs?: object): void; + setSelection(start: {path: JSONPath}, end: {path: JSONPath}): void; + setText(jsonString: string): void; + setTextSelection(start: SelectionPosition, end: SelectionPosition): void; + update(json: any): void; + updateText(jsonString: string): void; + + static VALID_OPTIONS: Array; + static ace: AceAjax.Ace; + static Ajv: Ajv; + static VanillaPicker: any; } } diff --git a/types/jsoneditor/jsoneditor-tests.ts b/types/jsoneditor/jsoneditor-tests.ts index d905e6ba76..b584a14416 100644 --- a/types/jsoneditor/jsoneditor-tests.ts +++ b/types/jsoneditor/jsoneditor-tests.ts @@ -1,11 +1,13 @@ -import JSONEditor, {JSONEditorMode, JSONEditorNode, JSONEditorOptions } from 'jsoneditor'; +import * as Ajv from 'ajv'; +import JSONEditor, {JSONEditorMode, Node, JSONEditorOptions } from 'jsoneditor'; let options: JSONEditorOptions; +options = {}; options = { ace: ace, - //ajv: Ajv({allErrors: true, verbose: true}) + ajv: new Ajv({allErrors: true, verbose: true}), onChange() {}, - onEditable(node: JSONEditorNode) { + onEditable(node: Node) { return true; }, onError(error: Error) {}, @@ -23,7 +25,7 @@ options = { theme: 'default' }; options = { - onEditable(node: JSONEditorNode) { + onEditable(node: Node) { return {field: true, value: false}; } }; diff --git a/types/terser/package.json b/types/jsoneditor/package.json similarity index 67% rename from types/terser/package.json rename to types/jsoneditor/package.json index 25c65e7595..b47ef67b0a 100644 --- a/types/terser/package.json +++ b/types/jsoneditor/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "source-map": "*" + "ajv": "*" } } diff --git a/types/klaw/index.d.ts b/types/klaw/index.d.ts index 7b4e586842..32810990d5 100644 --- a/types/klaw/index.d.ts +++ b/types/klaw/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for klaw v2.1.1 +// Type definitions for klaw v3.0.0 // Project: https://github.com/jprichardson/node-klaw // Definitions by: Matthew McEachen +// Pascal Sthamer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -26,6 +27,7 @@ declare module "klaw" { fs?: any // fs or mock-fs filter?: (path: string) => boolean depthLimit?: number + preserveSymlinks?: boolean } type Event = "close" | "data" | "end" | "readable" | "error" diff --git a/types/klaw/klaw-tests.ts b/types/klaw/klaw-tests.ts index 69406f73e8..baecd656f3 100644 --- a/types/klaw/klaw-tests.ts +++ b/types/klaw/klaw-tests.ts @@ -5,7 +5,7 @@ const path = require('path'); let items: klaw.Item[] = [] // files, directories, symlinks, etc -klaw('/some/dir') +klaw('/some/dir', { preserveSymlinks: false }) .on('data', function(item: klaw.Item) { items.push(item) }) diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 8b173c0887..ac0000ad9a 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -1111,6 +1111,7 @@ knex('users') // // Migrations // +const name = "test"; const config = { directory: "./migrations", extension: "js", diff --git a/types/knockback/index.d.ts b/types/knockback/index.d.ts index 68b9dc9e0b..59f3e3fa93 100644 --- a/types/knockback/index.d.ts +++ b/types/knockback/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Knockback.js -// Project: http://kmalakoff.github.io/knockback/ +// Project: http://kmalakoff.github.com/knockback // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 8bf99b79db..39eb527c2e 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -12,13 +12,30 @@ // TypeScript Version: 2.3 interface KnockoutSubscribableFunctions { - notifySubscribers(valueToWrite?: T, event?: string): void; + /** + * Notify subscribers of knockout "change" event. This doesn't acctually change the observable value. + * @param eventValue A value to be sent with the event. + * @param event The knockout event. + */ + notifySubscribers(eventValue?: T, event?: "change"): void; + /** + * Notify subscribers of a knockout or user defined event. + * @param eventValue A value to be sent with the event. + * @param event The knockout or user defined event name. + */ + notifySubscribers(eventValue: U, event: string): void; } interface KnockoutComputedFunctions { } interface KnockoutObservableFunctions { + /** + * Used by knockout to decide if value of observable has changed and should notify subscribers. Returns true if instances are primitives, and false if are objects. + * If your observable holds an object, this can be overwritten to return equality based on your needs. + * @param a previous value. + * @param b next value. + */ equalityComparer(a: T, b: T): boolean; } @@ -57,7 +74,7 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable pop(): T; /** * Adds a new item to the end of array. - * @param items Items to be added + * @param items Items to be added. */ push(...items: T[]): void; /** @@ -66,7 +83,7 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable shift(): T; /** * Inserts a new item at the beginning of the array. - * @param items Items to be added + * @param items Items to be added. */ unshift(...items: T[]): number; /** @@ -85,24 +102,24 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable // Ko specific /** - * Replaces the first value that equals oldItem with newItem - * @param oldItem Item to be replaced - * @param newItem Replacing item + * Replaces the first value that equals oldItem with newItem. + * @param oldItem Item to be replaced. + * @param newItem Replacing item. */ replace(oldItem: T, newItem: T): void; /** * Removes all values that equal item and returns them as an array. - * @param item The item to be removed + * @param item The item to be removed. */ remove(item: T): T[]; /** * Removes all values and returns them as an array. - * @param removeFunction A function used to determine true if item should be removed and fasle otherwise + * @param removeFunction A function used to determine true if item should be removed and fasle otherwise. */ remove(removeFunction: (item: T) => boolean): T[]; /** - * Removes all values that equal any of the supplied items - * @param items Items to be removed + * Removes all values that equal any of the supplied items. + * @param items Items to be removed. */ removeAll(items: T[]): T[]; /** @@ -140,45 +157,45 @@ interface KnockoutSubscribableStatic { interface KnockoutSubscription { /** - * Terminates a subscription + * Terminates a subscription. */ dispose(): void; } interface KnockoutSubscribable extends KnockoutSubscribableFunctions { /** - * Registers to be notified after the observable's value changes - * @param callback Function that is called whenever the notification happens - * @param target Defines the value of 'this' in the callback function - * @param event The name of the event to receive notification for + * Registers to be notified after the observable's value changes. + * @param callback Function that is called whenever the notification happens. + * @param target Defines the value of 'this' in the callback function. + * @param event The knockout event name. */ subscribe(callback: (newValue: T) => void, target?: any, event?: "change"): KnockoutSubscription; /** - * Registers to be notified before the observable's value changes - * @param callback Function that is called whenever the notification happens - * @param target Defines the value of 'this' in the callback function - * @param event The name of the event to receive notification for + * Registers to be notified before the observable's value changes. + * @param callback Function that is called whenever the notification happens. + * @param target Defines the value of 'this' in the callback function. + * @param event The knockout event name. */ subscribe(callback: (newValue: T) => void, target: any, event: "beforeChange"): KnockoutSubscription; /** - * Registers to be notified when the observable's value changes - * @param callback Function that is called whenever the notification happens - * @param target Defines the value of 'this' in the callback function - * @param event The name of the event to receive notification for + * Registers to be notified when a knockout or user defined event happens. + * @param callback Function that is called whenever the notification happens. eventValue can be anything. No relation to underlying observable. + * @param target Defines the value of 'this' in the callback function. + * @param event The knockout or user defined event name. */ - subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription; + subscribe(callback: (eventValue: U) => void, target: any, event: string): KnockoutSubscription; /** - * Customizes observables basic functionality + * Customizes observables basic functionality. * @param requestedExtenders Name of the extender feature and its value, e.g. { notify: 'always' }, { rateLimit: 50 } */ extend(requestedExtenders: { [key: string]: any; }): KnockoutSubscribable; /** - * Gets total number of subscribers + * Gets total number of subscribers. */ getSubscriptionsCount(): number; /** - * Gets number of subscribers of a particular event - * @param event Event name + * Gets number of subscribers of a particular event. + * @param event Event name. */ getSubscriptionsCount(event: string): number; } @@ -187,26 +204,32 @@ interface KnockoutComputedStatic { fn: KnockoutComputedFunctions; /** - * Creates computed observable + * Creates computed observable. */ (): KnockoutComputed; /** - * Creates computed observable - * @param evaluatorFunction Function that computes the observable value - * @param context Defines the value of 'this' when evaluating the computed observable - * @param options An object with further properties for the computed observable + * Creates computed observable. + * @param evaluatorFunction Function that computes the observable value. + * @param context Defines the value of 'this' when evaluating the computed observable. + * @param options An object with further properties for the computed observable. */ (evaluatorFunction: () => T, context?: any, options?: KnockoutComputedOptions): KnockoutComputed; /** - * Creates computed observable - * @param options An object that defines the computed observable options and behavior - * @param context Defines the value of 'this' when evaluating the computed observable + * Creates computed observable. + * @param options An object that defines the computed observable options and behavior. + * @param context Defines the value of 'this' when evaluating the computed observable. */ (options: KnockoutComputedDefine, context?: any): KnockoutComputed; } interface KnockoutReadonlyComputed extends KnockoutReadonlyObservable { + /** + * Returns whether the computed observable may be updated in the future. A computed observable is inactive if it has no dependencies. + */ isActive(): boolean; + /** + * Returns the current number of dependencies of the computed observable. + */ getDependenciesCount(): number; } @@ -220,15 +243,7 @@ interface KnockoutComputed extends KnockoutReadonlyComputed, KnockoutObser */ dispose(): void; /** - * Returns whether the computed observable may be updated in the future. A computed observable is inactive if it has no dependencies. - */ - isActive(): boolean; - /** - * Returns the current number of dependencies of the computed observable. - */ - getDependenciesCount(): number; - /** - * Customizes observables basic functionality + * Customizes observables basic functionality. * @param requestedExtenders Name of the extender feature and it's value, e.g. { notify: 'always' }, { rateLimit: 50 } */ extend(requestedExtenders: { [key: string]: any; }): KnockoutComputed; @@ -249,19 +264,19 @@ interface KnockoutReadonlyObservableArray extends KnockoutReadonlyObservable< subscribe(callback: (newValue: KnockoutArrayChange[]) => void, target: any, event: "arrayChange"): KnockoutSubscription; subscribe(callback: (newValue: T[]) => void, target: any, event: "beforeChange"): KnockoutSubscription; subscribe(callback: (newValue: T[]) => void, target?: any, event?: "change"): KnockoutSubscription; - subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription; + subscribe(callback: (newValue: U) => void, target: any, event: string): KnockoutSubscription; } /* - NOTE: In theory this should extend both Observable and ReadonlyObservableArray, + NOTE: In theory this should extend both KnockoutObservable and KnockoutReadonlyObservableArray, but can't since they both provide conflicting typings of .subscribe. - So it extends Observable and duplicates the subscribe definitions, which should be kept in sync + So it extends KnockoutObservable and duplicates the subscribe definitions, which should be kept in sync */ interface KnockoutObservableArray extends KnockoutObservable, KnockoutObservableArrayFunctions { subscribe(callback: (newValue: KnockoutArrayChange[]) => void, target: any, event: "arrayChange"): KnockoutSubscription; subscribe(callback: (newValue: T[]) => void, target: any, event: "beforeChange"): KnockoutSubscription; subscribe(callback: (newValue: T[]) => void, target?: any, event?: "change"): KnockoutSubscription; - subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription; + subscribe(callback: (newValue: U) => void, target: any, event: string): KnockoutSubscription; extend(requestedExtenders: { [key: string]: any; }): KnockoutObservableArray; } @@ -281,9 +296,8 @@ interface KnockoutObservableStatic { interface KnockoutReadonlyObservable extends KnockoutSubscribable, KnockoutObservableFunctions { (): T; - /** - * Returns the current value of the computed observable without creating a dependency + * Returns the current value of the computed observable without creating a dependency. */ peek(): T; valueHasMutated?: { (): void; }; @@ -294,6 +308,10 @@ interface KnockoutObservable extends KnockoutReadonlyObservable { (value: T): void; // Since .extend does arbitrary thing to an observable, it's not safe to do on a readonly observable + /** + * Customizes observables basic functionality. + * @param requestedExtenders Name of the extender feature and it's value, e.g. { notify: 'always' }, { rateLimit: 50 } + */ extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable; } @@ -301,7 +319,7 @@ interface KnockoutComputedOptions { /** * Makes the computed observable writable. This is a function that receives values that other code is trying to write to your computed observable. * It’s up to you to supply custom logic to handle the incoming values, typically by writing the values to some underlying observable(s). - * @param value + * @param value Value being written to the computer observable. */ write?(value: T): void; /** @@ -347,8 +365,19 @@ interface KnockoutBindingContext { $component: any; $componentTemplateNodes: Node[]; - extend(properties: any): any; - createChildContext(dataItemOrAccessor: any, dataItemAlias?: any, extendCallback?: Function): any; + /** + * Clones the current Binding Context, adding extra properties to it. + * @param properties object with properties to be added in the binding context. + */ + extend(properties: { [key: string]: any; } | (() => { [key: string]: any; })): KnockoutBindingContext; + /** + * This returns a new binding context whose viewmodel is the first parameter and whose $parentContext is the current bindingContext. + * @param dataItemOrAccessor The binding context of the children. + * @param dataItemAlias An alias for the data item in descendant contexts. + * @param extendCallback Function to be called. + * @param options Further options. + */ + createChildContext(dataItemOrAccessor: any, dataItemAlias?: string, extendCallback?: Function, options?: { "exportDependencies": boolean }): any; } interface KnockoutAllBindingsAccessor { @@ -405,7 +434,7 @@ interface KnockoutBindingHandlers { } interface KnockoutMemoization { - memoize(callback: () => string): string; + memoize(callback: Function): string; unmemoize(memoId: string, callbackParams: any[]): boolean; unmemoizeDomNodeAndDescendants(domNode: any, extraCallbackParamsArray: any[]): boolean; parseMemoText(memoText: string): string; @@ -640,63 +669,100 @@ interface KnockoutStatic { computed: KnockoutComputedStatic; /** - * Creates a pure computed observable - * @param evaluatorFunction Function that computes the observable value - * @param context Defines the value of 'this' when evaluating the computed observable + * Creates a pure computed observable. + * @param evaluatorFunction Function that computes the observable value. + * @param context Defines the value of 'this' when evaluating the computed observable. */ pureComputed(evaluatorFunction: () => T, context?: any): KnockoutComputed; /** - * Creates a pure computed observable - * @param options An object that defines the computed observable options and behavior - * @param context Defines the value of 'this' when evaluating the computed observable + * Creates a pure computed observable. + * @param options An object that defines the computed observable options and behavior. + * @param context Defines the value of 'this' when evaluating the computed observable. */ pureComputed(options: KnockoutComputedDefine, context?: any): KnockoutComputed; observableArray: KnockoutObservableArrayStatic; - contextFor(node: any): any; + /** + * Evaluates if instance is a KnockoutSubscribable. + * @param instance Instance to be evaluated. + */ isSubscribable(instance: any): instance is KnockoutSubscribable; - toJSON(viewModel: any, replacer?: Function, space?: any): string; - + /** + * Clones object substituting each observable for it's underlying value. Uses browser JSON.stringify internally to stringify the result. + * @param viewModel Object with observables to be converted. + * @param replacer A Function or array of names that alters the behavior of the stringification process. + * @param space Used to insert white space into the output JSON string for readability purposes. + */ + toJSON(viewModel: any, replacer?: Function | [string | number], space?: string | number): string; + /** + * Clones object substituting for each observable the current value of that observable. + * @param viewModel Object with observables to be converted. + */ toJS(viewModel: any): any; /** * Determine if argument is an observable. Returns true for observables, observable arrays, and all computed observables. - * @param instance Object to be checked + * @param instance Object to be checked. */ isObservable(instance: any): instance is KnockoutObservable; /** * Determine if argument is an observable. Returns true for observables, observable arrays, and all computed observables. - * @param instance Object to be checked + * @param instance Object to be checked. */ isObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; /** * Determine if argument is a writable observable. Returns true for observables, observable arrays, and writable computed observables. - * @param instance Object to be checked + * @param instance Object to be checked. */ isWriteableObservable(instance: any): instance is KnockoutObservable; /** * Determine if argument is a writable observable. Returns true for observables, observable arrays, and writable computed observables. - * @param instance Object to be checked + * @param instance Object to be checked. */ isWriteableObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; /** - * Determine if argument is a computed observable - * @param instance Object to be checked + * Determine if argument is a computed observable. + * @param instance Object to be checked. */ isComputed(instance: any): instance is KnockoutComputed; /** - * Determine if argument is a computed observable - * @param instance Object to be checked + * Determine if argument is a computed observable. + * @param instance Object to be checked. */ isComputed(instance: KnockoutObservable | T): instance is KnockoutComputed; - dataFor(node: any): any; + /** + * Returns the data that was available for binding against the element. + * @param node Html node that contains the binding context. + */ + dataFor(node: Node): any; + /** + * Returns the entire binding context that was available to the DOM element. + * @param node Html node that contains the binding context. + */ + contextFor(node: Node): any; + /** + * Removes a node from the DOM. + * @param node Node to be removed. + */ removeNode(node: Node): void; + /** + * Used internally by Knockout to clean up data/computeds that it created related to the element. It does not remove any event handlers added by bindings. + * @param node Node to be cleaned. + */ cleanNode(node: Node): Node; renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any): any; renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any): any; - unwrap(value: KnockoutObservable | T): T; - unwrap(value: KnockoutObservableArray | T[]): T[]; + /** + * Returns the underlying value of the Knockout Observable or in case of plain js object, return the object. Use this to easily accept both observable and plain values. + * @param instance observable to be unwraped if it's an Observable. + */ + unwrap(instance: KnockoutObservable | T): T; + /** + * Gets the array inside the KnockoutObservableArray. + * @param instance observable to be unwraped. + */ + unwrap(instance: KnockoutObservableArray | T[]): T[]; /** * Get information about the current computed property during the execution of a computed observable’s evaluator function. @@ -783,10 +849,10 @@ interface KnockoutStatic { renderTemplateForEach(template: any, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; /** - * Executes a callback function inside a computed observable, without creating a dependecy between it and the observables inside the function + * Executes a callback function inside a computed observable, without creating a dependecy between it and the observables inside the function. * @param callback Function to be called. - * @param callbackTarget Defines the value of 'this' in the callback function - * @param callbackArgs Arguments for the callback Function + * @param callbackTarget Defines the value of 'this' in the callback function. + * @param callbackArgs Arguments for the callback Function. */ ignoreDependencies(callback: () => T, callbackTarget?: any, callbackArgs?: any): T; @@ -924,9 +990,25 @@ declare namespace KnockoutComponentTypes { } interface Loader { + /** + * Define this if: you want to supply configurations programmatically based on names, e.g., to implement a naming convention. + * @see {@link https://knockoutjs.com/documentation/component-loaders.html} + */ getConfig?(componentName: string, callback: (result: ComponentConfig | null) => void): void; + /** + * Define this if: you want to take control over how component configurations are interpreted, e.g., if you do not want to use the standard 'viewModel/template' pair format. + * @see {@link https://knockoutjs.com/documentation/component-loaders.html} + */ loadComponent?(componentName: string, config: ComponentConfig, callback: (result: Definition | null) => void): void; + /** + * Define this if: you want to use custom logic to supply DOM nodes for a given template configuration (e.g., using an ajax request to fetch a template by URL). + * @see {@link https://knockoutjs.com/documentation/component-loaders.html} + */ loadTemplate?(componentName: string, templateConfig: any, callback: (result: Node[] | null) => void): void; + /** + * Define this if: you want to use custom logic to supply a viewmodel factory for a given viewmodel configuration (e.g., integrating with a third-party module loader or dependency injection system). + * @see {@link https://knockoutjs.com/documentation/component-loaders.html} + */ loadViewModel?(componentName: string, viewModelConfig: any, callback: (result: any) => void): void; suppressLoaderExceptions?: boolean; } @@ -941,7 +1023,7 @@ interface KnockoutComponents { /** * Registers a component, in the default component loader, to be used by name in the component binding. - * @param componentName Component name. + * @param componentName Component name. Will be used for your custom HTML tag name. * @param config Component configuration. */ register(componentName: string, config: KnockoutComponentTypes.Config | KnockoutComponentTypes.EmptyConfig): void; @@ -956,7 +1038,7 @@ interface KnockoutComponents { */ unregister(componentName: string): void; /** - * Searchs each registered component loader by component name, and returns the viewmodel/template declaration via callback parameter + * Searchs each registered component loader by component name, and returns the viewmodel/template declaration via callback parameter. * @param componentName Component name. * @param callback Function to be called with the viewmodel/template declaration parameter. */ @@ -968,6 +1050,10 @@ interface KnockoutComponents { clearCachedDefinition(componentName: string): void defaultLoader: KnockoutComponentTypes.Loader; loaders: KnockoutComponentTypes.Loader[]; + /** + * Returns the registered component name for a HTML element. Can be overwriten to to control dynamically which HTML element map to which component name. + * @param node html element that corresponds to a custom component. + */ getComponentNameForNode(node: Node): string; } diff --git a/types/koa-bouncer/index.d.ts b/types/koa-bouncer/index.d.ts index af3a8b6693..91b4973893 100644 --- a/types/koa-bouncer/index.d.ts +++ b/types/koa-bouncer/index.d.ts @@ -30,10 +30,10 @@ declare namespace KoaBouncer { isNotIn(arr: any[], tip?: string): Validator isArray(tip?: string): Validator eq(otherVal: string, tip?: string): Validator - gt(otherVal: string, tip?: string): Validator - gte(otherVal: string, tip?: string): Validator - lt(otherVal: string, tip?: string): Validator - lte(otherVal: string, tip?: string): Validator + gt(otherVal: number, tip?: string): Validator + gte(otherVal: number, tip?: string): Validator + lt(otherVal: number, tip?: string): Validator + lte(otherVal: number, tip?: string): Validator isLength(min: number, max: number, tip?: string): Validator defaultTo(valueOrFunction: any): Validator isString(tip?: string): Validator diff --git a/types/koa-bouncer/koa-bouncer-tests.ts b/types/koa-bouncer/koa-bouncer-tests.ts index 0f91658a85..05f84e1b21 100644 --- a/types/koa-bouncer/koa-bouncer-tests.ts +++ b/types/koa-bouncer/koa-bouncer-tests.ts @@ -29,6 +29,9 @@ router.post('/users', async (ctx) => { .isString() .eq(ctx.vals.password1, 'Passwords must match') + ctx.validateBody('age') + .gte(18, 'Must be 18 or older') + console.log(ctx.vals) }) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index 4df53d0e8b..823cc48059 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -193,6 +193,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + get( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + get( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP post method @@ -206,6 +217,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + post( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + post( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP put method @@ -219,6 +241,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + put( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + put( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP link method @@ -232,6 +265,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + link( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + link( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP unlink method @@ -245,6 +289,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + unlink( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + unlink( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP delete method @@ -258,6 +313,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + delete( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + delete( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * Alias for `router.delete()` because delete is a reserved word @@ -271,6 +337,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + del( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + del( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP head method @@ -284,6 +361,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + head( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + head( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP options method @@ -297,6 +385,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + options( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + options( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * HTTP path method @@ -310,6 +409,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + patch( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + patch( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * Register route with all methods. @@ -323,6 +433,17 @@ declare class Router { path: string | RegExp | (string | RegExp)[], ...middleware: Array> ): Router; + all( + name: string, + path: string | RegExp, + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; + all( + path: string | RegExp | (string | RegExp)[], + middleware: Koa.Middleware, + routeHandler: Router.IMiddleware + ): Router; /** * Set the path prefix for a Router instance that was already initialized. diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index 96fa0d1751..1759504f7b 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -125,3 +125,66 @@ app2.use((ctx: Context, next: any) => { }); app2.listen(8000); + +// Prepending middlewares tests + +type IBlah = { blah: string; } +type IWooh = { wooh: string; } + +const router4 = new Router({prefix: "/users"}); + +router4.get('/', + (ctx: Koa.ParameterizedContext, next) => { + ctx.state.blah = "blah"; + ctx.state.wooh = "wooh"; + return next(); + }, + (ctx, next) => { + console.log(ctx.state.blah); + console.log(ctx.state.wooh); + console.log(ctx.state.foo); + ctx.body = 'Hello World!'; + return next(); + }) + +const middleware1: Koa.Middleware = (ctx, next) => { + ctx.state.blah = "blah"; +} + +const middleware2: Koa.Middleware = (ctx, next) => { + ctx.state.wooh = "blah"; +} + +const emptyMiddleware: Koa.Middleware<{}> = (ctx, next) => { +} + +function routeHandler1(ctx: Koa.ParameterizedContext): void { + ctx.body = "234"; +} + +function routeHandler2(ctx: Koa.ParameterizedContext): void { + ctx.body = "234"; +} + +function routeHandler3(ctx: Koa.ParameterizedContext<{}>): void { + ctx.body = "234"; +} + +function routeHandler4(ctx: Router.RouterContext): void { + ctx.body = "234"; +} + +const middleware3 = compose([middleware1, middleware2]); + +router4.get('/foo', middleware3, routeHandler1); +router4.post('/foo', middleware1, routeHandler2); +router4.put('/foo', middleware2, routeHandler3); + +router4.patch("foo", '/foo', middleware3, routeHandler1); +router4.delete('/foo', middleware1, routeHandler2); +router4.head('/foo', middleware2, routeHandler3); + +router4.post('/foo', emptyMiddleware, emptyMiddleware, routeHandler4); +router4.post('/foo', emptyMiddleware, emptyMiddleware, emptyMiddleware, routeHandler4); +router4.get('name', '/foo', emptyMiddleware, emptyMiddleware, routeHandler4); +router4.get('name', '/foo', emptyMiddleware, emptyMiddleware, emptyMiddleware, routeHandler4); \ No newline at end of file diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index f99f76817d..708b8af387 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -626,7 +626,7 @@ export interface PathOptions extends InteractiveLayerOptions { opacity?: number; lineCap?: LineCapShape; lineJoin?: LineJoinShape; - dashArray?: string; + dashArray?: string | number[]; dashOffset?: string; fill?: boolean; fillColor?: string; @@ -1134,14 +1134,15 @@ export interface PopupOptions extends DivOverlayOptions { maxWidth?: number; minWidth?: number; maxHeight?: number; + keepInView?: boolean; + closeButton?: boolean; autoPan?: boolean; autoPanPaddingTopLeft?: PointExpression; autoPanPaddingBottomRight?: PointExpression; autoPanPadding?: PointExpression; - keepInView?: boolean; - closeButton?: boolean; autoClose?: boolean; closeOnClick?: boolean; + closeOnEscapeKey?: boolean; } export type Content = string | HTMLElement; @@ -1534,6 +1535,9 @@ export interface MarkerOptions extends InteractiveLayerOptions { opacity?: number; riseOnHover?: boolean; riseOffset?: number; + autoPan?: boolean; + autoPanSpeed?: number; + autoPanPadding?: PointExpression; } export class Marker

extends Layer { diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index 2e0f139e9d..99ac56dd7f 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -506,7 +506,10 @@ export class MyNewControl extends L.Control { L.marker([1, 2], { icon: L.icon({ iconUrl: 'my-icon.png' - }) + }), + autoPan: true, + autoPanPadding: [10, 20], + autoPanSpeed: 5, }).bindPopup('

Hi

'); L.marker([1, 2], { diff --git a/types/lru-cache/index.d.ts b/types/lru-cache/index.d.ts index ed40619b11..2e5e8f562d 100644 --- a/types/lru-cache/index.d.ts +++ b/types/lru-cache/index.d.ts @@ -1,23 +1,127 @@ -// Type definitions for lru-cache 4.1 +// Type definitions for lru-cache 5.1 // Project: https://github.com/isaacs/node-lru-cache // Definitions by: Bart van der Schoor // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -export = LRU; +declare class LRUCache { + constructor(options?: LRUCache.Options); + constructor(max: number); -declare const LRU: LRU; + /** + * Return total length of objects in cache taking into account `length` options function. + */ + readonly length: number; -interface LRU { - (opts?: LRU.Options): LRU.Cache; - (max: number): LRU.Cache; - new (opts?: LRU.Options): LRU.Cache; - new (max: number): LRU.Cache; + /** + * Return total quantity of objects currently in cache. Note, + * that `stale` (see options) items are returned as part of this item count. + */ + readonly itemCount: number; + + /** + * Same as Options.allowStale. + */ + allowStale: boolean; + + /** + * Same as Options.length. + */ + lengthCalculator(value: V): number; + + /** + * Same as Options.max. Resizes the cache when the `max` changes. + */ + max: number; + + /** + * Same as Options.maxAge. Resizes the cache when the `maxAge` changes. + */ + maxAge: number; + + /** + * Will update the "recently used"-ness of the key. They do what you think. + * `maxAge` is optional and overrides the cache `maxAge` option if provided. + */ + set(key: K, value: V, maxAge?: number): boolean; + + /** + * Will update the "recently used"-ness of the key. They do what you think. + * `maxAge` is optional and overrides the cache `maxAge` option if provided. + * + * If the key is not found, will return `undefined`. + */ + get(key: K): V | undefined; + + /** + * Returns the key value (or `undefined` if not found) without updating + * the "recently used"-ness of the key. + * + * (If you find yourself using this a lot, you might be using the wrong + * sort of data structure, but there are some use cases where it's handy.) + */ + peek(key: K): V | undefined; + + /** + * Check if a key is in the cache, without updating the recent-ness + * or deleting it for being stale. + */ + has(key: K): boolean; + + /** + * Deletes a key out of the cache. + */ + del(key: K): void; + + /** + * Clear the cache entirely, throwing away all values. + */ + reset(): void; + + /** + * Manually iterates over the entire cache proactively pruning old entries. + */ + prune(): void; + + /** + * Just like `Array.prototype.forEach`. Iterates over all the keys in the cache, + * in order of recent-ness. (Ie, more recently used items are iterated over first.) + */ + forEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void; + + /** + * The same as `cache.forEach(...)` but items are iterated over in reverse order. + * (ie, less recently used items are iterated over first.) + */ + rforEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void; + + /** + * Return an array of the keys in the cache. + */ + keys(): K[]; + + /** + * Return an array of the values in the cache. + */ + values(): V[]; + + /** + * Return an array of the cache entries ready for serialization and usage with `destinationCache.load(arr)`. + */ + dump(): Array>; + + /** + * Loads another cache entries array, obtained with `sourceCache.dump()`, + * into the cache. The destination cache is reset before loading new entries + * + * @param cacheEntries Obtained from `sourceCache.dump()` + */ + load(cacheEntries: ReadonlyArray>): void; } -declare namespace LRU { - interface Options { +declare namespace LRUCache { + interface Options { /** * The maximum size of the cache, checked by applying the length * function to all values in the cache. Not setting this is kind of silly, @@ -69,123 +173,21 @@ declare namespace LRU { * not when it is overwritten. */ noDisposeOnSet?: boolean; + + /** + * When using time-expiring entries with `maxAge`, setting this to `true` will make each + * item's effective time update to the current time whenever it is retrieved from cache, + * causing it to not expire. (It can still fall out of cache based on recency of use, of + * course.) + */ + updateAgeOnGet?: boolean; } - interface Cache { - /** - * Return total length of objects in cache taking into account `length` options function. - */ - readonly length: number; - - /** - * Return total quantity of objects currently in cache. Note, - * that `stale` (see options) items are returned as part of this item count. - */ - readonly itemCount: number; - - /** - * Same as Options.allowStale. - */ - allowStale: boolean; - - /** - * Same as Options.length. - */ - lengthCalculator(value: V): number; - - /** - * Same as Options.max. Resizes the cache when the `max` changes. - */ - max: number; - - /** - * Same as Options.maxAge. Resizes the cache when the `maxAge` changes. - */ - maxAge: number; - - /** - * Will update the "recently used"-ness of the key. They do what you think. - * `maxAge` is optional and overrides the cache `maxAge` option if provided. - */ - set(key: K, value: V, maxAge?: number): boolean; - - /** - * Will update the "recently used"-ness of the key. They do what you think. - * `maxAge` is optional and overrides the cache `maxAge` option if provided. - * - * If the key is not found, will return `undefined`. - */ - get(key: K): V | undefined; - - /** - * Returns the key value (or `undefined` if not found) without updating - * the "recently used"-ness of the key. - * - * (If you find yourself using this a lot, you might be using the wrong - * sort of data structure, but there are some use cases where it's handy.) - */ - peek(key: K): V | undefined; - - /** - * Check if a key is in the cache, without updating the recent-ness - * or deleting it for being stale. - */ - has(key: K): boolean; - - /** - * Deletes a key out of the cache. - */ - del(key: K): void; - - /** - * Clear the cache entirely, throwing away all values. - */ - reset(): void; - - /** - * Manually iterates over the entire cache proactively pruning old entries. - */ - prune(): void; - - /** - * Just like `Array.prototype.forEach`. Iterates over all the keys in the cache, - * in order of recent-ness. (Ie, more recently used items are iterated over first.) - */ - forEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void; - - /** - * The same as `cache.forEach(...)` but items are iterated over in reverse order. - * (ie, less recently used items are iterated over first.) - */ - rforEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void; - - /** - * Return an array of the keys in the cache. - */ - keys(): K[]; - - /** - * Return an array of the values in the cache. - */ - values(): V[]; - - /** - * Return an array of the cache entries ready for serialization and usage with `destinationCache.load(arr)`. - */ - dump(): Array>; - - /** - * Loads another cache entries array, obtained with `sourceCache.dump()`, - * into the cache. The destination cache is reset before loading new entries - * - * @param cacheEntries Obtained from `sourceCache.dump()` - */ - load(cacheEntries: ReadonlyArray>): void; - } - - interface LRUEntry { + interface Entry { k: K; v: V; e: number; } } + +export = LRUCache; diff --git a/types/lru-cache/lru-cache-tests.ts b/types/lru-cache/lru-cache-tests.ts index c7d3977f7f..73d7c1ba6a 100644 --- a/types/lru-cache/lru-cache-tests.ts +++ b/types/lru-cache/lru-cache-tests.ts @@ -1,4 +1,4 @@ -import LRU = require('lru-cache'); +import LRUCache = require('lru-cache'); const num = 1; @@ -10,9 +10,9 @@ const foo = { foo() {} }; -const cache = LRU(); -cache; // $ExpectType Cache -LRU({ // $ExpectType Cache +const cache = new LRUCache(); +cache; // $ExpectType LRUCache +new LRUCache({ // $ExpectType LRUCache max: num, maxAge: num, length(value) { @@ -26,9 +26,9 @@ LRU({ // $ExpectType Cache stale: false, noDisposeOnSet: false, }); -LRU(num); // $ExpectType Cache -new LRU(); // $ExpectType Cache -new LRU({ // $ExpectType Cache +new LRUCache(num); // $ExpectType LRUCache +new LRUCache(); // $ExpectType LRUCache +new LRUCache({ // $ExpectType LRUCache max: num, maxAge: num, length: (value) => { @@ -38,7 +38,7 @@ new LRU({ // $ExpectType Cache stale: false, noDisposeOnSet: false, }); -new LRU(num); // $ExpectType Cache +new LRUCache(num); // $ExpectType LRUCache cache.length; // $ExpectType number cache.length = 1; // $ExpectError @@ -80,26 +80,26 @@ cache.prune(); cache.forEach(function(value, key, cache) { value; // $ExpectType Foo key; // $ExpectType string - cache; // $ExpectType Cache - this; // $ExpectType Cache + cache; // $ExpectType LRUCache + this; // $ExpectType LRUCache }); cache.forEach(function(value, key, cache) { value; // $ExpectType Foo key; // $ExpectType string - cache; // $ExpectType Cache + cache; // $ExpectType LRUCache this; // $ExpectType { foo(): void; } }, foo); cache.rforEach(function(value, key, cache) { value; // $ExpectType Foo key; // $ExpectType string - cache; // $ExpectType Cache - this; // $ExpectType Cache + cache; // $ExpectType LRUCache + this; // $ExpectType LRUCache }); cache.rforEach(function(value, key, cache) { value; // $ExpectType Foo key; // $ExpectType string - cache; // $ExpectType Cache + cache; // $ExpectType LRUCache this; // $ExpectType { foo(): void; } }, foo); @@ -107,5 +107,5 @@ cache.keys(); // $ExpectType string[] cache.values(); // $ExpectType Foo[] const dump = cache.dump(); -dump; // $ExpectType LRUEntry[] +dump; // $ExpectType Entry[] cache.load(dump); diff --git a/types/lru-cache/tsconfig.json b/types/lru-cache/tsconfig.json index de5c387339..c7d3687334 100644 --- a/types/lru-cache/tsconfig.json +++ b/types/lru-cache/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "lru-cache-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/lru-cache/tslint.json b/types/lru-cache/tslint.json index 71ee04c4e1..f93cf8562a 100644 --- a/types/lru-cache/tslint.json +++ b/types/lru-cache/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-unnecessary-generics": false - } + "extends": "dtslint/dt.json" } diff --git a/types/lru-cache/v4/index.d.ts b/types/lru-cache/v4/index.d.ts new file mode 100644 index 0000000000..ed40619b11 --- /dev/null +++ b/types/lru-cache/v4/index.d.ts @@ -0,0 +1,191 @@ +// Type definitions for lru-cache 4.1 +// Project: https://github.com/isaacs/node-lru-cache +// Definitions by: Bart van der Schoor +// BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = LRU; + +declare const LRU: LRU; + +interface LRU { + (opts?: LRU.Options): LRU.Cache; + (max: number): LRU.Cache; + new (opts?: LRU.Options): LRU.Cache; + new (max: number): LRU.Cache; +} + +declare namespace LRU { + interface Options { + /** + * The maximum size of the cache, checked by applying the length + * function to all values in the cache. Not setting this is kind of silly, + * since that's the whole purpose of this lib, but it defaults to `Infinity`. + */ + max?: number; + + /** + * Maximum age in ms. Items are not pro-actively pruned out as they age, + * but if you try to get an item that is too old, it'll drop it and return + * undefined instead of giving it to you. + */ + maxAge?: number; + + /** + * Function that is used to calculate the length of stored items. + * If you're storing strings or buffers, then you probably want to do + * something like `function(n, key){return n.length}`. The default + * is `function(){return 1}`, which is fine if you want to store + * `max` like-sized things. The item is passed as the first argument, + * and the key is passed as the second argument. + */ + length?(value: V, key?: K): number; + + /** + * Function that is called on items when they are dropped from the cache. + * This can be handy if you want to close file descriptors or do other + * cleanup tasks when items are no longer accessible. Called with `key, value`. + * It's called before actually removing the item from the internal cache, + * so if you want to immediately put it back in, you'll have to do that in + * a `nextTick` or `setTimeout` callback or it won't do anything. + */ + dispose?(key: K, value: V): void; + + /** + * By default, if you set a `maxAge`, it'll only actually pull stale items + * out of the cache when you `get(key)`. (That is, it's not pre-emptively + * doing a `setTimeout` or anything.) If you set `stale:true`, it'll return + * the stale value before deleting it. If you don't set this, then it'll + * return `undefined` when you try to get a stale entry, + * as if it had already been deleted. + */ + stale?: boolean; + + /** + * By default, if you set a `dispose()` method, then it'll be called whenever + * a `set()` operation overwrites an existing key. If you set this option, + * `dispose()` will only be called when a key falls out of the cache, + * not when it is overwritten. + */ + noDisposeOnSet?: boolean; + } + + interface Cache { + /** + * Return total length of objects in cache taking into account `length` options function. + */ + readonly length: number; + + /** + * Return total quantity of objects currently in cache. Note, + * that `stale` (see options) items are returned as part of this item count. + */ + readonly itemCount: number; + + /** + * Same as Options.allowStale. + */ + allowStale: boolean; + + /** + * Same as Options.length. + */ + lengthCalculator(value: V): number; + + /** + * Same as Options.max. Resizes the cache when the `max` changes. + */ + max: number; + + /** + * Same as Options.maxAge. Resizes the cache when the `maxAge` changes. + */ + maxAge: number; + + /** + * Will update the "recently used"-ness of the key. They do what you think. + * `maxAge` is optional and overrides the cache `maxAge` option if provided. + */ + set(key: K, value: V, maxAge?: number): boolean; + + /** + * Will update the "recently used"-ness of the key. They do what you think. + * `maxAge` is optional and overrides the cache `maxAge` option if provided. + * + * If the key is not found, will return `undefined`. + */ + get(key: K): V | undefined; + + /** + * Returns the key value (or `undefined` if not found) without updating + * the "recently used"-ness of the key. + * + * (If you find yourself using this a lot, you might be using the wrong + * sort of data structure, but there are some use cases where it's handy.) + */ + peek(key: K): V | undefined; + + /** + * Check if a key is in the cache, without updating the recent-ness + * or deleting it for being stale. + */ + has(key: K): boolean; + + /** + * Deletes a key out of the cache. + */ + del(key: K): void; + + /** + * Clear the cache entirely, throwing away all values. + */ + reset(): void; + + /** + * Manually iterates over the entire cache proactively pruning old entries. + */ + prune(): void; + + /** + * Just like `Array.prototype.forEach`. Iterates over all the keys in the cache, + * in order of recent-ness. (Ie, more recently used items are iterated over first.) + */ + forEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void; + + /** + * The same as `cache.forEach(...)` but items are iterated over in reverse order. + * (ie, less recently used items are iterated over first.) + */ + rforEach(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void; + + /** + * Return an array of the keys in the cache. + */ + keys(): K[]; + + /** + * Return an array of the values in the cache. + */ + values(): V[]; + + /** + * Return an array of the cache entries ready for serialization and usage with `destinationCache.load(arr)`. + */ + dump(): Array>; + + /** + * Loads another cache entries array, obtained with `sourceCache.dump()`, + * into the cache. The destination cache is reset before loading new entries + * + * @param cacheEntries Obtained from `sourceCache.dump()` + */ + load(cacheEntries: ReadonlyArray>): void; + } + + interface LRUEntry { + k: K; + v: V; + e: number; + } +} diff --git a/types/lru-cache/v4/lru-cache-tests.ts b/types/lru-cache/v4/lru-cache-tests.ts new file mode 100644 index 0000000000..c7d3977f7f --- /dev/null +++ b/types/lru-cache/v4/lru-cache-tests.ts @@ -0,0 +1,111 @@ +import LRU = require('lru-cache'); + +const num = 1; + +interface Foo { + foo(): void; +} + +const foo = { + foo() {} +}; + +const cache = LRU(); +cache; // $ExpectType Cache +LRU({ // $ExpectType Cache + max: num, + maxAge: num, + length(value) { + value; // $ExpectType Foo + return num; + }, + dispose(key, value) { + key; // $ExpectType string + value; // $ExpectType Foo + }, + stale: false, + noDisposeOnSet: false, +}); +LRU(num); // $ExpectType Cache +new LRU(); // $ExpectType Cache +new LRU({ // $ExpectType Cache + max: num, + maxAge: num, + length: (value) => { + return num; + }, + dispose: (key, value) => {}, + stale: false, + noDisposeOnSet: false, +}); +new LRU(num); // $ExpectType Cache + +cache.length; // $ExpectType number +cache.length = 1; // $ExpectError + +cache.itemCount; // $ExpectType number +cache.itemCount = 1; // $ExpectError + +cache.allowStale; // $ExpectType boolean +cache.allowStale = true; + +cache.lengthCalculator; // $ExpectType (value: Foo) => number +cache.lengthCalculator = () => 1; + +cache.max; // $ExpectType number +cache.max = 1; + +cache.maxAge; // $ExpectType number +cache.maxAge = 1; + +cache.set('foo', foo); // $ExpectType boolean +cache.set(1, foo); // $ExpectError +cache.set('foo', 1); // $ExpectError + +cache.get('foo'); // $ExpectType Foo | undefined +cache.get(1); // $ExpectError + +cache.peek('foo'); // $ExpectType Foo | undefined +cache.peek(1); // $ExpectError + +cache.has('foo'); // $ExpectType boolean +cache.has(1); // $ExpectError + +cache.del('foo'); +cache.del(1); // $ExpectError + +cache.reset(); +cache.prune(); + +cache.forEach(function(value, key, cache) { + value; // $ExpectType Foo + key; // $ExpectType string + cache; // $ExpectType Cache + this; // $ExpectType Cache +}); +cache.forEach(function(value, key, cache) { + value; // $ExpectType Foo + key; // $ExpectType string + cache; // $ExpectType Cache + this; // $ExpectType { foo(): void; } +}, foo); + +cache.rforEach(function(value, key, cache) { + value; // $ExpectType Foo + key; // $ExpectType string + cache; // $ExpectType Cache + this; // $ExpectType Cache +}); +cache.rforEach(function(value, key, cache) { + value; // $ExpectType Foo + key; // $ExpectType string + cache; // $ExpectType Cache + this; // $ExpectType { foo(): void; } +}, foo); + +cache.keys(); // $ExpectType string[] +cache.values(); // $ExpectType Foo[] + +const dump = cache.dump(); +dump; // $ExpectType LRUEntry[] +cache.load(dump); diff --git a/types/internal-ip/v2/tsconfig.json b/types/lru-cache/v4/tsconfig.json similarity index 82% rename from types/internal-ip/v2/tsconfig.json rename to types/lru-cache/v4/tsconfig.json index bae5b7feb8..153f9c56aa 100644 --- a/types/internal-ip/v2/tsconfig.json +++ b/types/lru-cache/v4/tsconfig.json @@ -13,9 +13,7 @@ "../../" ], "paths": { - "internal-ip": [ - "internal-ip/v2" - ] + "lru-cache": ["lru-cache/v4"] }, "types": [], "noEmit": true, @@ -23,6 +21,6 @@ }, "files": [ "index.d.ts", - "internal-ip-tests.ts" + "lru-cache-tests.ts" ] } diff --git a/types/dd-trace/tslint.json b/types/lru-cache/v4/tslint.json similarity index 59% rename from types/dd-trace/tslint.json rename to types/lru-cache/v4/tslint.json index 4f44991c3c..71ee04c4e1 100644 --- a/types/dd-trace/tslint.json +++ b/types/lru-cache/v4/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "no-empty-interface": false + "no-unnecessary-generics": false } } diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index eebf89497d..44165c06c3 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -426,7 +426,7 @@ export class Interval { engulfs(other: Interval): boolean; equals(other: Interval): boolean; hasSame(unit: DurationUnit): boolean; - intersection(other: Interval): Interval; + intersection(other: Interval): Interval | null; isAfter(dateTime: DateTime): boolean; isBefore(dateTime: DateTime): boolean; isEmpty(): boolean; diff --git a/types/luxon/luxon-tests.ts b/types/luxon/luxon-tests.ts index 59566c35c3..ecf49e2081 100644 --- a/types/luxon/luxon-tests.ts +++ b/types/luxon/luxon-tests.ts @@ -140,6 +140,7 @@ i.length('years'); // $ExpectType number i.contains(DateTime.local(2019)); // $ExpectType boolean i.set({end: DateTime.local(2020)}); // $ExpectType Interval i.mapEndpoints((d) => d); // $ExpectType Interval +i.intersection(i); // $ExpectType Interval | null i.toISO(); // $ExpectType string i.toString(); // $ExpectType string diff --git a/types/mangopay2-nodejs-sdk/index.d.ts b/types/mangopay2-nodejs-sdk/index.d.ts index 516f1c44f9..78629b7232 100644 --- a/types/mangopay2-nodejs-sdk/index.d.ts +++ b/types/mangopay2-nodejs-sdk/index.d.ts @@ -1774,7 +1774,7 @@ declare namespace MangoPay { /** * This is the URL where to redirect users to proceed to 3D secure validation */ - SecureModeRedirectUrl: string; + SecureModeRedirectURL: string; /** * This is the URL where users are automatically redirected after 3D secure validation (if activated) @@ -2596,7 +2596,7 @@ declare namespace MangoPay { /** * This is the URL where to redirect users to proceed to 3D secure validation */ - SecureModeRedirectUrl: string; + SecureModeRedirectURL: string; } interface CreateCardDirectPayIn { diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index 9cc7143d9b..ac32788c4b 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -4227,7 +4227,7 @@ function wrapState(ComposedComponent: ComponentClass<__MaterialUI.List.Selectabl }; } -const SelectableList = wrapState(makeSelectable(List)); +const SelectableList = wrapState(makeSelectable<{}>(List)); const ListExampleSelectable = () => ( diff --git a/types/mem-fs-editor/tsconfig.json b/types/mem-fs-editor/tsconfig.json index 52623549e4..3f6396792c 100644 --- a/types/mem-fs-editor/tsconfig.json +++ b/types/mem-fs-editor/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "lru-cache": ["lru-cache/v4"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/meteor-universe-i18n/index.d.ts b/types/meteor-universe-i18n/index.d.ts index a577b0185e..1596ceef81 100644 --- a/types/meteor-universe-i18n/index.d.ts +++ b/types/meteor-universe-i18n/index.d.ts @@ -65,6 +65,7 @@ declare module "meteor/universe:i18n" { // events function onChangeLocale(callback: (locale: string) => void): void; + function offChangeLocale(callback: (locale: string) => void): void; } interface ReactComponentProps { diff --git a/types/mongoose-paginate-v2/index.d.ts b/types/mongoose-paginate-v2/index.d.ts index df4c1f7419..43848598b2 100644 --- a/types/mongoose-paginate-v2/index.d.ts +++ b/types/mongoose-paginate-v2/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for mongoose-paginate-v2 1.0 -// Project: https://github.com/aravindnc/mongoose-paginate-v2 +// Project: https://github.com/webgangster/mongoose-paginate-v2 // Definitions by: Linus Brolin // simonxca // woutgg diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 4497156019..e51290b451 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -18,6 +18,7 @@ // Emmanuel Gautier // Frontend Monster // Ming Chen +// Olga Isakova // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -337,7 +338,7 @@ declare module "mongoose" { /** Use ssl connection (needs to have a mongod server with ssl support) (default: true) */ ssl?: boolean; /** Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) */ - sslValidate?: object; + sslValidate?: boolean; /** Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons. */ poolSize?: number; /** Reconnect on error (default: true) */ @@ -1060,12 +1061,25 @@ declare module "mongoose" { validateBeforeSave?: boolean; /** defaults to "__v" */ versionKey?: string | boolean; + /** + * By default, Mongoose will automatically + * select() any populated paths. + * To opt out, set selectPopulatedPaths to false. + */ + selectPopulatedPaths?: boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be * incremented even if these paths are updated). */ skipVersioning?: any; + /** + * Validation errors in a single nested schema are reported + * both on the child and on the parent schema. + * Set storeSubdocValidationError to false on the child schema + * to make Mongoose only report the parent error. + */ + storeSubdocValidationError?: boolean; /** * If set timestamps, mongoose assigns createdAt * and updatedAt fields to your schema, the type @@ -1722,6 +1736,9 @@ declare module "mongoose" { * If later in the query chain a method returns Query, we will need to know type T. * So we save this type as the second type parameter in DocumentQuery. Since people have * been using Query, we set it as an alias of DocumentQuery. + * + * Furthermore, Query is used for function that has an option { rawResult: true }. + * for instance findOneAndUpdate. */ class Query extends DocumentQuery { } class DocumentQuery extends mquery { @@ -1864,7 +1881,7 @@ declare module "mongoose" { equals(val: T): this; /** Executes the query */ - exec(callback?: (err: any, res: T) => void): Promise; + exec(callback?: (err: NativeError, res: T) => void): Promise; exec(operation: string | Function, callback?: (err: any, res: T) => void): Promise; /** Specifies an $exists condition */ @@ -1895,10 +1912,16 @@ declare module "mongoose" { * Issues a mongodb findAndModify remove command. * Finds a matching document, removes it, passing the found document (if any) to the * callback. Executes immediately if callback is passed. + * + * If mongoose option 'useFindAndModify': set to false it uses native findOneAndUpdate() rather than deprecated findAndModify(). + * https://mongoosejs.com/docs/api.html#mongoose_Mongoose-set */ findOneAndRemove(callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery & QueryHelpers; findOneAndRemove(conditions: any, callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery & QueryHelpers; + findOneAndRemove(conditions: any, options: { rawResult: true } & QueryFindOneAndRemoveOptions, + callback?: (error: any, doc: mongodb.FindAndModifyWriteOpResultObject, result: any) => void) + : Query> & QueryHelpers; findOneAndRemove(conditions: any, options: QueryFindOneAndRemoveOptions, callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery & QueryHelpers; @@ -1906,6 +1929,9 @@ declare module "mongoose" { * Issues a mongodb findAndModify update command. * Finds a matching document, updates it according to the update arg, passing any options, and returns * the found document (if any) to the callback. The query executes immediately if callback is passed. + * + * If mongoose option 'useFindAndModify': set to false it uses native findOneAndUpdate() rather than deprecated findAndModify(). + * https://mongoosejs.com/docs/api.html#mongoose_Mongoose-set */ findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery & QueryHelpers; findOneAndUpdate(update: any, @@ -1913,8 +1939,15 @@ declare module "mongoose" { findOneAndUpdate(query: any, update: any, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery & QueryHelpers; findOneAndUpdate(query: any, update: any, - options: { upsert: true, new: true } & QueryFindOneAndUpdateOptions, - callback?: (err: any, doc: DocType, res: any) => void): DocumentQuery & QueryHelpers; + options: { rawResult: true } & { upsert: true } & { new: true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject, res: any) => void) + : Query> & QueryHelpers; + findOneAndUpdate(query: any, update: any, + options: { upsert: true } & { new: true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: DocType, res: any) => void): DocumentQuery & QueryHelpers; + findOneAndUpdate(query: any, update: any, options: { rawResult: true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject, res: any) => void) + : Query> & QueryHelpers; findOneAndUpdate(query: any, update: any, options: QueryFindOneAndUpdateOptions, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery & QueryHelpers; @@ -2200,8 +2233,7 @@ declare module "mongoose" { }): this; /** Executes this query and returns a promise */ - then(resolve?: (res: T) => void | TRes | PromiseLike, - reject?: (err: any) => void | TRes | PromiseLike): Promise; + then: Promise["then"]; /** * Converts this query to a customized, reusable query @@ -2239,12 +2271,21 @@ declare module "mongoose" { class mquery { } interface QueryFindOneAndRemoveOptions { - /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + /** + * if multiple docs are found by the conditions, sets the sort order to choose + * which doc to update + */ sort?: any; /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; - /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + /** sets the document fields to return */ + select?: any; + /** like select, it determines which fields to return */ + projection?: any; + /** if true, returns the raw result from the MongoDB driver */ rawResult?: boolean; + /** overwrites the schema's strict mode option for this update */ + strict?: boolean|string; } interface QueryFindOneAndUpdateOptions extends QueryFindOneAndRemoveOptions { @@ -2252,8 +2293,6 @@ declare module "mongoose" { new?: boolean; /** creates the object if it doesn't exist. defaults to false. */ upsert?: boolean; - /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ - fields?: any | string; /** if true, runs update validators on this command. Update validators validate the update operation against the model's schema. */ runValidators?: boolean; /** @@ -2271,6 +2310,8 @@ declare module "mongoose" { * Turn on this option to aggregate all the cast errors. */ multipleCastError?: boolean; + /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ + fields?: any | string; } interface QueryUpdateOptions extends ModelUpdateOptions { @@ -2705,8 +2746,7 @@ declare module "mongoose" { sort(arg: string | any): this; /** Provides promise for aggregate. */ - then(resolve?: (val: T) => void | TRes | PromiseLike, - reject?: (err: any) => void | TRes | PromiseLike): Promise; + then: Promise["then"]; /** * Appends new custom $unwind operator(s) to this aggregate pipeline. @@ -3000,17 +3040,21 @@ declare module "mongoose" { * findByIdAndRemove(id, ...) is equivalent to findOneAndRemove({ _id: id }, ...). * Finds a matching document, removes it, passing the found document (if any) to the callback. * Executes immediately if callback is passed, else a Query object is returned. + * + * If mongoose option 'useFindAndModify': set to false it uses native findOneAndUpdate() rather than deprecated findAndModify(). + * https://mongoosejs.com/docs/api.html#mongoose_Mongoose-set + * + * Note: same signatures as findByIdAndDelete + * * @param id value of _id to query by */ findByIdAndRemove(): DocumentQuery & QueryHelpers; findByIdAndRemove(id: any | number | string, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; - findByIdAndRemove(id: any | number | string, options: { - /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: any; - /** sets the document fields to return */ - select?: any; - }, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; + findByIdAndRemove(id: any | number | string, options: QueryFindOneAndRemoveOptions, + callback?: (err: any, res: mongodb.FindAndModifyWriteOpResultObject) => void) + : Query> & QueryHelpers; + findByIdAndRemove(id: any | number | string, options: QueryFindOneAndRemoveOptions, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; /** @@ -3018,31 +3062,44 @@ declare module "mongoose" { * findByIdAndDelete(id, ...) is equivalent to findByIdAndDelete({ _id: id }, ...). * Finds a matching document, removes it, passing the found document (if any) to the callback. * Executes immediately if callback is passed, else a Query object is returned. + * + * Note: same signatures as findByIdAndRemove + * * @param id value of _id to query by */ - findByIdAndDelete(): DocumentQuery; + findByIdAndDelete(): DocumentQuery & QueryHelpers; findByIdAndDelete(id: any | number | string, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; - findByIdAndDelete(id: any | number | string, options: { - /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: any; - /** sets the document fields to return */ - select?: any; - }, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; + findByIdAndDelete(id: any | number | string, options: QueryFindOneAndRemoveOptions, + callback?: (err: any, res: mongodb.FindAndModifyWriteOpResultObject) => void) + : Query> & QueryHelpers; + findByIdAndDelete(id: any | number | string, options: QueryFindOneAndRemoveOptions, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; /** * Issues a mongodb findAndModify update command by a document's _id field. findByIdAndUpdate(id, ...) * is equivalent to findOneAndUpdate({ _id: id }, ...). + * + * If mongoose option 'useFindAndModify': set to false it uses native findOneAndUpdate() rather than deprecated findAndModify(). + * https://mongoosejs.com/docs/api.html#mongoose_Mongoose-set + * * @param id value of _id to query by */ findByIdAndUpdate(): DocumentQuery & QueryHelpers; findByIdAndUpdate(id: any | number | string, update: any, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; findByIdAndUpdate(id: any | number | string, update: any, - options: { upsert: true, new: true } & ModelFindByIdAndUpdateOptions, + options: { rawResult: true } & { upsert: true } & { new: true } & QueryFindOneAndUpdateOptions, callback?: (err: any, res: T) => void): DocumentQuery & QueryHelpers; findByIdAndUpdate(id: any | number | string, update: any, - options: ModelFindByIdAndUpdateOptions, + options: { upsert: true, new: true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, res: mongodb.FindAndModifyWriteOpResultObject) => void) + : Query> & QueryHelpers; + findByIdAndUpdate(id: any | number | string, update: any, + options: { rawResult : true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, res: mongodb.FindAndModifyWriteOpResultObject) => void) + : Query> & QueryHelpers; + findByIdAndUpdate(id: any | number | string, update: any, + options: QueryFindOneAndUpdateOptions, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; /** @@ -3061,62 +3118,62 @@ declare module "mongoose" { * Issue a mongodb findAndModify remove command. * Finds a matching document, removes it, passing the found document (if any) to the callback. * Executes immediately if callback is passed else a Query object is returned. + * + * If mongoose option 'useFindAndModify': set to false it uses native findOneAndUpdate() rather than deprecated findAndModify(). + * https://mongoosejs.com/docs/api.html#mongoose_Mongoose-set + * + * Note: same signatures as findOneAndDelete + * */ findOneAndRemove(): DocumentQuery & QueryHelpers; findOneAndRemove(conditions: any, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; - findOneAndRemove(conditions: any, options: { - /** - * if multiple docs are found by the conditions, sets the sort order to choose - * which doc to update - */ - sort?: any; - /** puts a time limit on the query - requires mongodb >= 2.6.0 */ - maxTimeMS?: number; - /** sets the document fields to return */ - select?: any; - }, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; + findOneAndRemove(conditions: any, options: { rawResult: true } & QueryFindOneAndRemoveOptions, + callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject, res: any) => void) + : Query> & QueryHelpers; + findOneAndRemove(conditions: any, options: QueryFindOneAndRemoveOptions, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; /** * Issues a mongodb findOneAndDelete command. * Finds a matching document, removes it, passing the found document (if any) to the * callback. Executes immediately if callback is passed. + * + * Note: same signatures as findOneAndRemove + * */ findOneAndDelete(): DocumentQuery & QueryHelpers; findOneAndDelete(conditions: any, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; - findOneAndDelete(conditions: any, options: { - /** - * if multiple docs are found by the conditions, sets the sort order to choose - * which doc to update - */ - sort?: any; - /** puts a time limit on the query - requires mongodb >= 2.6.0 */ - maxTimeMS?: number; - /** sets the document fields to return */ - select?: any; - /** like select, it determines which fields to return */ - projection?: any; - /** if true, returns the raw result from the MongoDB driver */ - rawResult?: boolean; - /** overwrites the schema's strict mode option for this update */ - strict?: boolean|string; - }, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; + findOneAndDelete(conditions: any, options: { rawResult: true } & QueryFindOneAndRemoveOptions, + callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject, res: any) => void) + : Query> & QueryHelpers; + findOneAndDelete(conditions: any, options: QueryFindOneAndRemoveOptions, callback?: (err: any, res: T | null) => void): DocumentQuery & QueryHelpers; /** * Issues a mongodb findAndModify update command. * Finds a matching document, updates it according to the update arg, passing any options, * and returns the found document (if any) to the callback. The query executes immediately * if callback is passed else a Query object is returned. + * ++ * If mongoose option 'useFindAndModify': set to false it uses native findOneAndUpdate() rather than the deprecated findAndModify(). ++ * https://mongoosejs.com/docs/api.html#mongoose_Mongoose-set */ findOneAndUpdate(): DocumentQuery & QueryHelpers; findOneAndUpdate(conditions: any, update: any, callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery & QueryHelpers; findOneAndUpdate(conditions: any, update: any, - options: { upsert: true, new: true } & ModelFindOneAndUpdateOptions, + options: { rawResult : true } & { upsert: true, new: true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject, res: any) => void) + : Query> & QueryHelpers; + findOneAndUpdate(conditions: any, update: any, + options: { upsert: true, new: true } & QueryFindOneAndUpdateOptions, callback?: (err: any, doc: T, res: any) => void): DocumentQuery & QueryHelpers; findOneAndUpdate(conditions: any, update: any, - options: ModelFindOneAndUpdateOptions, + options: { rawResult: true } & QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject, res: any) => void) + : Query> & QueryHelpers; + findOneAndUpdate(conditions: any, update: any, + options: QueryFindOneAndUpdateOptions, callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery & QueryHelpers; /** @@ -3310,43 +3367,6 @@ declare module "mongoose" { session?: ClientSession | null; } - interface ModelFindByIdAndUpdateOptions extends ModelOptions { - /** true to return the modified document rather than the original. defaults to false */ - new?: boolean; - /** creates the object if it doesn't exist. defaults to false. */ - upsert?: boolean; - /** - * if true, runs update validators on this command. Update validators validate the - * update operation against the model's schema. - */ - runValidators?: boolean; - /** - * if this and upsert are true, mongoose will apply the defaults specified in the model's - * schema if a new document is created. This option only works on MongoDB >= 2.4 because - * it relies on MongoDB's $setOnInsert operator. - */ - setDefaultsOnInsert?: boolean; - /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: any; - /** sets the document fields to return */ - select?: any; - /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - rawResult?: boolean; - /** overwrites the schema's strict mode option for this update */ - strict?: boolean; - /** The context option lets you set the value of this in update validators to the underlying query. */ - context?: string; - } - - interface ModelFindOneAndUpdateOptions extends ModelFindByIdAndUpdateOptions { - /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ - fields?: any | string; - /** puts a time limit on the query - requires mongodb >= 2.6.0 */ - maxTimeMS?: number; - /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - rawResult?: boolean; - } - interface ModelPopulateOptions { /** space delimited path(s) to populate */ path: string; diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 9724e2e76f..6eda6d5eb0 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1021,7 +1021,7 @@ query.findOne(function (err, res) { query.findOneAndRemove({name: 'aa'}, { rawResult: true }, function (err, doc) { - doc.execPopulate(); + doc.lastErrorObject }).findOneAndRemove(); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { @@ -1558,6 +1558,18 @@ mongoose.Promise.all; mongoose.model('').findOne() .exec().then(cb); +function testPromise_all() { + interface IUser extends mongoose.Document { + name: string; + } + + const User = mongoose.model('User', new mongoose.Schema({name: String})) + + const dc: mongoose.DocumentQuery = User.findOne({}); + const dc2: PromiseLike = dc; + Promise.all([dc]) +} + /* * section model.js * http://mongoosejs.com/docs/api.html#model-js @@ -1899,6 +1911,14 @@ LocModel.findOneAndUpdate().exec().then(function (arg) { arg.openingTimes; } }); +LocModel.findOneAndUpdate( + // find a document with that filter + {name: "aa"}, + // document to insert when nothing was found + { $set: {name: "bb"} }, + // options + {upsert: true, new: true, runValidators: true, + rawResult: true, multipleCastError: true }); LocModel.geoSearch({}, { near: [1, 2], maxDistance: 22 diff --git a/types/moveto/index.d.ts b/types/moveto/index.d.ts index f9734ee184..729f70bd78 100644 --- a/types/moveto/index.d.ts +++ b/types/moveto/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for moveto 1.7 +// Type definitions for moveto 1.8 // Project: https://github.com/hsnaydd/moveTo // Definitions by: Rostislav Shermenyov +// pea3nut // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare class MoveTo { @@ -66,6 +67,10 @@ declare namespace MoveTo { * Ease function name */ easing?: string; + /** + * The container been computed and scrolled + */ + container?: Window | HTMLElement; /** * The function to be run after scrolling complete. Target passes as the first argument */ diff --git a/types/moveto/moveto-tests.ts b/types/moveto/moveto-tests.ts index 325cb57f3c..ea65854f25 100644 --- a/types/moveto/moveto-tests.ts +++ b/types/moveto/moveto-tests.ts @@ -2,6 +2,7 @@ const options: MoveTo.MoveToOptions = { tolerance: 70, duration: 300, easing: "easeOutQuart", + container: Math.random() > 0.5 ? window : document.createElement('div'), callback: () => {} }; diff --git a/types/mui-datatables/index.d.ts b/types/mui-datatables/index.d.ts index aa5ad83e5e..1bdf9fc07f 100644 --- a/types/mui-datatables/index.d.ts +++ b/types/mui-datatables/index.d.ts @@ -85,7 +85,7 @@ interface MUIDataTableTextLabelsSelectedRows { deleteAria: string; } -interface MUIDataTableTextLabels { +export interface MUIDataTableTextLabels { body: MUIDataTableTextLabelsBody; pagination: MUIDataTableTextLabelsPagination; toolbar: MUIDataTableTextLabelsToolbar; @@ -105,7 +105,7 @@ export interface MUIDataTableColumnOptions { hint?: string; customHeadRender?: (columnMeta: MUIDataTableCustomHeadRenderer, updateDirection: (params: any) => any) => string; customBodyRender?: (value: any, tableMeta: MUIDataTableMeta, updateValue: (s: any, c: any, p: any) => any) => string | React.ReactNode; - setCellProps?: (cellValue: string, rowIndex: number, columnIndex: number) => string; + setCellProps?: (cellValue: string, rowIndex: number, columnIndex: number) => object; } export interface MUIDataTableOptions { @@ -117,7 +117,7 @@ export interface MUIDataTableOptions { textLabels?: MUIDataTableTextLabels; pagination?: boolean; selectableRows?: boolean; - IsRowSelectable?: (dataIndex: any) => boolean; + IsRowSelectable?: (dataIndex: number) => boolean; resizableColumns?: boolean; expandableRows?: boolean; renderExpandableRow?: (rowData: string[], rowMeta: { dataIndex: number; rowIndex: number }) => React.ReactNode; @@ -143,7 +143,7 @@ export interface MUIDataTableOptions { onRowsSelect?: (currentRowsSelected: any[], rowsSelected: any[]) => void; onRowsDelete?: (rowsDeleted: any[]) => void; onRowClick?: (rowData: string[], rowMeta: { dataIndex: number; rowIndex: number }) => void; - onCellClick?: (colIndex: number, rowIndex: number) => void; + onCellClick?: (colData: any, cellMeta: { colIndex: number, rowIndex: number, dataIndex: number }) => void; onChangePage?: (currentPage: number) => void; onChangeRowsPerPage?: (numberOfRows: number) => void; onSearchChange?: (searchText: string) => void; @@ -151,7 +151,7 @@ export interface MUIDataTableOptions { onColumnSortChange?: (changedColumn: string, direction: string) => void; onColumnViewChange?: (changedColumn: string, action: string) => void; onTableChange?: (action: string, tableState: object) => void; - setRowProps?: (row: any[], rowIndex: number) => any; + setRowProps?: (row: any[], rowIndex: number) => object; } export type MUIDataTableColumnDef = string | MUIDataTableColumn; diff --git a/types/mui-datatables/mui-datatables-tests.tsx b/types/mui-datatables/mui-datatables-tests.tsx index 47eb181389..c6a477ea08 100644 --- a/types/mui-datatables/mui-datatables-tests.tsx +++ b/types/mui-datatables/mui-datatables-tests.tsx @@ -1,84 +1,76 @@ -import MUIDataTable, { MUIDataTableColumnDef, MUIDataTableOptions } from 'mui-datatables'; +import MUIDataTable, { MUIDataTableOptions, MUIDataTableTextLabels } from 'mui-datatables'; import * as React from 'react'; -const dataSimple: string[][] = [ - ['Joe James', 'Test Corp', 'Yonkers', 'NY'], - ['John Walsh', 'Test Corp', 'Hartford', 'CT'], - ['Bob Herm', 'Test Corp', 'Tampa', 'FL'], - ['James Houston', 'Test Corp', 'Dallas', 'TX'] -]; +interface Props extends MUIDataTableOptions { + data: any; + title: string; + textLabels?: MUIDataTableTextLabels; +} -const columnWithOptions: MUIDataTableColumnDef[] = [ - { - name: 'Name', - label: 'New Name', - options: { - display: 'true', - filter: true, - sort: true, - sortDirection: 'asc', - download: true, +class MuiCustomTable extends React.Component { + private readonly data: string[][] = this.props.data.map((asset: any) => Object.values(asset)); + private readonly columns = this.props.data + .map((entry: any) => Object.keys(entry)) + .flat() + .map((title: string) => title.toUpperCase()) + .filter((element: string, index: number, array: string[]) => array.indexOf(element) === index); + private readonly TableOptions: MUIDataTableOptions = { + filterType: 'checkbox', + responsive: 'scroll', + selectableRows: false, + elevation: 0, + rowsPerPageOptions: [5, 10, 20, 25, 50, 100], + downloadOptions: { + filename: 'filename.csv', + separator: ',' + }, + sortFilterList: false, + textLabels: { + body: { + noMatch: 'Sorry, no matching records found', + toolTip: 'Sort', + }, + pagination: { + next: 'Next Page', + previous: 'Previous Page', + rowsPerPage: 'Rows per page:', + displayRows: 'of', + }, + toolbar: { + search: 'Search', + downloadCsv: 'Download CSV', + print: 'Print', + viewColumns: 'View Columns', + filterTable: 'Filter Table', + }, + filter: { + all: 'All', + title: 'FILTERS', + reset: 'RESET', + }, + viewColumns: { + title: 'Show Columns', + titleAria: 'Show/Hide Table Columns', + }, + selectedRows: { + text: 'rows(s) selected', + delete: 'Delete', + deleteAria: 'Delete Selected Rows', + } } - } -]; + }; -const options: MUIDataTableOptions = { - filterType: 'checkbox', - responsive: 'scroll', - selectableRows: false, - elevation: 0, - rowsPerPageOptions: [5, 10, 20, 25, 50, 100], - downloadOptions: { - filename: 'filename.csv', - separator: ',' - }, - sortFilterList: false, - textLabels: { - body: { - noMatch: 'Sorry, no matching records found', - toolTip: 'Sort', - }, - pagination: { - next: 'Next Page', - previous: 'Previous Page', - rowsPerPage: 'Rows per page:', - displayRows: 'of', - }, - toolbar: { - search: 'Search', - downloadCsv: 'Download CSV', - print: 'Print', - viewColumns: 'View Columns', - filterTable: 'Filter Table', - }, - filter: { - all: 'All', - title: 'FILTERS', - reset: 'RESET', - }, - viewColumns: { - title: 'Show Columns', - titleAria: 'Show/Hide Table Columns', - }, - selectedRows: { - text: 'rows(s) selected', - delete: 'Delete', - deleteAria: 'Delete Selected Rows', - } - } -}; - -class MuiDataTable extends React.Component { render() { - return ( - - ); + return (); } } -; +const TableFruits = [ + {id: 1, name: "Apple", amount: 1}, + {id: 2, name: "Pear", amount: 2}, + {id: 3, name: "Strawberry", amount: 5}, + {id: 4, name: "Banana", amount: 7}, + {id: 5, name: "Orange", amount: 9}, +]; + +; diff --git a/types/mui-datatables/tsconfig.json b/types/mui-datatables/tsconfig.json index 280efbb284..a4d6f99b77 100644 --- a/types/mui-datatables/tsconfig.json +++ b/types/mui-datatables/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ + "es2017.object", "es6", "dom" ], diff --git a/types/mumath/index.d.ts b/types/mumath/index.d.ts new file mode 100644 index 0000000000..8967bafa4f --- /dev/null +++ b/types/mumath/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for mumath 3.3 +// Project: https://github.com/dfcreative/mumath +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + +/** + * Detects proper clamp min/max. + */ +export function clamp(value: number, left: number, right: number): number; + +/** + * Get closest value out of a set. + */ +export function closest(value: number, list: number[]): number; + +/** + * Check if one number is multiple of other + * Same as a % b === 0, but with precision check. + */ +export function isMultiple(a: number, b: number, eps?: number): boolean; + +/** + * Return quadratic length of a vector. + */ +export function len(a: number, b: number): number; + +/** + * Return value interpolated between x and y. + */ +export function lerp(x: number, y: number, ratio: number): number; + +/** + * An enhanced mod-loop, like fmod — loops value within a frame. + */ +export function mod(value: number, max: number, min?: number): number; + +/** + * Get order of magnitude for a number. + */ +export function order(value: number): number; + +/** + * Get precision from float: + */ +export function precision(value: number): number; + +/** + * Rounds value to optional step. + */ +export function round(value: number, step?: number): number; + +/** + * Get first scale out of a list of basic scales, aligned to the power. E. g. + * step(.37, [1, 2, 5]) → .5 step(456, [1, 2]) → 1000 + * Similar to closest, but takes all possible powers of scales. + */ +export function scale(value: number, list: number[]): number; + +/** + * Whether element is between left & right, including. + */ +export function within(value: number, left: number, right: number): number; diff --git a/types/mumath/mumath-tests.ts b/types/mumath/mumath-tests.ts new file mode 100644 index 0000000000..c0fed04336 --- /dev/null +++ b/types/mumath/mumath-tests.ts @@ -0,0 +1,25 @@ +import * as mumath from "mumath"; + +mumath.clamp(1, 2, 3); + +mumath.closest(5, [1, 7, 3, 6, 10]); + +mumath.isMultiple(5, 10, 1.000074); +mumath.isMultiple(5, 10); + +mumath.len(15, 1.0); + +mumath.lerp(1, 2, 3); + +mumath.mod(1, 2, 3); +mumath.mod(1, 2); + +mumath.order(5); + +mumath.precision(5.0000001); + +mumath.round(0.3, 0.5); + +mumath.scale(5.93, [1.0, 35, 10, 7.135]); + +mumath.within(5, 1, 10); diff --git a/types/mumath/tsconfig.json b/types/mumath/tsconfig.json new file mode 100644 index 0000000000..67aa9c2b29 --- /dev/null +++ b/types/mumath/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mumath-tests.ts" + ] +} diff --git a/types/mumath/tslint.json b/types/mumath/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/mumath/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/mustache-express/tsconfig.json b/types/mustache-express/tsconfig.json index 9afb989b62..13c146f986 100644 --- a/types/mustache-express/tsconfig.json +++ b/types/mustache-express/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "lru-cache": [ "lru-cache/v4" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/nanoid/nanoid-tests.ts b/types/nanoid/nanoid-tests.ts index e026ec0659..8783d1b61f 100644 --- a/types/nanoid/nanoid-tests.ts +++ b/types/nanoid/nanoid-tests.ts @@ -6,6 +6,8 @@ import randomBrowser = require('nanoid/random-browser'); import url = require('nanoid/url'); import nanoidAsync = require('nanoid/async'); import nanoidAsyncBrowser = require('nanoid/async-browser'); +import nanoidNonSecure = require('nanoid/non-secure'); +import generateNonSecure = require('nanoid/non-secure/generate'); const _random = (size: number) => [1, 2, 3, 4]; @@ -22,5 +24,9 @@ nanoidAsync(null, (error, id) => { }); nanoidAsyncBrowser().then((id) => console.log(id)); nanoidAsyncBrowser(10).then((id) => console.log(id)); +nanoidNonSecure(); +nanoidNonSecure(10); +generateNonSecure('0123456789абвгдеё', 5); +generateNonSecure('0123456789абвгдеё'); console.log(url); diff --git a/types/nanoid/non-secure/generate.d.ts b/types/nanoid/non-secure/generate.d.ts new file mode 100644 index 0000000000..c7fac1dfef --- /dev/null +++ b/types/nanoid/non-secure/generate.d.ts @@ -0,0 +1,19 @@ +/** + * Generate URL-friendly unique ID. This method use non-secure predictable + * random generator. + * + * By default, ID will have 21 symbols to have a collision probability similar + * to UUID v4. + * + * @param alphabet Symbols to be used in ID. + * @param [size=21] The number of symbols in ID. + * + * @return Random string. + * + * @example + * const nanoid = require('nanoid/non-secure') + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + */ +declare function generate(alphabet: string, size?: number): string; + +export = generate; diff --git a/types/nanoid/non-secure/index.d.ts b/types/nanoid/non-secure/index.d.ts new file mode 100644 index 0000000000..d3cd25d817 --- /dev/null +++ b/types/nanoid/non-secure/index.d.ts @@ -0,0 +1,18 @@ +/** + * Generate URL-friendly unique ID. This method use non-secure predictable + * random generator. + * + * By default, ID will have 21 symbols to have a collision probability similar + * to UUID v4. + * + * @param [size=21] The number of symbols in ID. + * + * @return Random string. + * + * @example + * const nanoid = require('nanoid/non-secure') + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + */ +declare function nanoid(size?: number): string; + +export = nanoid; diff --git a/types/nanoid/tsconfig.json b/types/nanoid/tsconfig.json index 1051097a89..1c64d18467 100644 --- a/types/nanoid/tsconfig.json +++ b/types/nanoid/tsconfig.json @@ -17,6 +17,8 @@ "strictFunctionTypes": true }, "files": [ + "non-secure/index.d.ts", + "non-secure/generate.d.ts", "async-browser.d.ts", "async.d.ts", "format.d.ts", diff --git a/types/natural-compare-lite/index.d.ts b/types/natural-compare-lite/index.d.ts new file mode 100644 index 0000000000..d9dd5f3e6d --- /dev/null +++ b/types/natural-compare-lite/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for natural-compare-lite 1.4 +// Project: https://github.com/litejs/natural-compare-lite +// Definitions by: Doniyor Aliyev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function naturalCompare(a: string, b: string): -1 | 0 | 1; + +export = naturalCompare; diff --git a/types/natural-compare-lite/natural-compare-lite-tests.ts b/types/natural-compare-lite/natural-compare-lite-tests.ts new file mode 100644 index 0000000000..c82a695344 --- /dev/null +++ b/types/natural-compare-lite/natural-compare-lite-tests.ts @@ -0,0 +1,3 @@ +import compare = require("natural-compare-lite"); + +['a', 's', 'd'].sort(compare); diff --git a/types/natural-compare-lite/tsconfig.json b/types/natural-compare-lite/tsconfig.json new file mode 100644 index 0000000000..ddfcb244cb --- /dev/null +++ b/types/natural-compare-lite/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "natural-compare-lite-tests.ts" + ] +} diff --git a/types/terser/tslint.json b/types/natural-compare-lite/tslint.json similarity index 100% rename from types/terser/tslint.json rename to types/natural-compare-lite/tslint.json diff --git a/types/natural-compare/index.d.ts b/types/natural-compare/index.d.ts new file mode 100644 index 0000000000..bb26b925f7 --- /dev/null +++ b/types/natural-compare/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for natural-compare 1.4 +// Project: https://github.com/litejs/natural-compare-lite +// Definitions by: Doniyor Aliyev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function naturalCompare(a: string, b: string): -1 | 0 | 1; + +export = naturalCompare; diff --git a/types/natural-compare/natural-compare-tests.ts b/types/natural-compare/natural-compare-tests.ts new file mode 100644 index 0000000000..d006905f47 --- /dev/null +++ b/types/natural-compare/natural-compare-tests.ts @@ -0,0 +1,3 @@ +import compare = require("natural-compare"); + +['a', 's', 'd'].sort(compare); diff --git a/types/natural-compare/tsconfig.json b/types/natural-compare/tsconfig.json new file mode 100644 index 0000000000..c8af37bb22 --- /dev/null +++ b/types/natural-compare/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "natural-compare-tests.ts" + ] +} diff --git a/types/natural-compare/tslint.json b/types/natural-compare/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/natural-compare/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/next-server/dynamic.d.ts b/types/next-server/dynamic.d.ts index 2d06273bd5..61847c2d3c 100644 --- a/types/next-server/dynamic.d.ts +++ b/types/next-server/dynamic.d.ts @@ -7,9 +7,9 @@ import { type Omit = Pick>; -type AsyncComponent

= Promise>; +type AsyncComponent

= Promise | { default: React.ComponentType

}>; type AsyncComponentLoader

= () => AsyncComponent

; -type ModuleMapping = Record; +type ModuleMapping = Record; type LoadedModuleMapping = Record; interface NextDynamicOptions

extends Omit { @@ -31,10 +31,10 @@ type DynamicComponent

= React.ComponentType

& LoadableComponent; * https://github.com/zeit/next.js/blob/7.0.0/lib/dynamic.js#L55 */ declare function dynamic

( - options: AsyncComponentLoader

| AsyncComponent

| NextDynamicOptions

+ asyncModuleOrOptions: AsyncComponentLoader

| AsyncComponent

| NextDynamicOptions

): DynamicComponent

; declare function dynamic

( - asyncModule: AsyncComponent

, + asyncModule: AsyncComponentLoader

| AsyncComponent

, options: NextDynamicOptions

): DynamicComponent

; diff --git a/types/next-server/test/imports/no-default.tsx b/types/next-server/test/imports/no-default.tsx new file mode 100644 index 0000000000..1f406a3fe3 --- /dev/null +++ b/types/next-server/test/imports/no-default.tsx @@ -0,0 +1,7 @@ +import * as React from "react"; + +interface Props { + foo: string; +} + +export const MyComponent: React.SFC = ({ foo: text }) => {text}; diff --git a/types/next-server/test/imports/with-default.tsx b/types/next-server/test/imports/with-default.tsx new file mode 100644 index 0000000000..f448a16680 --- /dev/null +++ b/types/next-server/test/imports/with-default.tsx @@ -0,0 +1,11 @@ +import * as React from "react"; + +interface Props { + foo: boolean; +} + +export default class MyComponent extends React.Component { + render() { + return this.props.foo ?

: null; + } +} diff --git a/types/next-server/test/next-server-dynamic-tests.tsx b/types/next-server/test/next-server-dynamic-tests.tsx index 07844cad08..ae4297e189 100644 --- a/types/next-server/test/next-server-dynamic-tests.tsx +++ b/types/next-server/test/next-server-dynamic-tests.tsx @@ -1,12 +1,7 @@ import * as React from "react"; import dynamic, { LoadingComponentProps } from "next-server/dynamic"; -// You'd typically do this via import('./MyComponent') -interface MyComponentProps { - foo: string; -} -const MyComponent: React.StatelessComponent = () =>
I'm async!
; -const asyncComponent = Promise.resolve(MyComponent); +const asyncComponent = import('./imports/with-default'); // Examples from // https://github.com/zeit/next.js/#dynamic-import @@ -17,30 +12,31 @@ const LoadingComponent: React.StatelessComponent = ({ }) =>

loading...

; // 1. Basic Usage (Also does SSR) -const DynamicComponent = dynamic(asyncComponent); -const dynamicComponentJSX = ; +const Test1 = dynamic(asyncComponent); +const test1JSX = ; // 1.1 Basic Usage (Loader function) -const DynamicComponent2 = dynamic(() => asyncComponent); -const dynamicComponent2JSX = ; +const Test1Func = dynamic(() => asyncComponent); +const test1FuncJSX = ; -// 2. With Custom Loading Component -const DynamicComponentWithCustomLoading = dynamic(asyncComponent, { - loading: LoadingComponent -}); -const dynamicComponentWithCustomLoadingJSX = ; - -// 3. With No SSR -const DynamicComponentWithNoSSR = dynamic(asyncComponent, { +// 2. With Custom Options +const Test2 = dynamic(() => asyncComponent, { + loading: LoadingComponent, ssr: false }); +const test2JSX = ; // 4. With Multiple Modules At Once -const HelloBundle = dynamic({ +// TODO: Mapped components still doesn't infer their props. +interface BundleComponentProps { + foo: string; +} + +const HelloBundle = dynamic({ modules: () => { const components = { - Hello1: asyncComponent, - Hello2: asyncComponent + Hello1: () => asyncComponent, + Hello2: () => asyncComponent }; return components; @@ -64,6 +60,6 @@ const LoadableComponent = dynamic({ }); // 6. No loading -const DynamicComponentWithNoLoading = dynamic(asyncComponent, { +const DynamicComponentWithNoLoading = dynamic(() => asyncComponent, { loading: () => null }); diff --git a/types/next-server/tsconfig.json b/types/next-server/tsconfig.json index 4d72dadef2..f05382ea65 100644 --- a/types/next-server/tsconfig.json +++ b/types/next-server/tsconfig.json @@ -33,6 +33,8 @@ "test/next-server-head-tests.tsx", "test/next-server-link-tests.tsx", "test/next-server-dynamic-tests.tsx", - "test/next-server-router-tests.tsx" + "test/next-server-router-tests.tsx", + "test/imports/no-default.tsx", + "test/imports/with-default.tsx" ] } diff --git a/types/next/test/next-constants-tests.ts b/types/next/test/next-constants-tests.ts deleted file mode 100644 index 64413ea97c..0000000000 --- a/types/next/test/next-constants-tests.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - PHASE_DEVELOPMENT_SERVER, - IS_BUNDLED_PAGE_REGEX -} from "next/constants"; - -const isIndexPage = IS_BUNDLED_PAGE_REGEX.test( - "static/CjW0mFnyG80HdP4eSUiy7/pages/index.js" -); - -// Example taken from: https://github.com/cyrilwanner/next-compose-plugins/blob/a25b313899638912cc9defc0be072f4fe4a1e855/README.md -const config = (nextConfig: any = {}) => { - return { - ...nextConfig, - - // define in which phases this plugin should get applied. - // you can also use multiple phases or negate them. - // however, users can still overwrite them in their configuration if they really want to. - phases: [PHASE_DEVELOPMENT_SERVER], - - webpack(config: any, options: any) { - // do something here which only gets applied during development server phase - - if (typeof nextConfig.webpack === "function") { - return nextConfig.webpack(config, options); - } - - return config; - } - }; -}; diff --git a/types/next/test/next-dynamic-tests.tsx b/types/next/test/next-dynamic-tests.tsx deleted file mode 100644 index 3e929e5cd0..0000000000 --- a/types/next/test/next-dynamic-tests.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import * as React from "react"; -import dynamic, { LoadingComponentProps } from "next/dynamic"; - -// You'd typically do this via import('./MyComponent') -interface MyComponentProps { - foo: string; -} -const MyComponent: React.FunctionComponent = () =>
I'm async!
; -const asyncComponent = Promise.resolve(MyComponent); - -// Examples from -// https://github.com/zeit/next.js/#dynamic-import - -const LoadingComponent: React.StatelessComponent = ({ - isLoading, - error -}) =>

loading...

; - -// 1. Basic Usage (Also does SSR) -const DynamicComponent = dynamic(asyncComponent); -const dynamicComponentJSX = ; - -// 2. With Custom Loading Component -const DynamicComponentWithCustomLoading = dynamic(asyncComponent, { - loading: LoadingComponent -}); -const dynamicComponentWithCustomLoadingJSX = ; - -// 3. With No SSR -const DynamicComponentWithNoSSR = dynamic(asyncComponent, { - ssr: false -}); - -// 4. With Multiple Modules At Once -const HelloBundle = dynamic({ - modules: () => { - const components = { - Hello1: asyncComponent, - Hello2: asyncComponent - }; - - return components; - }, - render: (props, { Hello1, Hello2 }) => ( -
-

{props.foo}

- - -
- ) -}); -const helloBundleJSX = ; - -// 5. With plain Loadable options -const LoadableComponent = dynamic({ - loader: () => asyncComponent, - loading: LoadingComponent, - delay: 200, - timeout: 10000 -}); - -// 6. No loading -const DynamicComponentWithNoLoading = dynamic(asyncComponent, { - loading: () => null -}); diff --git a/types/next/test/next-head-tests.tsx b/types/next/test/next-head-tests.tsx deleted file mode 100644 index 735402ca9a..0000000000 --- a/types/next/test/next-head-tests.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import Head, * as head from "next/head"; -import * as React from "react"; - -const elements: JSX.Element[] = head.defaultHead(); -const jsx = {elements}; - -if (!Head.canUseDOM) { - Head.rewind().map(x => [x.key, x.props, x.type]); -} - -Head.peek().map(x => [x.key, x.props, x.type]); diff --git a/types/next/test/next-link-tests.tsx b/types/next/test/next-link-tests.tsx deleted file mode 100644 index 2a85fec1ad..0000000000 --- a/types/next/test/next-link-tests.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import Link from "next/link"; -import * as React from "react"; - -const links = ( -
- { - console.log("Handled error!", e); - }} - prefetch - replace - scroll - shallow - > - Gotta link to somewhere! - - - All props are optional! - -
-); diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx deleted file mode 100644 index b06c1ad3a7..0000000000 --- a/types/next/test/next-router-tests.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import Router, { withRouter, WithRouterProps } from "next/router"; -import * as React from "react"; -import * as qs from "querystring"; - -Router.readyCallbacks.push(() => { - console.log("I'll get called when the router initializes."); -}); -Router.ready(() => { - console.log( - "I'll get called immediately if the router initializes, or when it eventually does.", - ); -}); - -// Access readonly properties of the router. - -Object.keys(Router.components).forEach(key => { - const c = Router.components[key]; - c.err.isAnAny; - - return ; -}); - -function split(routeLike: string) { - routeLike.split("/").forEach(part => { - console.log("path part: ", part); - }); -} - -if (Router.asPath) { - split(Router.asPath); - split(Router.asPath); -} - -split(Router.pathname); - -const query = `?${qs.stringify(Router.query)}`; - -// Assign some callback methods. -Router.events.on('routeChangeStart', (url: string) => console.log("Route is starting to change.", url)); -Router.events.on('beforeHistoryChange', (as: string) => console.log("History hasn't changed yet.", as)); -Router.events.on('routeChangeComplete', (url: string) => console.log("Route change is complete.", url)); -Router.events.on('routeChangeError', (err: any, url: string) => console.log("Route change errored.", err, url)); - -// Call methods on the router itself. -Router.reload("/route").then(() => console.log("route was reloaded")); -Router.back(); -Router.beforePopState(({ url }) => !!url); - -Router.push("/route").then((success: boolean) => - console.log("route push success: ", success), -); -Router.push("/route", "/asRoute").then((success: boolean) => - console.log("route push success: ", success), -); -Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => - console.log("route push success: ", success), -); - -Router.replace("/route").then((success: boolean) => - console.log("route replace success: ", success), -); -Router.replace("/route", "/asRoute").then((success: boolean) => - console.log("route replace success: ", success), -); -Router.replace("/route", "/asRoute", { - shallow: false, -}).then((success: boolean) => console.log("route replace success: ", success)); - -Router.prefetch("/route").then(Component => { - const element = ; -}); - -interface TestComponentProps { - testValue: string; -} - -class TestComponent extends React.Component { - state = { ready: false }; - - constructor(props: TestComponentProps & WithRouterProps) { - super(props); - if (props.router) { - props.router.ready(() => { - this.setState({ ready: true }); - }); - } - } - - render() { - return ( -
-

{this.state.ready ? 'Ready' : 'Not Ready'}

-

Route: {this.props.router ? this.props.router.route : ""}

-

Another prop: {this.props.testValue}

-
- ); - } -} - -withRouter(TestComponent); - -interface TestFCQuery { - test?: string; -} - -interface TestFCProps extends WithRouterProps { } - -const TestFC: React.FunctionComponent = ({ router }) => { - return
{router && router.query && router.query.test}
; -}; diff --git a/types/next/tsconfig.json b/types/next/tsconfig.json index 9981affbd3..41f6efc969 100644 --- a/types/next/tsconfig.json +++ b/types/next/tsconfig.json @@ -30,14 +30,9 @@ "router.d.ts", "config.d.ts", "test/next-tests.ts", - "test/next-constants-tests.ts", "test/next-app-tests.tsx", "test/next-error-tests.tsx", - "test/next-head-tests.tsx", "test/next-document-tests.tsx", - "test/next-link-tests.tsx", - "test/next-dynamic-tests.tsx", - "test/next-router-tests.tsx", "test/next-component-tests.tsx" ] } diff --git a/types/no-scroll/index.d.ts b/types/no-scroll/index.d.ts new file mode 100644 index 0000000000..b20b596a27 --- /dev/null +++ b/types/no-scroll/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for no-scroll 2.1 +// Project: https://github.com/davidtheclark/no-scroll +// Definitions by: Zhang Yi Jiang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Module is exported as global object outside of module loader environment +export as namespace noScroll; + +interface NoScroll { + off(): void; + on(): void; + toggle(): void; +} + +declare const noScroll: NoScroll; +export = noScroll; diff --git a/types/no-scroll/no-scroll-tests.ts b/types/no-scroll/no-scroll-tests.ts new file mode 100644 index 0000000000..c33ebcf799 --- /dev/null +++ b/types/no-scroll/no-scroll-tests.ts @@ -0,0 +1,5 @@ +import * as noScroll from 'no-scroll'; + +noScroll.on(); +noScroll.off(); +noScroll.toggle(); diff --git a/types/no-scroll/tsconfig.json b/types/no-scroll/tsconfig.json new file mode 100644 index 0000000000..f3d27166a1 --- /dev/null +++ b/types/no-scroll/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "no-scroll-tests.ts" + ] +} diff --git a/types/no-scroll/tslint.json b/types/no-scroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/no-scroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/node-cache/index.d.ts b/types/node-cache/index.d.ts index 6bac061ecb..61100a574d 100644 --- a/types/node-cache/index.d.ts +++ b/types/node-cache/index.d.ts @@ -283,3 +283,4 @@ declare class NodeCache extends events.EventEmitter implements NodeCache.NodeCac } export = NodeCache; +export as namespace NodeCache; diff --git a/types/node-jose/index.d.ts b/types/node-jose/index.d.ts new file mode 100644 index 0000000000..dc4caaeca5 --- /dev/null +++ b/types/node-jose/index.d.ts @@ -0,0 +1,335 @@ +// Type definitions for node-jose 1.1 +// Project: https://github.com/cisco/node-jose +// Definitions by: Nadun Indunil +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + +/// + +export function canYouSee(ks: JWK.Key | JWK.KeyStore, opts: object): JWS.Verifier; + +export namespace JWA { + interface DecryptEncryptOptions { + aad?: Buffer; + adata?: Buffer; + iv?: Buffer; + tag?: Buffer; // Not used in encrypt + mac?: Buffer; // Not used in encrypt + epu?: Buffer; // encryption party info + epv?: Buffer; // encryption party info + kdata?: Buffer; + epk?: Buffer; // ephemeral pub key used in ec + enc?: string; // algorithm to use in ec + alg?: string; // variation of enc, probably oversight in lib code + apu?: Buffer; // agreement party info used in ec + apv?: Buffer; // agreement party info used in ec + p2s?: Buffer; // used in pbes + p2c?: number; // used in pbes + } + + interface DeriveOptions { + length?: number; // key length + otherInfo?: Buffer; // info used in concatkdf + public?: Buffer; // public key used in ecdh + hash?: Buffer; // hash used in ecdh + salt?: Buffer; // salt value used in hkdf + info?: Buffer; // app identifier info used in hkdf + } + + interface EncryptReturn { + data: Buffer; // The cipher text + tag?: Buffer; // The tag used in some algorithms + } + + interface SignReturn { + data: Buffer; // the data passed into the sign function + mac: Buffer; // the signature for `data` + } + + interface SignVerifyOptions { + loose?: boolean; + } + + interface VerifyReturn { + data: Buffer; // the data passed into the verify function + mac: Buffer; // the signature for `data` + valid: boolean; // whether the signature matches the data + } + + function decrypt( + alg: string, + key: string | Buffer, + cdata: string | Buffer, + props?: DecryptEncryptOptions + ): Promise; + + function derive(alg: string, key: string | Buffer, props?: DeriveOptions): Promise; + + function digest(alg: string, data: string | Buffer, props?: any): Promise; + + function encrypt( + alg: string, + key: string | Buffer, + pdata: string | Buffer, + props?: DecryptEncryptOptions + ): Promise; + + function sign( + alg: string, + key: string | Buffer, + pdata: string | Buffer, + props: SignVerifyOptions + ): Promise; + + function verify( + alg: string, + key: string | Buffer, + pdata: string | Buffer, + mac: string | Buffer, + props: SignVerifyOptions + ): Promise; +} + +export namespace JWE { + function createEncrypt(keys: JWK.Key | JWK.Key[]): Encryptor; + function createEncrypt( + options: { + format?: 'compact' | 'flattened'; + zip?: boolean; + fields?: object; + }, + key: JWK.Key + ): Encryptor; + + function createDecrypt(key: JWK.Key | JWK.KeyStore, opts?: any): Decryptor; + + interface Encryptor { + update(input: any): this; + final(): Promise; + } + + interface Decryptor { + decrypt(input: string): Promise; + } + + interface DecryptResult { + /** + * an array of the member names from the "protected" member + */ + protected: string[]; + /** + * the decrypted content (alternate) + */ + plaintext: Buffer; + } +} + +export namespace JWK { + const MODE_DECRYPT: string; + + const MODE_ENCRYPT: string; + + const MODE_SIGN: string; + + const MODE_UNWRAP: string; + + const MODE_VERIFY: string; + + const MODE_WRAP: string; + + function asKey( + key: string | Buffer | object | RawKey, + form?: 'json' | 'private' | 'pkcs8' | 'public' | 'spki' | 'pkix' | 'x509' | 'pem' + ): Promise; + /** + * To import a JWK-set as a keystore + */ + function asKeyStore(ks: object | string): Promise; + + function createKey(kty: any, size: any, props: any): Promise; + /** + * To create an empty keystore + */ + function createKeyStore(): KeyStore; + + function isKey(input: any): input is Key; + + function isKeyStore(input: any): input is KeyStore; + + type KeyUse = 'sig' | 'enc' | 'desc'; + + interface JWEEncryptor { + update(input: any): this; + final(): Promise; + } + + interface RawKey { + alg: string; + kty: string; + use: KeyUse; + + // e and n make up the public key + e: string; + n: string; + } + + interface KeyStoreGetFilter { + kty?: string; + use?: KeyUse; + alg?: string; + } + + interface KeyStoreGetOptions extends KeyStoreGetFilter { + kid: string; + } + + interface KeyStore { + /** + * To export the public keys of a keystore as a JWK-set + */ + toJSON(exportPrivateKeys?: boolean): object; + /** + * To retrieve a key from a keystore + */ + get(kid: string, filter?: KeyStoreGetFilter): RawKey; + get(options: KeyStoreGetOptions): RawKey; + all(options?: Partial): RawKey[]; + add(key: RawKey): Promise; + /** + * @param key + * String serialization of a JSON JWK/(base64-encoded) PEM/(binary-encoded) DER + * Buffer of a JSON JWK/(base64-encoded) PEM/(binary-encoded) DER + * @param form + * is either a: + * - "json" for a JSON stringified JWK + * - "private" for a DER encoded 'raw' private key + * - "pkcs8" for a DER encoded (unencrypted!) PKCS8 private key + * - "public" for a DER encoded SPKI public key (alternate to 'spki') + * - "spki" for a DER encoded SPKI public key + * - "pkix" for a DER encoded PKIX X.509 certificate + * - "x509" for a DER encoded PKIX X.509 certificate + * - "pem" for a PEM encoded of PKCS8 / SPKI / PKIX + */ + add( + key: string | Buffer | Key | object, + form?: 'json' | 'private' | 'pkcs8' | 'public' | 'spki' | 'pkix' | 'x509' | 'pem' + ): Promise; + + generate(kty: string, size?: string | number, props?: any): Promise; + + remove(key: Key): void; + } + + interface Key { + keystore: KeyStore; + length: number; + kty: string; + kid: string; + use: KeyUse; + alg: string; + + toPEM(isPrivate?: boolean): string; + toJSON(isPrivate?: boolean, excluded?: string[]): object; + thumbprint(hash?: string): Promise; + } +} + +export namespace JWS { + function createSign(keys: JWK.Key | JWK.Key[]): Signer; + function createSign( + options: { + format?: 'compact' | 'flattened'; + alg?: string; + compact?: boolean; + fields?: object; + }, + key: JWK.Key | JWK.Key[] + ): Signer; + + /** + * Using a keystore. + */ + function createVerify( + input?: string | JWK.Key | JWK.KeyStore | object, + opts?: { allowEmbeddedKey?: boolean; algorithms?: string[]; handlers?: any } + ): Verifier; + + interface CreateSignResult { + signResult: object; + } + + interface Signer { + update(input: Buffer | string, encoding?: string): this; + final(): Promise; + } + + interface BaseResult { + /** + * the combined 'protected' and 'unprotected' header members + */ + header: object; + /** + * the signed content + */ + payload: Buffer; + /** + * The key used to verify the signature + */ + key: JWK.Key; + protected: string[]; + } + + interface VerificationResult extends BaseResult { + /** + * the verified signature + */ + signature: Buffer | string; + } + + interface Verifier { + verify(input: string, opts?: { allowEmbeddedKey?: boolean }): Promise; + } + + interface Exp { + complete(jws: any): any; + } + + interface VerifyOptions { + allowEmbeddedKey?: boolean; + algorithms?: string[]; + handlers: { exp: boolean | Exp }; + } +} + +export function parse(input: Buffer | string | object): parse.ParseReturn; + +export namespace parse { + interface ParseReturn { + type: 'JWS' | 'JWE'; + format: 'compact' | 'json'; + input: Buffer | string | object; + header: object; + perform: (ks: JWK.KeyStore) => Promise | Promise; + } + function compact(input: Buffer | string | object): ParseReturn; + + function json(input: Buffer | string | object): ParseReturn; +} + +export namespace util { + function asBuffer(input: string | Buffer, encoding?: string): Buffer; + + function randomBytes(len: number): Buffer; + + namespace base64url { + function decode(base64url: string): string; + + function encode(buffer: string | Buffer, encoding?: string): string; + } + + namespace utf8 { + function decode(input: string): string; + + function encode(input: string): string; + } +} diff --git a/types/node-jose/node-jose-tests.ts b/types/node-jose/node-jose-tests.ts new file mode 100644 index 0000000000..dbeaccc9dc --- /dev/null +++ b/types/node-jose/node-jose-tests.ts @@ -0,0 +1,276 @@ +import * as jose from 'node-jose'; + +const keystore = jose.JWK.createKeyStore(); +const output = keystore.toJSON(); +keystore.toJSON(true); + +jose.JWK.asKeyStore('input').then(result => {}); + +let key = keystore.get('kid'); + +key = keystore.get('kid', { kty: 'RSA' }); + +// ... and by 'use' +key = keystore.get('kid', { use: 'enc' }); + +// ... and by 'alg' +key = keystore.get('kid', { alg: 'RSA-OAEP' }); + +// ... and by 'kty' and 'use' +key = keystore.get('kid', { kty: 'RSA', use: 'enc' }); + +// same as above, but with a single {props} argument +key = keystore.get({ kid: 'kid', kty: 'RSA', use: 'enc' }); + +let everything = keystore.all(); + +// filter by 'kid' +everything = keystore.all({ kid: 'kid' }); + +// filter by 'kty' +everything = keystore.all({ kty: 'RSA' }); + +// filter by 'use' +everything = keystore.all({ use: 'enc' }); + +// filter by 'alg' +everything = keystore.all({ alg: 'RSA-OAEP' }); + +// filter by 'kid' + 'kty' + 'alg' +everything = keystore.all({ kid: 'kid', kty: 'RSA', alg: 'RSA-OAEP' }); + +keystore.add('input').then(result => {}); + +keystore.add('input', 'json').then(result => { + // {result} is a jose.JWK.Key +}); + +keystore.generate('oct', 256).then(result => { + // {result} is a jose.JWK.Key +}); + +// ... with properties +const props = { + kid: 'gBdaS-G8RLax2qgObTD94w', + alg: 'A256GCM', + use: 'enc' +}; + +let key2: jose.JWK.Key; +keystore.generate('oct', 256, props).then(result => { + key2 = result; + keystore.remove(key2); + + jose.JWK.asKey(key2).then(result => {}); + + jose.JWK.asKey('input', 'json').then(result => {}); +}); + +jose.JWK.createKey('oct', 256, { alg: 'A256GCM' }).then(result => { + const output4 = result.toJSON(true); + result.thumbprint('hash').then(print => {}); + + const key = result; + + jose.JWS.createSign(key) + .update('input') + .final() + .then(result => { + // {result} is a JSON object -- JWS using the JSON General Serialization + }); + + jose.JWS.createSign({ format: 'flattened' }, key) + .update('input') + .final() + .then(result => { + // {result} is a JSON object -- JWS using the JSON Flattened Serialization + }); + + jose.JWS.createSign({ format: 'compact' }, key) + .update('input') + .final() + .then(result => { + // {result} is a String -- JWS using the Compact Serialization + }); + + jose.JWS.createSign({ alg: 'PS256' }, key) + .update('input') + .final() + .then(result => { + // .... + }); + + jose.JWS.createSign({ fields: { cty: 'jwk+json' } }, key) + .update('input') + .final() + .then(result => { + // .... + }); + + jose.JWS.createSign(key) + .update('input', 'utf8') + .final() + .then(result => { + // .... + }); + + let opts = { + algorithms: ['PS*'] + }; + jose.JWS.createVerify(key, opts) + .verify('input') + .then(result => { + // ... + }); + + opts = { + algorithms: ['*', '!HS*'] + }; + jose.JWS.createVerify(key, opts) + .verify('input') + .then(result => { + // ... + }); + + const opts2 = { + handlers: { + exp: true + } + }; + + jose.JWS.createVerify(key, opts2) + .verify('input') + .then(result => { + // ... + }); + + jose.JWE.createEncrypt(key) + .update('input') + .final() + .then(result => { + // {result} is a JSON Object -- JWE using the JSON General Serialization + }); + + jose.JWE.createEncrypt({ format: 'compact' }, key) + .update('input') + .final() + .then(result => { + // {result} is a String -- JWE using the Compact Serialization + }); + + jose.JWE.createEncrypt({ format: 'flattened' }, key) + .update('input') + .final() + .then(result => { + // {result} is a JSON Object -- JWE using the JSON Flattened Serialization + }); + + jose.JWE.createEncrypt({ zip: true }, key) + .update('input') + .final() + .then(result => { + // .... + }); + + jose.JWE.createEncrypt({ fields: { cty: 'jwk+json' } }, key) + .update('input') + .final() + .then(result => { + // .... + }); + + jose.JWE.createEncrypt([key, key]) + .update('input') + .final() + .then(result => { + // .... + }); + + jose.JWE.createDecrypt(key) + .decrypt('input') + .then(result => { + // .... + }); + + const opts3 = { + algorithms: ['dir', 'A*GCM'] + }; + jose.JWE.createDecrypt(key, opts3) + .decrypt('input') + .then(result => { + // ... + }); + + const opts4 = { + algorithms: ['*', '!RSA*'] + }; + jose.JWS.createVerify(key, opts4) + .verify('input') + .then(result => { + // ... + }); + + const opts5 = { + handlers: { + exp: true + } + }; + jose.JWE.createDecrypt(key, opts5) + .decrypt('input') + .then(result => { + // ... + }); +}); + +jose.JWS.createVerify(keystore) + .verify('input') + .then(result => { + // {result} is a Object with: + // * header: the combined 'protected' and 'unprotected' header members + // * payload: Buffer of the signed content + // * signature: Buffer of the verified signature + // * key: The key used to verify the signature + }); + +// {key} can be: +// * jose.JWK.Key +// * JSON object representing a JWK +jose.JWS.createVerify(key) + .verify('input') + .then(result => { + // ... + }); + +jose.JWS.createVerify() + .verify('input', { allowEmbeddedKey: true }) + .then(result => { + // ... + }); + +const verifier = jose.JWS.createVerify({ allowEmbeddedKey: true }); + +verifier.verify('input').then(result => { + // ... +}); + +jose.JWE.createDecrypt(keystore) + .decrypt('input') + .then(result => { + // {result} is a Object with: + // * header: the combined 'protected' and 'unprotected' header members + // * protected: an array of the member names from the "protected" member + // * key: Key used to decrypt + // * payload: Buffer of the decrypted content + // * plaintext: Buffer of the decrypted content (alternate) + }); + +jose.util.asBuffer('input'); + +jose.util.base64url.encode('input'); +jose.util.base64url.encode('input', 'utf8'); + +jose.util.base64url.encode('input'); + +jose.util.base64url.decode('input'); + +jose.util.randomBytes(32); diff --git a/types/dd-trace/tsconfig.json b/types/node-jose/tsconfig.json similarity index 94% rename from types/dd-trace/tsconfig.json rename to types/node-jose/tsconfig.json index 6e65e3983c..c01c2b1fb7 100644 --- a/types/dd-trace/tsconfig.json +++ b/types/node-jose/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "dd-trace-tests.ts" + "node-jose-tests.ts" ] } \ No newline at end of file diff --git a/types/node-jose/tslint.json b/types/node-jose/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/node-jose/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/node-sass-middleware/index.d.ts b/types/node-sass-middleware/index.d.ts index badbd843d1..53cde2a10a 100644 --- a/types/node-sass-middleware/index.d.ts +++ b/types/node-sass-middleware/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/sass/node-sass-middleware // Definitions by: Pascal Garber // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.7 diff --git a/types/node-sass/index.d.ts b/types/node-sass/index.d.ts index b208b57f19..f5445689b4 100644 --- a/types/node-sass/index.d.ts +++ b/types/node-sass/index.d.ts @@ -1,56 +1,410 @@ -// Type definitions for Node Sass v3.10.1 +// Type definitions for node-sass 4.11 // Project: https://github.com/sass/node-sass -// Definitions by: Asana +// Definitions by: Asana , Chris Eppstein // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 /// -type ImporterReturnType = { file: string } | { contents: string } | Error | null; +export type ImporterReturnType = { file: string } | { file?: string; contents: string } | Error | null | types.Null | types.Error; -interface Importer { - (url: string, prev: string, done: (data: ImporterReturnType) => void): ImporterReturnType | void; +/** + * The context value is a value that is shared for the duration of a single render. + * The context object is the implicit `this` for importers and sass functions + * that are implemented in javascript. + * + * A render can be detected as asynchronous if the `callback` property is set on the context object. + */ +export interface Context { + options: Options; + callback: SassRenderCallback | undefined; + [data: string]: any; } -interface Options { - file?: string; - data?: string; - importer?: Importer | Importer[]; - functions?: { [key: string]: Function }; - includePaths?: string[]; - indentedSyntax?: boolean; - indentType?: string; - indentWidth?: number; - linefeed?: string; - omitSourceMapUrl?: boolean; - outFile?: string; - outputStyle?: "compact" | "compressed" | "expanded" | "nested"; - precision?: number; - sourceComments?: boolean; - sourceMap?: boolean | string; - sourceMapContents?: boolean; - sourceMapEmbed?: boolean; - sourceMapRoot?: string; +export interface AsyncContext extends Context { + callback: SassRenderCallback; } -interface SassError extends Error { - message: string; - line: number; - column: number; - status: number; - file: string; +export interface SyncContext extends Context { + callback: undefined; } -interface Result { - css: Buffer; - map: Buffer; - stats: { - entry: string; - start: number; - end: number; - duration: number; - includedFiles: string[]; - } +export type AsyncImporter = (this: AsyncContext, url: string, prev: string, done: (data: ImporterReturnType) => void) => void; +export type SyncImporter = (this: SyncContext, url: string, prev: string) => ImporterReturnType; +export type Importer = AsyncImporter | SyncImporter; + +// These function types enumerate up to 6 js arguments. More than that will be incorrectly marked by the compiler as an error. + +// ** Sync Sass functions receiving fixed # of arguments *** +export type SyncSassFn = (this: SyncContext, ...$args: types.Value[]) => types.ReturnValue; + +/* tslint:disable:max-line-length */ +// ** Sync Sass functions receiving variable # of arguments *** +export type SyncSassVarArgFn1 = (this: SyncContext, $arg1: types.Value[]) => types.ReturnValue; +export type SyncSassVarArgFn2 = (this: SyncContext, $arg1: types.Value, $arg2: types.Value[]) => types.ReturnValue; +export type SyncSassVarArgFn3 = (this: SyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value[]) => types.ReturnValue; +export type SyncSassVarArgFn4 = (this: SyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value[]) => types.ReturnValue; +export type SyncSassVarArgFn5 = (this: SyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, $arg5: types.Value[]) => types.ReturnValue; +export type SyncSassVarArgFn6 = (this: SyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, $arg5: types.Value, $arg6: types.Value[]) => types.ReturnValue; + +export type SassFunctionCallback = ($result: types.ReturnValue) => void; + +// ** Async Sass functions receiving fixed # of arguments *** +export type AsyncSassFn0 = (this: AsyncContext, cb: SassFunctionCallback) => void; +export type AsyncSassFn1 = (this: AsyncContext, $arg1: types.Value, cb: SassFunctionCallback) => void; +export type AsyncSassFn2 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, cb: SassFunctionCallback) => void; +export type AsyncSassFn3 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, cb: SassFunctionCallback) => void; +export type AsyncSassFn4 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, cb: SassFunctionCallback) => void; +export type AsyncSassFn5 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, $arg5: types.Value, cb: SassFunctionCallback) => void; +export type AsyncSassFn6 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, $arg5: types.Value, $arg6: types.Value, cb: SassFunctionCallback) => void; + +// *** Async Sass Functions receiving variable # of arguments *** +export type AsyncSassVarArgFn1 = (this: AsyncContext, $arg1: types.Value[], cb: SassFunctionCallback) => void; +export type AsyncSassVarArgFn2 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value[], cb: SassFunctionCallback) => void; +export type AsyncSassVarArgFn3 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value[], cb: SassFunctionCallback) => void; +export type AsyncSassVarArgFn4 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value[], cb: SassFunctionCallback) => void; +export type AsyncSassVarArgFn5 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, $arg5: types.Value[], cb: SassFunctionCallback) => void; +export type AsyncSassVarArgFn6 = (this: AsyncContext, $arg1: types.Value, $arg2: types.Value, $arg3: types.Value, $arg4: types.Value, $arg5: types.Value, $arg6: types.Value[], cb: SassFunctionCallback) => void; +/* tslint:enable:max-line-length */ + +export type SyncSassFunction = SyncSassFn | SyncSassVarArgFn1 | SyncSassVarArgFn2 | SyncSassVarArgFn3 | SyncSassVarArgFn4 | SyncSassVarArgFn5 | SyncSassVarArgFn6; + +export type AsyncSassFunction = AsyncSassFn0 | AsyncSassFn1 | AsyncSassFn2 | AsyncSassFn3 | AsyncSassFn4 | AsyncSassFn5 | AsyncSassFn6 + | AsyncSassVarArgFn1 | AsyncSassVarArgFn2 | AsyncSassVarArgFn3 | AsyncSassVarArgFn4 | AsyncSassVarArgFn5 | AsyncSassVarArgFn6; + +export type SassFunction = SyncSassFunction | AsyncSassFunction; + +export type FunctionDeclarations = Record; + +export interface Options { + file?: string; + data?: string; + importer?: Importer | Importer[]; + functions?: FunctionDeclarations; + includePaths?: string[]; + indentedSyntax?: boolean; + indentType?: string; + indentWidth?: number; + linefeed?: string; + omitSourceMapUrl?: boolean; + outFile?: string; + outputStyle?: "compact" | "compressed" | "expanded" | "nested"; + precision?: number; + sourceComments?: boolean; + sourceMap?: boolean | string; + sourceMapContents?: boolean; + sourceMapEmbed?: boolean; + sourceMapRoot?: string; + [key: string]: any; } -export declare function render(options: Options, callback: (err: SassError, result: Result) => any): void; -export declare function renderSync(options: Options): Result; +export interface SyncOptions extends Options { + functions?: FunctionDeclarations; + importer?: SyncImporter | SyncImporter[]; +} + +/** + * The error object returned to javascript by sass's render methods. + * + * This is not the same thing as types.Error. + */ +export interface SassError extends Error { + message: string; + line: number; + column: number; + status: number; + file: string; +} + +/** + * The result of successfully compiling a Sass file. + */ +export interface Result { + css: Buffer; + map: Buffer; + stats: { + entry: string; + start: number; + end: number; + duration: number; + includedFiles: string[]; + }; +} +export type SassRenderCallback = (err: SassError, result: Result) => any; + +// Note, most node-sass constructors can be invoked as a function or with a new +// operator. The exception: the types Null and Boolean for which new is +// forbidden. +// +// Because of this, the new-able object notation is used here, a class does not +// work for these types. +export namespace types { + /* eslint-disable @typescript-eslint/ban-types */ + /* tslint:disable:ban-types */ + /** + * Values that are received from Sass as an argument to a javascript function. + */ + export type Value = Null | Number | String | Color | Boolean | List | Map; + + /** + * Values that are legal to return to Sass from a javascript function. + */ + export type ReturnValue = Value | Error; + + // *** Sass Null *** + + export interface Null { + /** + * This property doesn't exist, but its presence forces the typescript + * compiler to properly type check this type. Without it, it seems to + * allow things that aren't types.Null to match it in case statements and + * assignments. + */ + readonly ___NULL___: unique symbol; + } + + interface NullConstructor { + (): Null; + NULL: Null; + } + export const Null: NullConstructor; + + // *** Sass Number *** + + export interface Number { + getValue(): number; + setValue(n: number): void; + getUnit(): string; + setUnit(u: string): void; + } + interface NumberConstructor { + /** + * Constructs a new Sass number. Does not require use of the `new` keyword. + */ + new(value: number, unit?: string): Number; + /** + * Constructs a new Sass number. Can also be used with the `new` keyword. + */ + (value: number, unit?: string): Number; + } + + export const Number: NumberConstructor; + + // *** Sass String *** + + export interface String { + getValue(): string; + setValue(s: string): void; + } + + interface StringConstructor { + /** + * Constructs a new Sass string. Does not require use of the `new` keyword. + */ + new (value: string): String; + /** + * Constructs a new Sass string. Can also be used with the `new` keyword. + */ + (value: string): String; + } + + export const String: StringConstructor; + + // *** Sass Color *** + + export interface Color { + /** + * Get the red component of the color. + * @returns integer between 0 and 255 inclusive; + */ + getR(): number; + /** + * Set the red component of the color. + * @returns integer between 0 and 255 inclusive; + */ + setR(r: number): void; + /** + * Get the green component of the color. + * @returns integer between 0 and 255 inclusive; + */ + getG(): number; + /** + * Set the green component of the color. + * @param g integer between 0 and 255 inclusive; + */ + setG(g: number): void; + /** + * Get the blue component of the color. + * @returns integer between 0 and 255 inclusive; + */ + getB(): number; + /** + * Set the blue component of the color. + * @param b integer between 0 and 255 inclusive; + */ + setB(b: number): void; + /** + * Get the alpha transparency component of the color. + * @returns number between 0 and 1 inclusive; + */ + getA(): number; + /** + * Set the alpha component of the color. + * @param a number between 0 and 1 inclusive; + */ + setA(a: number): void; + } + + interface ColorConstructor { + /** + * Constructs a new Sass color given the RGBA component values. Do not invoke with the `new` keyword. + * + * @param r integer 0-255 inclusive + * @param g integer 0-255 inclusive + * @param b integer 0-255 inclusive + * @param [a] float 0 - 1 inclusive + * @returns a SassColor instance. + */ + new (r: number, g: number, b: number, a?: number): Color; + + /** + * Constructs a new Sass color given a 4 byte number. Do not invoke with the `new` keyword. + * + * If a single number is passed it is assumed to be a number that contains + * all the components which are extracted using bitmasks and bitshifting. + * + * @param hexN A number that is usually written in hexadecimal form. E.g. 0xff0088cc. + * @returns a Sass Color instance. + * @example + * // Comparison with byte array manipulation + * let a = new ArrayBuffer(4); + * let hexN = 0xCCFF0088; // 0xAARRGGBB + * let a32 = new Uint32Array(a); // Uint32Array [ 0 ] + * a32[0] = hexN; + * let a8 = new Uint8Array(a); // Uint8Array [ 136, 0, 255, 204 ] + * let componentBytes = [a8[2], a8[1], a8[0], a8[3] / 255] // [ 136, 0, 255, 0.8 ] + * let c = sass.types.Color(hexN); + * let components = [c.getR(), c.getG(), c.getR(), c.getA()] // [ 136, 0, 255, 0.8 ] + * assert.deepEqual(componentBytes, components); // does not raise. + */ + new (hexN: number): Color; + + /** + * Constructs a new Sass color given the RGBA component values. Do not invoke with the `new` keyword. + * + * @param r integer 0-255 inclusive + * @param g integer 0-255 inclusive + * @param b integer 0-255 inclusive + * @param [a] float 0 - 1 inclusive + * @returns a SassColor instance. + */ + (r: number, g: number, b: number, a?: number): Color; + + /** + * Constructs a new Sass color given a 4 byte number. Do not invoke with the `new` keyword. + * + * If a single number is passed it is assumed to be a number that contains + * all the components which are extracted using bitmasks and bitshifting. + * + * @param hexN A number that is usually written in hexadecimal form. E.g. 0xff0088cc. + * @returns a Sass Color instance. + * @example + * // Comparison with byte array manipulation + * let a = new ArrayBuffer(4); + * let hexN = 0xCCFF0088; // 0xAARRGGBB + * let a32 = new Uint32Array(a); // Uint32Array [ 0 ] + * a32[0] = hexN; + * let a8 = new Uint8Array(a); // Uint8Array [ 136, 0, 255, 204 ] + * let componentBytes = [a8[2], a8[1], a8[0], a8[3] / 255] // [ 136, 0, 255, 0.8 ] + * let c = sass.types.Color(hexN); + * let components = [c.getR(), c.getG(), c.getR(), c.getA()] // [ 136, 0, 255, 0.8 ] + * assert.deepEqual(componentBytes, components); // does not raise. + */ + (hexN: number): Color; + } + + export const Color: ColorConstructor; + + // *** Sass Boolean *** + + export interface Boolean { + getValue(): boolean; + } + + interface BooleanConstructor { + (bool: boolean): Boolean; + TRUE: Boolean; + FALSE: Boolean; + } + + export const Boolean: BooleanConstructor; + + // *** Sass List *** + + export interface Enumerable { + getValue(index: number): Value; + setValue(index: number, value: Value): void; + getLength(): number; + } + + export interface List extends Enumerable { + getSeparator(): boolean; + setSeparator(isComma: boolean): void; + } + interface ListConstructor { + new (length: number, commaSeparator?: boolean): List; + (length: number, commaSeparator?: boolean): List; + } + export const List: ListConstructor; + + // *** Sass Map *** + + export interface Map extends Enumerable { + getKey(index: number): Value; + setKey(index: number, key: Value): void; + } + interface MapConstructor { + new (length: number): Map; + (length: number): Map; + } + export const Map: MapConstructor; + + // *** Sass Error *** + + export interface Error { + /** + * This property doesn't exist, but its presence forces the typescript + * compiler to properly type check this type. Without it, it seems to + * allow things that aren't types.Error to match it in case statements and + * assignments. + */ + readonly ___SASS_ERROR___: unique symbol; + // why isn't there a getMessage() method? + } + + interface ErrorConstructor { + /** + * An error return value for async functions. + * For synchronous functions, this can be returned or a standard error object can be thrown. + */ + new (message: string): Error; + /** + * An error return value for async functions. + * For synchronous functions, this can be returned or a standard error object can be thrown. + */ + (message: string): Error; + } + export const Error: ErrorConstructor; + + /* eslint-enable @typescript-eslint/ban-types */ + /* tslint:enable:ban-types */ +} + +// *** Top level Constants *** + +export const NULL: types.Null; +export const TRUE: types.Boolean; +export const FALSE: types.Boolean; +export const info: string; +export function render(options: Options, callback: SassRenderCallback): void; +export function renderSync(options: SyncOptions): Result; diff --git a/types/node-sass/node-sass-tests.ts b/types/node-sass/node-sass-tests.ts index 4de32d7d06..e8ae73cef7 100644 --- a/types/node-sass/node-sass-tests.ts +++ b/types/node-sass/node-sass-tests.ts @@ -1,48 +1,193 @@ import * as sass from 'node-sass'; -sass.render({ - file: '/path/to/myFile.scss', - data: 'body{background:blue; a{color:black;}}', - importer: function(url, prev, done) { - someAsyncFunction(url, prev, function(result) { - if (result == null) { - // return null to opt out of handling this path - // compiler will fall to next importer in array (or its own default) - return null; - } - // only one of them is required, see section Sepcial Behaviours. - done({ file: result.path }); - done({ contents: result.data }); - }); - }, - includePaths: ['lib/', 'mod/'], - outputStyle: 'compressed' -}, function(error, result) { // node-style callback from v3.0.0 onwards +console.log(sass.info); + +const syncImporter: sass.SyncImporter = function(url, prev) { + if (url.startsWith('!')) { + return sass.NULL; + } + if (url.endsWith('?')) { + return sass.types.Error("cannot question mark"); + } + console.log(typeof this.callback); // "undefined" + return { file: [prev, url].join('/') }; +}; + +const asyncImporter: sass.AsyncImporter = function(url, prev, done) { + if (url.startsWith('!')) { + // shouldn't really call twice, just checking for compiler validity + done(null); + done(sass.NULL); + } + if (url.endsWith('?')) { + // shouldn't really call twice, just checking for compiler validity + done(new sass.types.Error('Cannot accept this file')); + done(new Error('Cannot accept this file')); + } else { + console.log(this.options.file); // "string" + console.log(typeof this.callback); // "function" + done({ file: [prev, url].join('/') }); + } +}; + +const anotherAsyncImporter: sass.AsyncImporter = (url, prev, done) => { + someAsyncFunction(url, prev, (result) => { + if (result == null) { + // return null to opt out of handling this path + // compiler will fall to next importer in array (or its own default) + done(null); + } + // only one of them is required, see section Special Behaviors. + done({ file: result.path }); + done({ contents: result.data }); + }); +}; + +const handleAsyncResult: sass.SassRenderCallback = (error, result) => { // node-style callback from v3.0.0 onwards if (error) { console.log(error.status, error.column, error.message, error.line); - } - else { + } else { console.log(result.stats); console.log(result.css.toString()); console.log(result.map.toString()); // or better console.log(JSON.stringify(result.map)); // note, JSON.stringify accepts Buffer too } -}); +}; + +const syncFunction: Record = { + "pow($base, $exp)"($base, $exp) { + console.log(this.options.file); // "string" + console.log(typeof this.callback); // "undefined" + if ($base instanceof sass.types.Number && $exp instanceof sass.types.Number) { + if ($base.getUnit() !== "" || $exp.getUnit() !== "") { + throw new Error("Cannot have units in an exponent"); + } + return new sass.types.Number(Math.pow($base.getValue(), $exp.getValue())); + } else { + throw new Error("Number expected"); + } + } +}; + +const syncVarArg: Record = { + "add-all($n1, $n2, $ns...)"($n1, $n2, $ns) { + if (!($n1 instanceof sass.types.Number)) { + throw new Error("Expected a number"); + } + if (!($n2 instanceof sass.types.Number)) { + throw new Error("Expected a number"); + } + const unit = $n1.getUnit(); + if ($n2.getUnit() !== unit) { + throw new Error("units don't match"); + } + let accum = $n1.getValue() + $n2.getValue(); + $ns.forEach(($n) => { + if (!($n instanceof sass.types.Number)) { + throw new Error("Expected a number"); + } + if ($n.getUnit() !== unit) { + throw new Error("units don't match"); + } + accum = accum + $n.getValue(); + }); + return sass.types.Number(accum, unit); + } +}; + +const syncFunctions: Record = {...syncFunction, ...syncVarArg}; + +const asyncFunction: Record = { + "pow-async($base, $exp)"($base, $exp, done) { + console.log(this.options.file); // "string" + console.log(typeof this.callback); // "function" + if ($base instanceof sass.types.Number && $exp instanceof sass.types.Number) { + if ($base.getUnit() !== "" || $exp.getUnit() !== "") { + done(new sass.types.Error("Cannot have units in an exponent")); + } + done(new sass.types.Number(Math.pow($base.getValue(), $exp.getValue()))); + } else { + done(new sass.types.Error("Number expected")); + } + } +}; + +const asyncVarArg: Record = { + "add-all-async($n1, $n2, $ns...)"($n1, $n2, $ns, done) { + if (!($n1 instanceof sass.types.Number)) { + done(new sass.types.Error("Expected a number")); + return; + } + if (!($n2 instanceof sass.types.Number)) { + done(new sass.types.Error("Expected a number")); + return; + } + const unit = $n1.getUnit(); + if ($n2.getUnit() !== unit) { + done(new sass.types.Error("units don't match")); + return; + } + let accum = $n1.getValue() + $n2.getValue(); + for (const $n of $ns) { + if (!($n instanceof sass.types.Number)) { + done(new sass.types.Error("Expected a number")); + return; + } + if ($n.getUnit() !== unit) { + done(new sass.types.Error("units don't match")); + return; + } + accum = accum + $n.getValue(); + } + done(sass.types.Number(accum, unit)); + } +}; + +const asyncFunctions: Record = {...asyncFunction, ...asyncVarArg}; + +const functions: sass.FunctionDeclarations = {...syncFunctions, ...asyncFunctions}; + +sass.render({ + file: '/path/to/myFile.scss', + data: 'body{background:blue; a{color:black;}}', + functions, + importer: [anotherAsyncImporter, asyncImporter, syncImporter], + includePaths: ['lib/', 'mod/'], + outputStyle: 'compressed' +}, handleAsyncResult); + // OR + +sass.render({ + file: '/path/to/myFile.scss', + data: 'body{background:blue; a{color:black;}}', + importer: asyncImporter, + includePaths: ['lib/', 'mod/'], + outputStyle: 'compressed' +}, handleAsyncResult); + +// OR + +sass.render({ + file: '/path/to/myFile.scss', + data: 'body{background:blue; a{color:black;}}', + importer: syncImporter, + includePaths: ['lib/', 'mod/'], + outputStyle: 'compressed' +}, handleAsyncResult); + +// OR + const result = sass.renderSync({ file: '/path/to/file.scss', data: 'body{background:blue; a{color:black;}}', outputStyle: 'compressed', + functions: syncFunctions, outFile: '/to/my/output.css', sourceMap: true, // or an absolute or relative (to outFile) path sourceMapRoot: '.', - importer: function(url, prev) { - if (url.startsWith('!')) { - return new Error('Cannot accept this file'); - } - return { file: [prev, url].join('/') }; - }, + importer: syncImporter, }); console.log(result.css); @@ -50,6 +195,104 @@ console.log(result.map); console.log(result.stats); function someAsyncFunction(url: string, prev: string, callback: (result: { path: string; data: string }) => void): void { } -function someSyncFunction(url: string, prev: string): { path: string; data: string } { - return null; + +function sameType(v1: V, v2: V): boolean { + return v1.constructor === v2.constructor; } + +// function-based Constructors and instance methods for types +const true1 = sass.types.Boolean(true); +true1.getValue(); // true +const true2 = sass.types.Boolean.TRUE; +const true3 = sass.TRUE; +sameType(true2, true3); +true2 === true3; // true +const false1 = sass.types.Boolean(false); +const false2 = sass.types.Boolean.FALSE; +const false3 = sass.FALSE; +false2 === false3; // true +false1.getValue(); // false +const null1 = sass.types.Null(); +const null2 = sass.types.Null.NULL; +const null3 = sass.NULL; +sameType(null2, null3); +null1 === null2; // true +null1 === null3; // true +const ident = sass.types.String("x"); +ident.getValue(); // 'x' +const stringQuoted = sass.types.String("'x'"); +stringQuoted.getValue(); // '\'x\'' +const number = sass.types.Number(5); +number.getUnit(); // "" +number.getValue(); // 5 +const dimension = sass.types.Number(5, "px"); +dimension.getUnit(); // "px" +const redOpaque = sass.types.Color(240, 15, 0); +redOpaque.getR(); // 240 +redOpaque.getG(); // 15 +redOpaque.getB(); // 0 +redOpaque.getA(); // 1 +const redTranslucent = sass.types.Color(240, 15, 0, 0.5); +redTranslucent.getA(); // 0.5 +const redOpaque2 = sass.types.Color(0xF00F00FF); +redOpaque2.getR(); // 240 +redOpaque2.getG(); // 15 +redOpaque2.getB(); // 0 +redOpaque2.getA(); // 1 +const redTranslucent2 = sass.types.Color(0xF00F007F); +redTranslucent.getA(); // 0.5 +const spaceList1 = sass.types.List(1); +spaceList1.getLength(); // 1 +spaceList1.getSeparator(); // false +spaceList1.setValue(0, ident); +spaceList1.setValue(0, true1); +spaceList1.setValue(0, false1); +spaceList1.setValue(0, null1); +spaceList1.setValue(0, dimension); +spaceList1.setValue(0, redOpaque); +spaceList1.getValue(0) === redOpaque; // true +const spaceList2 = sass.types.List(1, false); +spaceList2.setValue(0, sass.types.String("s")); +const commaList1 = sass.types.List(2, true); +commaList1.getLength(); // 2 +commaList1.getSeparator(); // true (it's a comma) +commaList1.setValue(0, spaceList1); +commaList1.setValue(2, spaceList2); +const map1 = sass.types.Map(2); +map1.getLength(); // 2 +map1.setKey(0, ident); +map1.setValue(0, spaceList1); +ident === map1.getKey(0); // true +spaceList1 === map1.getValue(1); // true +sameType(ident, map1.getKey(0)); // true +const error = new sass.types.Error("message"); + +function valuesOf(enumerable: sass.types.Enumerable): sass.types.Value[] { + const values = new Array(); + for (let i = 0; i < enumerable.getLength(); i++) { + values.push(enumerable.getValue(i)); + } + return values; +} + +let arr = valuesOf(map1); +console.dir(arr); +arr = valuesOf(commaList1); +console.dir(arr); + +// new-based Constructors +// boolean and null raise a runtime error if constructed with new. +// const newTrue = new sass.types.Boolean(true); +// const newFalse = new sass.types.Boolean(false); +// const newNull = new sass.types.Null(); +const newIdent = new sass.types.String("x"); +const newNumber = new sass.types.Number(5); +const newDimension = new sass.types.Number(5, "px"); +const newRedOpaque = new sass.types.Color(240, 15, 0); +const newRedTranslucent = new sass.types.Color(240, 15, 0, 0.5); +const newRedOpaque2 = new sass.types.Color(0xF00F00FF); +const newSpaceList1 = new sass.types.List(1); +const newSpaceList2 = new sass.types.List(1, false); +const newCommaList1 = new sass.types.List(2, true); +const newMap1 = new sass.types.Map(2); +const newError = new sass.types.Error("message"); diff --git a/types/node-sass/tsconfig.json b/types/node-sass/tsconfig.json index a1e4cdb079..172d6270c7 100644 --- a/types/node-sass/tsconfig.json +++ b/types/node-sass/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/node-sass/tslint.json b/types/node-sass/tslint.json index a41bf5d19a..0b6d65eeac 100644 --- a/types/node-sass/tslint.json +++ b/types/node-sass/tslint.json @@ -1,79 +1,9 @@ { "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 + // We don't want to export the Constructor interfaces + // and I can't figure out how to disable this lint using + // `export {}` + "strict-export-declare-modifiers": false } } diff --git a/types/node/ts3.1/index.d.ts b/types/node/ts3.1/index.d.ts index be36602300..ee9f75cc5f 100644 --- a/types/node/ts3.1/index.d.ts +++ b/types/node/ts3.1/index.d.ts @@ -7,7 +7,7 @@ // Reference required types from the default lib: /// -/// +/// /// // Base definitions for all NodeJS modules that are not specific to any version of TypeScript: diff --git a/types/node/v10/ts3.1/index.d.ts b/types/node/v10/ts3.1/index.d.ts index be36602300..ee9f75cc5f 100644 --- a/types/node/v10/ts3.1/index.d.ts +++ b/types/node/v10/ts3.1/index.d.ts @@ -7,7 +7,7 @@ // Reference required types from the default lib: /// -/// +/// /// // Base definitions for all NodeJS modules that are not specific to any version of TypeScript: diff --git a/types/npm-registry-package-info/index.d.ts b/types/npm-registry-package-info/index.d.ts new file mode 100644 index 0000000000..e66d3ae1b1 --- /dev/null +++ b/types/npm-registry-package-info/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for npm-registry-package-info 1.0 +// Project: https://github.com/kgryte/npm-registry-package-info#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace pkginfo { + interface Options { + /** Boolean indicating whether to return only the latest package information from a registry. */ + latest?: boolean; + /** Array of package names (required). */ + packages: string[]; + /** Registry port. Default: 443 (HTTPS) or 80 (HTTP). */ + port?: number; + /** Registry protocol. Default: 'https'. */ + protocol?: 'http' | 'https'; + /** Registry. Default: 'registry.npmjs.org'. */ + registry?: string; + } + + interface Data { + data: any; + meta: { + failure: number; + success: number; + total: number; + }; + } + + type Callback = (error: Error | null, data: Data) => void; + + function factory(opts: Options, callback: Callback): () => void; +} + +declare function pkginfo(opts: pkginfo.Options, callback: pkginfo.Callback): void; + +export = pkginfo; diff --git a/types/npm-registry-package-info/npm-registry-package-info-tests.ts b/types/npm-registry-package-info/npm-registry-package-info-tests.ts new file mode 100644 index 0000000000..3b0183b13a --- /dev/null +++ b/types/npm-registry-package-info/npm-registry-package-info-tests.ts @@ -0,0 +1,21 @@ +import pkginfo = require('npm-registry-package-info'); + +const opts: pkginfo.Options = { + latest: true, + packages: ['dstructs-array', 'flow-map', 'utils-merge2'], + port: 80, + protocol: 'http', + registry: 'my.favorite.npm/registry', +}; + +pkginfo(opts, (error, data) => { + data; // $ExpectType Data +}); + +const pkgs = ['dstructs-matrix', 'compute-stdev', 'compute-variance']; + +const get = pkginfo.factory({ packages: pkgs }, (error, data) => { + data; // $ExpectType Data +}); + +get(); diff --git a/types/npm-registry-package-info/tsconfig.json b/types/npm-registry-package-info/tsconfig.json new file mode 100644 index 0000000000..d20c3201d2 --- /dev/null +++ b/types/npm-registry-package-info/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-registry-package-info-tests.ts" + ] +} diff --git a/types/npm-registry-package-info/tslint.json b/types/npm-registry-package-info/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-registry-package-info/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/npm/index.d.ts b/types/npm/index.d.ts index 21ee933e59..066a932440 100644 --- a/types/npm/index.d.ts +++ b/types/npm/index.d.ts @@ -167,8 +167,8 @@ declare namespace NPM { Conf: ConfigStatic; defs: ConfigDefs; - get(setting: string): string; - set(setting: string, value: string): void; + get(setting: string): any; + set(setting: string, value: any): void; loadPrefix(cb: ErrorCallback): void; loadCAFile(caFilePath: string, cb: ErrorCallback): void; diff --git a/types/npm/npm-tests.ts b/types/npm/npm-tests.ts index 8ca5f01887..460e6f450a 100644 --- a/types/npm/npm-tests.ts +++ b/types/npm/npm-tests.ts @@ -22,4 +22,6 @@ npm.load({}, function (er) { npm.on("log", function (message: string) { console.log(message); }); + + npm.config.set('audit', false); }) diff --git a/types/nssm/index.d.ts b/types/nssm/index.d.ts index c1bc88bdf1..e181e6fc6e 100644 --- a/types/nssm/index.d.ts +++ b/types/nssm/index.d.ts @@ -44,14 +44,16 @@ type NssmCommandFn = & TwoArgCommandFn & PromiseCommandFn; -type Nssm = { - [key in Command]: NssmCommandFn -}; - -interface NssmOptions { - nssmExe?: string; -} - -declare function nssm(serviceName: string, options?: NssmOptions): Nssm; - export = nssm; + +declare function nssm(serviceName: string, options?: nssm.NssmOptions): nssm.Nssm; + +declare namespace nssm { + type Nssm = { + [key in Command]: NssmCommandFn + }; + + interface NssmOptions { + nssmExe?: string; + } +} diff --git a/types/nssm/nssm-tests.ts b/types/nssm/nssm-tests.ts index c0ace009c6..ceabc27e51 100644 --- a/types/nssm/nssm-tests.ts +++ b/types/nssm/nssm-tests.ts @@ -3,7 +3,7 @@ import nssm = require('nssm'); const svcName = 'test'; -const options = { nssmExe: 'nssm.exe' }; +const options: nssm.NssmOptions = { nssmExe: 'nssm.exe' }; const testService = nssm(svcName, options); const propertyName = 'Start'; diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index be6822cf36..80195cf516 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -729,7 +729,7 @@ declare namespace Office { * * In content add-ins for Access web apps, the `displayLanguage property` gets the add-in language (e.g., "en-US"). * - * When using in Outlook, the applicable modes are Compose or read. + * When using in Outlook, the applicable modes are Compose or Read. * * **Support details** * @@ -797,9 +797,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ mailbox: Office.Mailbox; /** @@ -823,9 +824,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ roamingSettings: Office.RoamingSettings; /** @@ -905,11 +907,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
Add-in typeContent, task pane, Outlook
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * + * + * + *
Add-in typeContent, task pane, Outlook
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Event { @@ -945,9 +947,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * **Support details** * @@ -997,9 +1000,10 @@ declare namespace Office { * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * * @remarks - * - * - *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
+ * + * + * + *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
* * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 * for Outlook. For more on how to specify a requirement set in your manifest, see @@ -1097,9 +1101,10 @@ declare namespace Office { * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * * @remarks - * - * - *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
+ * + * + * + *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
* * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 * for Outlook. For more on how to specify a requirement set in your manifest, see @@ -1911,7 +1916,7 @@ declare namespace Office { * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and * `Office.EventType.ViewSelectionChanged` event types. * - * BindingDataChanged and BindingSelectionChanged hosts
Access, Excel, Word
+ *
BindingDataChanged and BindingSelectionChanged hostsAccess, Excel, Word
* * @remarks * @@ -2046,6 +2051,12 @@ declare namespace Office { * [Api set: Mailbox 1.5] */ ItemChanged, + /** + * Triggers when the appointment location is changed in Outlook. + * + * [Api set: Mailbox Preview] + */ + EnhancedLocationsChanged, /** * Triggers when a customXmlPart node is deleted. */ @@ -3360,9 +3371,10 @@ declare namespace Office { * Asynchronously sets the text of an XML node in a custom XML part. * * @remarks - * - * - *
HostsWord
Requirement SetsCustomXmlParts
+ * + * + * + *
HostsWord
Requirement SetsCustomXmlParts
* * @param text Required. The text value of the XML node. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. @@ -3373,9 +3385,10 @@ declare namespace Office { * Asynchronously sets the text of an XML node in a custom XML part. * * @remarks - * - * - *
HostsWord
Requirement SetsCustomXmlParts
+ * + * + * + *
HostsWord
Requirement SetsCustomXmlParts
* * @param text Required. The text value of the XML node. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. @@ -4540,26 +4553,94 @@ declare namespace Office { * The following application-specific actions apply when writing data to a selection. * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * + * + * + * + * + * + * + * + * + * + * * - * + * + * + * + * + * *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* * The possible values for the {@link Office.CoercionType} parameter vary by the host. @@ -4657,26 +4738,93 @@ declare namespace Office { * The following application-specific actions apply when writing data to a selection. * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * + * + * + * + * + * + * + * + * + * + * * - * + * + * + * + * + * *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* * The possible values for the {@link Office.CoercionType} parameter vary by the host. @@ -5625,18 +5773,20 @@ declare namespace Office { * Gets the number of columns in the matrix data structure, as an integer value. * * @remarks - * - * - *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
+ * + * + * + *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
*/ columnCount: number; /** * Gets the number of rows in the matrix data structure, as an integer value. * * @remarks - * - * - *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
+ * + * + * + *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
*/ rowCount: number; } @@ -5644,9 +5794,10 @@ declare namespace Office { * Represents custom settings for a task pane or content add-in that are stored in the host document as name/value pairs. * * @remarks - * - * - *
HostsAccess, Excel, PowerPoint, Word
Requirement SetsSettings
+ * + * + * + *
HostsAccess, Excel, PowerPoint, Word
Requirement SetsSettings
* * The settings created by using the methods of the Settings object are saved per add-in and per document. * That is, they are available only to the add-in that created them, and only from the document in which they are saved. @@ -6892,9 +7043,10 @@ declare namespace Office { * Updates table formatting options on the bound table. * * @remarks - * - * - *
HostsExcel
Requirement SetsNot in a set
+ * + * + * + *
HostsExcel
Requirement SetsNot in a set
* * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * @@ -6945,9 +7097,10 @@ declare namespace Office { * Updates table formatting options on the bound table. * * @remarks - * - * - *
HostsExcel
Requirement SetsNot in a set
+ * + * + * + *
HostsExcel
Requirement SetsNot in a set
* * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * @@ -6998,9 +7151,10 @@ declare namespace Office { * Represents the data in a table or an {@link Office.TableBinding}. * * @remarks - * - * - *
HostsExcel, Word
Requirement SetsTableBindings
+ * + * + * + *
HostsExcel, Word
Requirement SetsTableBindings
*/ class TableData { constructor(rows: any[][], headers: any[]); @@ -7009,10 +7163,11 @@ declare namespace Office { * Gets or sets the headers of the table. * * @remarks - * + *
HostsExcel, Word
+ * + * + *
HostsExcel, Word
Requirement SetsTableBindings
* - * Requirement SetsTableBindings - * * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers * for a two-column table you would set the header property to [['header1', 'header2']]. * @@ -7029,10 +7184,11 @@ declare namespace Office { * Returns an empty array if there are no rows. * * @remarks - * + *
HostsExcel, Word
+ * + * + *
HostsExcel, Word
Requirement SetsTableBindings
* - * Requirement SetsTableBindings - * * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of * string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. * @@ -9279,9 +9435,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -9312,9 +9468,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -9335,9 +9491,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum AttachmentType { /** @@ -9359,9 +9515,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum Days { /** @@ -9411,9 +9567,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -9449,9 +9605,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum EntityType { /** @@ -9489,9 +9645,9 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum ItemNotificationMessageType { /** @@ -9513,9 +9669,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum ItemType { /** @@ -9534,10 +9690,7 @@ declare namespace Office { * * @remarks * - * - * - * - * + * *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta @@ -9558,9 +9711,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum Month { /** @@ -9636,9 +9789,9 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RecipientType { /** @@ -9664,9 +9817,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RecurrenceTimeZone { /** @@ -10222,9 +10375,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RecurrenceType { /** @@ -10254,9 +10407,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum ResponseType { /** @@ -10286,9 +10439,9 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RestVersion { /** @@ -10310,9 +10463,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum WeekNumber { /** @@ -10356,9 +10509,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface AppointmentForm { /** @@ -10368,9 +10522,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ body: string; /** @@ -10394,9 +10549,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ end: Date; /** @@ -10414,8 +10570,10 @@ declare namespace Office { * * @remarks * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ location: string; /** @@ -10433,11 +10591,24 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ optionalAttendees: string[] | EmailAddressDetails[]; + /** + * Provides access to the resources of an event. Returns an array of strings containing the resources required for the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ */ resources: string[]; /** * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. @@ -10454,9 +10625,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ requiredAttendees: string[] | EmailAddressDetails[]; /** @@ -10480,9 +10652,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ start: Date; /** @@ -10502,9 +10675,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ subject: string; } @@ -10514,9 +10688,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -10546,9 +10721,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface AttachmentDetails { /** @@ -10583,9 +10759,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Body { /** @@ -10600,13 +10777,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, this method also has the following signature: - * - * `getAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 options - Optional. An object literal that contains one or more of the following properties: @@ -10614,7 +10788,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 Office.AsyncResult. * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coercionType: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(coercionType: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current body in a specified format. * @@ -10627,32 +10801,48 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; - + getAsync(coercionType: Office.CoercionType, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. * * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @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 Office.AsyncResult. * The content type is returned as one of the CoercionType values in the asyncResult.value property. */ - getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getTypeAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets a value that indicates whether the content is in HTML or text format. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The content type is returned as one of the CoercionType values in the asyncResult.value property. + */ + getTypeAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -10665,20 +10855,12 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters. - * - * In addition to this signature, this method also has the following signatures: - * - * `prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `prependAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * - * `prependAsync(data: string): void;` - * * @param data - The string to be inserted at the beginning of the body. The string is limited to 1,000,000 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. @@ -10686,7 +10868,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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -10699,58 +10881,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 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. - */ - prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Adds the specified content to the beginning of the item body. - * - * The prependAsync method inserts the specified string at the beginning of the item body. - * After insertion, the cursor is returned to its original place, relative to the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, callback: (result: Office.AsyncResult) => void): void; - /** - * Adds the specified content to the beginning of the item body. - * - * The prependAsync method inserts the specified string at the beginning of the item body. - * After insertion, the cursor is returned to its original place, relative to the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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. - */ - prependAsync(data: string): void; + prependAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -10764,20 +10905,13 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * - * `setAsync(data: string): void;` - * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 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. @@ -10785,7 +10919,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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -10799,64 +10933,18 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 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. - */ - setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Replaces the entire body with the specified text. - * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. - * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method - * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, callback: (result: Office.AsyncResult) => void): void; - /** - * Replaces the entire body with the specified text. - * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. - * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method - * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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. - */ - setAsync(data: string): void; + setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. @@ -10871,20 +10959,13 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
* - * In addition to this signature, this method also has the following signatures: - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * - * `setSelectedDataAsync(data: string): void;` - * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 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. @@ -10892,7 +10973,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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * @@ -10906,64 +10987,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 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. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Replaces the selection in the body with the specified text. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in - * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the - * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; - /** - * Replaces the selection in the body with the specified text. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in - * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the - * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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. - */ - setSelectedDataAsync(data: string): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a contact stored on the server. Read mode only. @@ -10974,9 +11009,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface Contact { /** @@ -10988,7 +11024,7 @@ declare namespace Office { */ businessName: string; /** - * An array of strings containing the SMTP email addresses associated with the contact. Nullable, + * An array of strings containing the SMTP email addresses associated with the contact. Nullable. */ emailAddresses: string[]; /** @@ -11015,9 +11051,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface CustomProperties { /** @@ -11028,9 +11065,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ get(name: string): any; /** @@ -11045,9 +11083,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The name of the property to be set. * @param value - The value of the property to be set. @@ -11062,9 +11101,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ remove(name: string): void; /** @@ -11086,11 +11126,12 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ - saveAsync(callback?: (result: Office.AsyncResult) => void, asyncContext?: any): void; + saveAsync(callback?: (asyncResult: Office.AsyncResult) => void, asyncContext?: any): void; } /** * Provides diagnostic information to an Outlook add-in. @@ -11098,9 +11139,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Diagnostics { /** @@ -11111,9 +11153,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ hostName: string; /** @@ -11125,9 +11168,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ hostVersion: string; /** @@ -11150,9 +11194,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ OWAView: MailboxEnums.OWAView | "OneColumn" | "TwoColumns" | "ThreeColumns"; } @@ -11162,9 +11207,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface EmailAddressDetails { /** @@ -11192,9 +11238,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface EmailUser { /** @@ -11213,14 +11260,8 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta @@ -11233,24 +11274,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
* - * In addition to this signature, this method also has the following signatures: - * - * `addAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void;` - * * @param locationIdentifiers The locations to be added to the current list of locations. * @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. @@ -11259,7 +11287,7 @@ declare namespace Office { * * @beta */ - addAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResultStatus) => void): void; + addAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResultStatus) => void): void; /** * Adds to the set of locations associated with the appointment. * @@ -11267,18 +11295,9 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
* * @param locationIdentifiers The locations to be added to the current list of locations. @@ -11287,7 +11306,7 @@ declare namespace Office { * * @beta */ - addAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void; + addAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResultStatus) => void): void; /** * Gets the set of locations associated with the appointment. * @@ -11295,20 +11314,10 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signatures: - * - * `getAsync(callback?: (result: Office.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, @@ -11316,7 +11325,7 @@ declare namespace Office { * * @beta */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the set of locations associated with the appointment. * @@ -11324,14 +11333,8 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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, @@ -11339,7 +11342,7 @@ declare namespace Office { * * @beta */ - getAsync(callback?: (result: Office.AsyncResult) => void): void; + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the set of locations associated with the appointment. * @@ -11349,20 +11352,10 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signatures: - * - * `removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void;` - * * @param locationIdentifiers The locations to be removed from the current list of locations. * @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. @@ -11371,7 +11364,7 @@ declare namespace Office { * * @beta */ - removeAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResultStatus) => void): void; + removeAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResultStatus) => void): void; /** * Removes the set of locations associated with the appointment. * @@ -11381,14 +11374,8 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param locationIdentifiers The locations to be removed from the current list of locations. @@ -11397,7 +11384,7 @@ declare namespace Office { * * @beta */ - removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void; + removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResultStatus) => void): void; } /** * Represents a collection of entities found in an email message or appointment. Read mode only. @@ -11425,9 +11412,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface Entities { /** @@ -11466,9 +11454,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface From { /** @@ -11481,20 +11470,18 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * In addition to this signature, the method also has the following signature: - * - * `getAsync(callback?: (result: Office.AsyncResult) => void): void;` - * - * @param options - An object literal that contains one or more of the following properties. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. - * The `value` property of the result is message's from value, as an EmailAddressDetails object. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is the item's from value, as an EmailAddressDetails object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the from value of a message. * @@ -11506,14 +11493,16 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@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 Office.AsyncResult object. - * The `value` property of the result is message's from value, as an EmailAddressDetails object. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is the item's from value, as an EmailAddressDetails object. */ - getAsync(callback?: (result: Office.AsyncResult) => void): void; + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -11525,9 +11514,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -11539,13 +11529,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, this method also has the following signature: - * - * `getAsync(names: string[], callback: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param names - The names of the internet headers to be returned. * @param options - Optional. An object literal that contains one or more of the following properties: @@ -11555,7 +11542,7 @@ declare namespace Office { * * @beta */ - getAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method returns a dictionary containing those internet headers and their values. * If the add-in requests an x-header that is not available, that x-header will not be returned in the results. @@ -11563,9 +11550,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param names - The names of the internet headers to be returned. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, @@ -11573,20 +11561,17 @@ declare namespace Office { * * @beta */ - getAsync(names: string[], callback?: (result: Office.AsyncResult) => void): void; + getAsync(names: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method removes the specified headers from the internet header collection. * * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
- * - * In addition to this signature, this method also has the following signature: - * - * `removeAsync(names: string[], callback: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param names - The names of the internet headers to be removed. * @param options - Optional. An object literal that contains one or more of the following properties: @@ -11596,16 +11581,17 @@ declare namespace Office { * * @beta */ - removeAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method removes the specified headers from the internet header collection. * * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param names - The names of the internet headers to be removed. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, @@ -11613,7 +11599,7 @@ declare namespace Office { * * @beta */ - removeAsync(names: string[], callback?: (result: Office.AsyncResult) => void): void; + removeAsync(names: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the specified internet headers to the specified values. * @@ -11623,14 +11609,11 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(headers: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param headers - The names and corresponding values of the headers to be set. Should be a dictionary object with keys being the names of the * internet headers and values being the values of the internet headers. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -11640,7 +11623,7 @@ declare namespace Office { * * @beta */ - setAsync(headers: Object, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(headers: Object, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the specified internet headers to the specified values. * @@ -11650,9 +11633,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param headers - The names and corresponding values of the headers to be set. Should be a dictionary object with keys being the names of the * internet headers and values being the values of the internet headers. @@ -11661,13 +11645,19 @@ declare namespace Office { * * @beta */ - setAsync(headers: Object, callback?: (result: Office.AsyncResult) => void): void; + setAsync(headers: Object, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a location. Read only. * * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -11690,6 +11680,12 @@ declare namespace Office { * Represents the id of a location. * * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -11715,9 +11711,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Organizer { /** @@ -11726,16 +11723,32 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @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. + * @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 the appointment's organizer value, as an EmailAddressDetails object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the organizer value of an appointment as an {@link Office.EmailAddressDetails} in the asyncResult.value property. + * + * [Api set: Mailbox 1.7] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * The `value` property of the result is the appointment's organizer value, as an EmailAddressDetails object. + */ + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -11762,9 +11775,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ body: Body; /** @@ -11780,9 +11794,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ end: Time; /** @@ -11794,14 +11809,8 @@ declare namespace Office { * @remarks * * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @beta @@ -11816,9 +11825,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ itemType: MailboxEnums.ItemType; /** @@ -11829,9 +11839,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ location: Location; /** @@ -11841,9 +11852,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ notificationMessages: NotificationMessages; /** @@ -11855,9 +11867,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ optionalAttendees: Recipients; /** @@ -11869,9 +11882,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ organizer: Organizer; /** @@ -11889,9 +11903,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ recurrence: Recurrence; /** @@ -11903,9 +11918,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ requiredAttendees: Recipients; /** @@ -11926,9 +11942,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ seriesId: string; /** @@ -11944,9 +11961,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ start: Time; /** @@ -11960,9 +11978,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ subject: Subject; /** @@ -11975,30 +11994,24 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, the method also has the following signatures: - * - * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -12009,62 +12022,21 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addFileAttachmentAsync(uri: string, attachmentName: string): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -12075,41 +12047,68 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @param base64File - The base64 encoded content of an image or file to be added to an email or event. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. * * @beta */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds a file to a message or appointment as an attachment. + * + * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the asyncResult.value object. + * + * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * @param base64File - The base64 encoded content of an image or file to be added to an email or event. + * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * + * @beta + */ + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -12119,20 +12118,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -12140,7 +12141,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -12157,29 +12158,21 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, this method also has the following signatures: - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -12196,73 +12189,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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 Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -12278,9 +12217,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ close(): void; /** @@ -12290,9 +12230,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @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. @@ -12302,7 +12243,26 @@ declare namespace Office { * * @beta */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the item's attachments as an array. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for + * the failure. + * + * @beta + */ + getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is activated by an actionable message. * @@ -12312,9 +12272,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -12326,7 +12287,30 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets initialization data passed when the add-in is activated by an actionable message. + * + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. + * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * + * @beta + */ + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -12343,9 +12327,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. @@ -12353,7 +12338,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 Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -12370,16 +12355,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -12395,16 +12381,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -12418,19 +12405,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * In addition to this signature, the method also has the following signatures: - * - * `removeAttachmentAsync(attachmentId: string): void;` - * - * `removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void;` - * - * `removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void;` + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -12438,53 +12417,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 Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - */ - removeAttachmentAsync(attachmentId: string): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void; + removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -12499,35 +12432,33 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -12535,26 +12466,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -12580,93 +12513,17 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `saveAsync(): void;` - * - * `saveAsync(options: Office.AsyncContextOptions): void;` - * - * `saveAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - */ - saveAsync(): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @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. - */ - saveAsync(options: Office.AsyncContextOptions): void; + saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -12691,15 +12548,15 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer - * - * 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 Office.AsyncResult. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ - saveAsync(callback: (result: Office.AsyncResult) => void): void; + saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -12711,20 +12568,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `setSelectedDataAsync(data: string): void;` - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -12739,7 +12588,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 Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -12751,68 +12600,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - */ - setSelectedDataAsync(data: string): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the - * default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -12830,9 +12629,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. @@ -12846,9 +12646,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ body: Body; /** @@ -12858,9 +12659,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ dateTimeCreated: Date; /** @@ -12870,9 +12672,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * **Note**: This member is not supported in Outlook for iOS or Outlook for Android. */ @@ -12890,9 +12693,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ end: Date; /** @@ -12906,14 +12710,8 @@ declare namespace Office { * @remarks * * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @beta @@ -12929,9 +12727,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. * @@ -12971,9 +12770,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ itemId: string; /** @@ -12985,9 +12785,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ itemType: MailboxEnums.ItemType; /** @@ -12999,9 +12800,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ location: string; /** @@ -13014,9 +12816,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ normalizedSubject: string; /** @@ -13026,9 +12829,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ notificationMessages: NotificationMessages; /** @@ -13041,9 +12845,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ optionalAttendees: EmailAddressDetails[]; /** @@ -13053,9 +12858,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ organizer: EmailAddressDetails; /** @@ -13073,9 +12879,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ recurrence: Recurrence; /** @@ -13088,9 +12895,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ requiredAttendees: EmailAddressDetails[]; /** @@ -13103,9 +12911,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ start: Date; /** @@ -13126,9 +12935,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ seriesId: string; /** @@ -13142,9 +12952,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ subject: string; @@ -13152,19 +12963,17 @@ declare namespace Office { * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13174,21 +12983,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; - + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13196,7 +13006,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.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. @@ -13214,15 +13024,17 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyAllForm(formData: string | ReplyFormData): void; + displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. * @@ -13240,15 +13052,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyForm(formData: string | ReplyFormData): void; + displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.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}. * @@ -13259,13 +13073,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @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. @@ -13277,7 +13088,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.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}. * @@ -13287,9 +13098,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. @@ -13299,7 +13111,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -13309,9 +13121,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ getEntities(): Entities; /** @@ -13329,9 +13142,10 @@ declare namespace Office { * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. * @@ -13339,7 +13153,7 @@ declare namespace Office { * * Value of entityType * Type of objects in returned array - * Required Permission Leve + * Required Permission Level * * * Address @@ -13391,9 +13205,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, @@ -13426,9 +13241,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ getRegExMatches(): any; /** @@ -13450,9 +13266,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -13466,9 +13283,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -13498,9 +13316,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ getSelectedRegExMatches(): any; /** @@ -13518,34 +13337,33 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -13553,26 +13371,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -13582,9 +13402,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Item { /** @@ -13594,9 +13415,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ body: Body; /** @@ -13609,9 +13431,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ itemType: MailboxEnums.ItemType; /** @@ -13621,9 +13444,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ notificationMessages: NotificationMessages; @@ -13645,9 +13469,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ seriesId: string; @@ -13655,19 +13480,17 @@ declare namespace Office { * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13677,21 +13500,23 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13699,7 +13524,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. @@ -13714,11 +13539,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment you want to get. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -13729,7 +13554,35 @@ declare namespace Office { * * @beta */ - getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + * + * @beta + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.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}. @@ -13741,13 +13594,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @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. @@ -13759,7 +13609,32 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + + /** + * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. + * + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. + * + * @beta + */ + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. @@ -13767,14 +13642,11 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 @@ -13783,7 +13655,7 @@ declare namespace Office { * * @beta */ - getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. @@ -13791,9 +13663,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. @@ -13801,7 +13674,7 @@ declare namespace Office { * * @beta */ - getSharedPropertiesAsync(callback: (result: Office.AsyncResult) => void): void; + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. @@ -13818,34 +13691,34 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; + /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -13853,27 +13726,29 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -13894,11 +13769,13 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ subject: Subject; + /** * Adds a file to a message or appointment as an attachment. * @@ -13909,32 +13786,26 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, the method also has the following signatures: - * - * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the * attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -13945,64 +13816,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addFileAttachmentAsync(uri: string, attachmentName: string): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the - * attachment list. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. @@ -14014,24 +13843,53 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @param base64File - The base64 encoded content of an image or file to be added to an email or event. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. * * @beta */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds a file to a message or appointment as an attachment. + * + * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the asyncResult.value object. + * + * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * @param base64File - The base64 encoded content of an image or file to be added to an email or event. + * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * + * @beta + */ + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. @@ -14049,30 +13907,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, this method also has the following signatures: - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -14089,74 +13939,20 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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 + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current item that is being composed @@ -14173,9 +13969,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ close(): void; /** @@ -14185,9 +13982,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @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. @@ -14197,7 +13995,26 @@ declare namespace Office { * * @beta */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the item's attachments as an array. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for + * the failure. + * + * @beta + */ + getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is activated by an actionable message. * @@ -14207,9 +14024,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -14223,40 +14041,39 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** - * Asynchronously returns selected data from the subject or body of a message. + * Gets initialization data passed when the add-in is activated by an actionable message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes - * from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * + * [Api set: Mailbox Preview] * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose + * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. + * + * @beta */ - getSelectedDataAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. + * To access the selected data from the callback method, call asyncResult.value.data. * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] @@ -14266,9 +14083,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. @@ -14277,7 +14095,34 @@ declare namespace Office { * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Asynchronously returns selected data from the subject or body of a message. + * + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * + * [Api set: Mailbox 1.2] + * + * @returns + * The selected data as a string with format determined by coercionType. + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + getSelectedDataAsync(coercionType: Office.CoercionType, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -14291,20 +14136,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `removeAttachmentAsync(attachmentId: string): void;` - * - * `removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void;` - * - * `removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param attachmentId - The identifier of the attachment to remove. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. @@ -14312,7 +14149,7 @@ declare namespace Office { * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -14326,64 +14163,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - */ - removeAttachmentAsync(attachmentId: string): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. @@ -14410,27 +14201,19 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `saveAsync(): void;` - * - * `saveAsync(options: Office.AsyncContextOptions): void;` - * - * `saveAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -14456,85 +14239,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * ErrorsInvalidAttachmentId - The attachment identifier does not exist. - * - */ - saveAsync(): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @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. - */ - saveAsync(options: Office.AsyncContextOptions): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -14546,20 +14261,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `setSelectedDataAsync(data: string): void;` - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -14574,7 +14281,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 Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -14586,69 +14293,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - */ - setSelectedDataAsync(data: string): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is - * applied in Outlook. - * If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -14664,9 +14320,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. * For more information, see @@ -14685,9 +14342,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or * appointment item. @@ -14727,9 +14385,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ itemId: string; /** @@ -14742,9 +14401,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ normalizedSubject: string; /** @@ -14758,9 +14418,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ subject: string; /** @@ -14780,15 +14441,17 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyAllForm(formData: string | ReplyFormData): void; + displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. * @@ -14806,15 +14469,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read/td>
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyForm(formData: string | ReplyFormData): void; + displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.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}. * @@ -14825,13 +14490,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @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. @@ -14843,7 +14505,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.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}. * @@ -14854,9 +14516,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. @@ -14866,7 +14529,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -14876,9 +14539,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ getEntities(): Entities; /** @@ -14896,9 +14560,10 @@ declare namespace Office { * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * +
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the * following table. @@ -14907,7 +14572,7 @@ declare namespace Office { * * Value of entityType * Type of objects in returned array - * Required Permission Leve + * Required Permission Level * * * Address @@ -14959,9 +14624,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, @@ -14994,9 +14660,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ getRegExMatches(): any; /** @@ -15018,9 +14685,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -15034,9 +14702,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -15064,9 +14733,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ getSelectedRegExMatches(): any; } @@ -15092,9 +14762,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ conversationId: string; } @@ -15114,9 +14785,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ bcc: Recipients; /** @@ -15126,9 +14798,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ body: Body; /** @@ -15142,9 +14815,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ cc: Recipients; /** @@ -15161,9 +14835,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ conversationId: string; /** @@ -15178,9 +14853,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ from: From; /** @@ -15192,9 +14868,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @beta */ @@ -15209,9 +14886,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ itemType: MailboxEnums.ItemType; /** @@ -15221,9 +14899,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ notificationMessages: NotificationMessages; /** @@ -15244,9 +14923,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ seriesId: string; /** @@ -15260,9 +14940,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ subject: Subject; /** @@ -15275,9 +14956,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ to: Recipients; @@ -15291,32 +14973,26 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, the method also has the following signatures: - * - * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the * attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -15327,63 +15003,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addFileAttachmentAsync(uri: string, attachmentName: string): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -15394,41 +15029,68 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @param base64File - The base64 encoded content of an image or file to be added to an email or event. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. * * @beta */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds a file to a message or appointment as an attachment. + * + * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the asyncResult.value object. + * + * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * @param base64File - The base64 encoded content of an image or file to be added to an email or event. + * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * + * @beta + */ + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -15438,20 +15100,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -15459,7 +15123,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -15476,30 +15140,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, this method also has the following signatures: - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -15516,74 +15172,20 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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 + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -15599,9 +15201,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ close(): void; /** @@ -15611,9 +15214,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @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. @@ -15623,7 +15227,26 @@ declare namespace Office { * * @beta */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the item's attachments as an array. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for + * the failure. + * + * @beta + */ + getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is activated by an actionable message. * @@ -15634,9 +15257,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -15650,33 +15274,33 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** - * Asynchronously returns selected data from the subject or body of a message. + * Gets initialization data passed when the add-in is activated by an actionable message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. - * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. + * + * [Api set: Mailbox Preview] * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose + * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. + * + * @beta */ - getSelectedDataAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -15693,9 +15317,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. @@ -15704,7 +15329,34 @@ declare namespace Office { * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Asynchronously returns selected data from the subject or body of a message. + * + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * + * [Api set: Mailbox 1.2] + * + * @returns + * The selected data as a string with format determined by coercionType. + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + getSelectedDataAsync(coercionType: Office.CoercionType, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -15720,16 +15372,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -15743,20 +15396,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `removeAttachmentAsync(attachmentId: string): void;` - * - * `removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void;` - * - * `removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param attachmentId - The identifier of the attachment to remove. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. @@ -15764,7 +15409,7 @@ declare namespace Office { * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -15778,81 +15423,33 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - */ - removeAttachmentAsync(attachmentId: string): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -15860,26 +15457,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -15905,26 +15504,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `saveAsync(): void;` - * - * `saveAsync(options: Office.AsyncContextOptions): void;` - * - * `saveAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -15950,83 +15541,16 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose - * - * ErrorsInvalidAttachmentId - The attachment identifier does not exist. - * - */ - saveAsync(): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @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. - */ - saveAsync(options: Office.AsyncContextOptions): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
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 + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - saveAsync(callback: (result: Office.AsyncResult) => void): void; + saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -16038,20 +15562,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `setSelectedDataAsync(data: string): void;` - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -16065,7 +15581,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 Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -16077,68 +15593,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - */ - setSelectedDataAsync(data: string): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is - * applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The message read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -16155,9 +15621,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. * For more information, see @@ -16172,9 +15639,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ body: Body; /** @@ -16188,9 +15656,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ cc: EmailAddressDetails[]; /** @@ -16207,9 +15676,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ conversationId: string; /** @@ -16219,9 +15689,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ dateTimeCreated: Date; /** @@ -16231,9 +15702,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * **Note**: This member is not supported in Outlook for iOS or Outlook for Android. */ @@ -16252,9 +15724,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ from: EmailAddressDetails; /** @@ -16266,9 +15739,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @beta */ @@ -16280,9 +15754,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ internetMessageId: string; /** @@ -16295,9 +15770,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* The itemClass property specifies the message class of the selected item. * The following are the default message classes for the message or appointment item. @@ -16338,9 +15814,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ itemId: string; /** @@ -16353,9 +15830,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ itemType: MailboxEnums.ItemType; /** @@ -16369,9 +15847,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ normalizedSubject: string; /** @@ -16381,9 +15860,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ notificationMessages: NotificationMessages; /** @@ -16403,9 +15883,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ recurrence: Recurrence; /** @@ -16426,9 +15907,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ seriesId: string; /** @@ -16443,9 +15925,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ sender: EmailAddressDetails; /** @@ -16459,9 +15942,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ subject: string; /** @@ -16475,9 +15959,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ to: EmailAddressDetails[]; @@ -16485,19 +15970,17 @@ declare namespace Office { * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -16507,21 +15990,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; - + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -16529,7 +16013,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.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. @@ -16547,15 +16031,17 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyAllForm(formData: string | ReplyFormData): void; + displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. * @@ -16573,15 +16059,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyForm(formData: string | ReplyFormData): void; + displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.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}. @@ -16593,13 +16081,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @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. @@ -16611,7 +16096,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.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}. @@ -16623,9 +16108,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. @@ -16635,7 +16121,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -16645,9 +16131,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ getEntities(): Entities; /** @@ -16666,9 +16153,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the * following table. @@ -16677,7 +16165,7 @@ declare namespace Office { * * Value of entityType * Type of objects in returned array - * Required Permission Leve + * Required Permission Level * * * Address @@ -16729,9 +16217,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, @@ -16764,9 +16253,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ getRegExMatches(): any; /** @@ -16788,9 +16278,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -16804,9 +16295,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -16836,9 +16328,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ getSelectedRegExMatches(): any; /** @@ -16856,33 +16349,32 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -16890,26 +16382,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -16919,9 +16413,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface LocalClientTime { /** @@ -16963,9 +16458,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Location { /** @@ -16974,41 +16470,38 @@ declare namespace Office { * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. * The location of the appointment is provided as a string in the asyncResult.value property. * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `getAsync(callback: (result: Office.AsyncResult) => void): void;` - * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the location of an appointment. * * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. * The location of the appointment is provided as a string in the asyncResult.value property. * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -17024,59 +16517,13 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
- * - * In addition to this signature, the method also has the following signatures: - * - * `setAsync(location: string): void;` - * - * `setAsync(location: string, options: Office.AsyncContextOptions): void;` - * - * `setAsync(location: string, callback: (result: Office.AsyncResult) => void): void;` + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ - setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Sets the location of an appointment. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. - * Setting the location of an appointment overwrites the current location. - * - * @param location - The location of the appointment. The string is limited to 255 characters. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
- */ - setAsync(location: string): void; - /** - * Sets the location of an appointment. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. - * Setting the location of an appointment overwrites the current location. - * - * @param location - The location of the appointment. The string is limited to 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
- */ - setAsync(location: string, options: Office.AsyncContextOptions): void; + setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -17090,13 +16537,13 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ - setAsync(location: string, callback: (result: Office.AsyncResult) => void): void; + setAsync(location: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides access to the Outlook Add-in object model for Microsoft Outlook and Microsoft Outlook on the web. @@ -17112,9 +16559,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Mailbox { /** @@ -17140,9 +16588,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ diagnostics: Diagnostics; /** @@ -17157,9 +16606,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The ewsUrl value can be used by a remote service to make EWS calls to the user's mailbox. For example, you can create a remote service to {@link https://docs.microsoft.com/outlook/add-ins/get-attachments-of-an-outlook-item | get attachments from the selected item}. * @@ -17184,9 +16634,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The restUrl value can be used to make {@link https://docs.microsoft.com/outlook/rest/ | REST API} calls to the user's mailbox. */ @@ -17200,15 +16651,17 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently, the only supported event type is `Office.EventType.ItemChanged`. In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. * * [Api set: Mailbox 1.5] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -17217,7 +16670,29 @@ 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 Office.AsyncResult. */ - addHandlerAsync(eventType: Office.EventType, handler: (type: Office.EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (type: Office.EventType) => void, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds an event handler for a supported event. + * + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * + * [Api set: Mailbox 1.5] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @param eventType - The event that should invoke the handler. + * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + addHandlerAsync(eventType: Office.EventType, handler: (type: Office.EventType) => void, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * @@ -17230,9 +16705,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param itemId - An item ID formatted for the Outlook REST APIs. * @param restVersion - A value indicating the version of the Outlook REST API used to retrieve the item ID. @@ -17255,9 +16731,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param timeValue - A Date object. */ @@ -17271,9 +16748,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the * {@link https://docs.microsoft.com/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations | Outlook Mail API} or the {@link https://graph.microsoft.io/ | Microsoft Graph}. @@ -17293,9 +16771,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param input - The local time value to convert. * @returns A Date object with the time expressed in UTC. @@ -17322,9 +16801,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param itemId - The Exchange Web Services (EWS) identifier for an existing calendar appointment. */ @@ -17348,9 +16828,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param itemId - The Exchange Web Services (EWS) identifier for an existing message. */ @@ -17377,9 +16858,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param parameters - An AppointmentForm describing the new appointment. All properties are optional. */ @@ -17396,9 +16878,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param parameters - A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * @@ -17459,16 +16942,11 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, the method has the following signatures: - * - * `getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * `getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void;` - * * @param options - An object literal that contains one or more of the following properties. * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. @@ -17476,35 +16954,7 @@ declare namespace Office { * type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property. * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. */ - getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: Office.AsyncResult) => void): void; - /** - * Gets a string that contains a token used to get an attachment or item from an Exchange Server. - * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. - * The lifetime of the callback token is 5 minutes. - * - * You can pass the token and an attachment identifier or item identifier to a third-party system. - * The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or - * GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. - * - * Your app must have the ReadItem permission specified in its manifest to call the getCallbackTokenAsync method in read mode. - * - * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. - * Your app must have ReadWriteItem permissions to call the saveAsync method. - * - * [Api set: Mailbox 1.5] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. - * The token is provided as a string in the `asyncResult.value` property. - * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. - */ - getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void): void; + getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * @@ -17524,16 +16974,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property. * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext - Optional. Any state data that is passed to the asynchronous method. */ - getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + getCallbackTokenAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Gets a token identifying the user and the Office Add-in. * @@ -17543,9 +16994,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The getUserIdentityTokenAsync method returns a token that you can use to identify and * {@link https://docs.microsoft.com/outlook/add-ins/authentication | authenticate the add-in and user with a third-party system}. @@ -17556,7 +17008,7 @@ declare namespace Office { * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext - Optional. Any state data that is passed to the asynchronous method.| */ - getUserIdentityTokenAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + getUserIdentityTokenAsync(callback: (asyncResult: Office.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. * @@ -17599,9 +17051,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or 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 Office.AsyncResult. @@ -17609,26 +17062,48 @@ declare namespace Office { * 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: Office.AsyncResult) => void, userContext?: any): void; + makeEwsRequestAsync(data: any, callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. * - * Currently, the only supported event type is `Office.EventType.ItemChanged`. In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. * * [Api set: Mailbox 1.5] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should revoke the handler. * @param options - Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - removeHandlerAsync(eventType: Office.EventType, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Removes the event handlers for a supported event type. + * + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * + * [Api set: Mailbox 1.5] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @param eventType - The event that should revoke the handler. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -17644,9 +17119,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface MeetingSuggestion { /** @@ -17680,9 +17156,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface NotificationMessageDetails { /** @@ -17720,9 +17197,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface NotificationMessages { /** @@ -17742,58 +17220,12 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, the method also has the following signatures: - * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails): void;` - * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` - * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void;` - * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Adds a notification to an item. - * - * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. - * - * @param key - A developer-specified key used to reference this notification message. Developers can use it to modify this message later. - * It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the notification message to be added to the item. - * It contains a NotificationMessageDetails object. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- */ - addAsync(key: string, JSONmessage: NotificationMessageDetails): void; - /** - * Adds a notification to an item. - * - * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. - * - * @param key - A developer-specified key used to reference this notification message. Developers can use it to modify this message later. - * It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the notification message to be added to the item. - * It contains a NotificationMessageDetails object. - * @param 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. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a notification to an item. * @@ -17809,113 +17241,78 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ - addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns all keys and messages for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signature: - * - * `getAllAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns all keys and messages for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(callback: (result: Office.AsyncResult) => void): void; + getAllAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes a notification message for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signatures: - * - * `removeAsync(key: string): void;` - * - * `removeAsync(key: string, options: Office.AsyncContextOptions): void;` - * - * `removeAsync(key: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param key - The key for the notification message to remove. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes a notification message for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to remove. - */ - removeAsync(key: string): void; - /** - * Removes a notification message for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to remove. - * @param 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. - */ - removeAsync(key: string, options: Office.AsyncContextOptions): void; - /** - * Removes a notification message for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param key - The key for the notification message to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - removeAsync(key: string, callback: (result: Office.AsyncResult) => void): void; + removeAsync(key: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -17924,18 +17321,11 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signatures: - * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void;` - * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` - * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void;` - * * @param key - The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. * It contains a NotificationMessageDetails object. @@ -17944,7 +17334,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 Office.AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -17953,45 +17343,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. - * It contains a NotificationMessageDetails object. - */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void; - /** - * Replaces a notification message that has a given key with another message. - * - * If a notification message with the specified key doesn't exist, replaceAsync will add the notification. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. - * It contains a NotificationMessageDetails object. - * @param 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. - */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void; - /** - * Replaces a notification message that has a given key with another message. - * - * If a notification message with the specified key doesn't exist, replaceAsync will add the notification. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param key - The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. @@ -17999,7 +17354,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 Office.AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a phone number identified in an item. Read mode only. @@ -18010,9 +17365,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface PhoneNumber { /** @@ -18032,9 +17388,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Recipients { /** @@ -18051,50 +17408,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* - * In addition to this signature, this method also has the following signatures: - * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;` - * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` - * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.AsyncResult) => void): void;` - * * @param recipients - The recipients to add to the recipients list. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; - /** - * Adds a recipient list to the existing recipients for an appointment or message. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - EmailUser objects - * - * - EmailAddressDetails objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * @@ -18109,42 +17435,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void; - /** - * Adds a recipient list to the existing recipients for an appointment or message. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - {@link Office.EmailUser} objects - * - * - {@link Office.EmailAddressDetails} objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* * @param recipients - The recipients to add to the recipients list. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -18153,21 +17454,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -18176,15 +17474,16 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -18201,29 +17500,21 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;` - * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` - * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.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. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -18240,72 +17531,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* * @param recipients - The recipients to add to the recipients list. - */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void; - /** - * Sets a recipient list for an appointment or message. - * - * The setAsync method overwrites the current recipient list. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - {@link Office.EmailUser} objects - * - * - {@link Office.EmailAddressDetails} objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void; - /** - * Sets a recipient list for an appointment or message. - * - * The setAsync method overwrites the current recipient list. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - {@link Office.EmailUser} objects - * - * - {@link Office.EmailAddressDetails} objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.AsyncResult) => void): void; - + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -18317,9 +17555,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * **States** * @@ -18369,9 +17608,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ recurrenceProperties: RecurrenceProperties; /** @@ -18381,9 +17621,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ recurrenceTimeZone: RecurrenceTimeZone; @@ -18394,9 +17635,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ recurrenceType: MailboxEnums.RecurrenceType; @@ -18409,9 +17651,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ seriesTime: SeriesTime; @@ -18424,13 +17667,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @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. @@ -18438,7 +17678,7 @@ declare namespace Office { * asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is a Recurrence object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current recurrence object of an appointment series. @@ -18449,15 +17689,16 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is a Recurrence object. */ - getAsync(callback?: (result: Office.AsyncResult) => void): void; + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -18468,15 +17709,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
- * - * In addition to this signature, this method also has the following signature: - * - * `setAsync(recurrencePattern: Recurrence, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
* * @param recurrencePattern - A recurrence object. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -18484,7 +17721,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 Office.AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -18495,17 +17732,17 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
* * @param recurrencePattern - A recurrence object. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, callback?: (result: Office.AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -18515,9 +17752,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface RecurrenceProperties { /** @@ -18558,9 +17796,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface RecurrenceTimeZone { /** @@ -18615,9 +17854,9 @@ declare namespace Office { attachments?: ReplyFormAttachment[]; /** * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, - *asyncResult, which is an Office.AsyncResult object. + * asyncResult, which is an Office.AsyncResult object. */ - callback?: (result: Office.AsyncResult) => void; + callback?: (asyncResult: Office.AsyncResult) => void; } /** * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. @@ -18639,9 +17878,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface RoamingSettings { /** @@ -18650,9 +17890,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The case-sensitive name of the setting to retrieve. * @returns Type: String | Number | Boolean | Object | Array @@ -18664,9 +17905,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The case-sensitive name of the setting to remove. */ @@ -18681,14 +17923,15 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}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 Office.AsyncResult. */ - saveAsync(callback?: (result: Office.AsyncResult) => void): void; + saveAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets or creates the specified setting. * @@ -18702,9 +17945,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The case-sensitive name of the setting to set or create. * @param value - Specifies the value to be stored. @@ -18719,9 +17963,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface SeriesTime { /** @@ -18730,9 +17975,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getDuration(): number; @@ -18742,9 +17988,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getEndDate(): string; @@ -18756,9 +18003,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getEndTime(): string; @@ -18768,9 +18016,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getStartDate(): string; @@ -18781,9 +18030,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getStartTime(): string; @@ -18793,9 +18043,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param minutes - The length of the appointment in minutes. */ @@ -18807,16 +18058,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
- * - * In addition to this signature, this method also has the following signature: - * - * `setEndDate(date: string): void;` (Where date is the end date of the recurring appointment series represented in the - * {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* * @param year - The year value of the end date. * @param month - The month value of the end date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month. @@ -18829,11 +18075,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* * @param date - End date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD". */ @@ -18844,16 +18090,12 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* - * ErrorsInvalid date format - The date is not in an acceptable format. - * - * In addition to this signature, this method also has the following signature: - * - * `setStartDate(date: string): void;` (Where date is the start date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). - * * @param year - The year value of the start date. * @param month - The month value of the start date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month. * @param day - The day value of the start date. @@ -18866,11 +18108,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* * @param date - Start date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD". */ @@ -18883,15 +18125,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
- * - * In addition to this signature, this method also has the following signature: - * - * `setStartTime(time: string): void;` (Where time is the start time of all instances represented by standard datetime string format: "THH:mm:ss:mmm"). + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
* * @param hours - The hour value of the start time. Valid range: 0-24. * @param minutes - The minute value of the start time. Valid range: 0-59. @@ -18905,11 +18143,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
* * @param time - Start time of all instances represented by standard datetime string format: "THH:mm:ss:mmm". */ @@ -18922,9 +18160,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -18949,9 +18188,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Subject { /** @@ -18962,21 +18202,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is the subject of the item. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the subject of an appointment or message. * @@ -18985,14 +18222,15 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is the subject of the item. */ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -19002,27 +18240,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(subject: string): void;` - * - * `setAsync(subject: string, options: Office.AsyncContextOptions): void;` - * - * `setAsync(subject: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -19032,55 +18262,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* * @param subject - The subject of the appointment or message. The string is limited to 255 characters. - */ - setAsync(data: string): void; - /** - * Sets the subject of an appointment or message. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. - * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
- * - * @param subject - The subject of the appointment or message. The string is limited to 255 characters. - * @param 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. - */ - setAsync(data: string, options: Office.AsyncContextOptions): void; - /** - * Sets the subject of an appointment or message. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. - * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
- * - * @param subject - The subject of the appointment or message. The string is limited to 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -19092,9 +18284,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface TaskSuggestion { /** @@ -19112,9 +18305,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Time { /** @@ -19126,20 +18320,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is a Date object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the start or end time of an appointment. * @@ -19149,14 +18340,15 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is a Date object. */ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -19168,28 +18360,20 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(dateTime: Date): void;` - * - * `setAsync(dateTime: Date, options: Office.AsyncContextOptions): void;` - * - * `setAsync(dateTime: Date, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -19201,60 +18385,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* * @param dateTime - A date-time object in Coordinated Universal Time (UTC). - */ - setAsync(dateTime: Date): void; - /** - * Sets the start or end time of an appointment. - * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as - * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. - * - * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
- * - * @param dateTime - A date-time object in Coordinated Universal Time (UTC). - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - setAsync(dateTime: Date, options: Office.AsyncContextOptions): void; - /** - * Sets the start or end time of an appointment. - * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as - * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. - * - * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
- * - * @param dateTime - A date-time object in Coordinated Universal Time (UTC). - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, callback: (result: Office.AsyncResult) => void): void; + setAsync(dateTime: Date, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -19263,9 +18405,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface UserProfile { /** @@ -19277,9 +18420,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The possible account types are listed in the following table. * @@ -19313,9 +18457,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ displayName: string; /** @@ -19324,9 +18469,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ emailAddress: string; /** @@ -19335,9 +18481,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ timeZone: string; } @@ -20190,6 +19337,47 @@ declare namespace Excel { */ type: "WorkbookAutoSaveSettingChanged"; } + /** + * + * Provide information about the detail of WorksheetChangedEvent/TableChangedEvent + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + interface ChangedEventDetail { + /** + * + * Represents the value after changed. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + valueAfter: any; + /** + * + * Represents the value before changed. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + valueBefore: any; + /** + * + * Represents the type of value after changed + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + valueTypeAfter: Excel.RangeValueType | "Unknown" | "Empty" | "String" | "Integer" | "Double" | "Boolean" | "Error" | "RichValue"; + /** + * + * Represents the type of value before changed + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + valueTypeBefore: Excel.RangeValueType | "Unknown" | "Empty" | "String" | "Integer" | "Double" | "Boolean" | "Error" | "RichValue"; + } /** * * Provides information about the worksheet that raised the Changed event. @@ -20211,6 +19399,13 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ changeType: Excel.DataChangeType | "Unknown" | "RangeEdited" | "RowInserted" | "RowDeleted" | "ColumnInserted" | "ColumnDeleted" | "CellInserted" | "CellDeleted"; + /** + * + * Represents the information about the change detail + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + */ + details: Excel.ChangedEventDetail; /** * * Gets the source of the event. See Excel.EventSource for details. @@ -20351,6 +19546,13 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ worksheetId: string; + /** + * + * Represents the information about the change detail + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + */ + details: Excel.ChangedEventDetail; /** * * Gets the range that represents the changed area of a table on a specific worksheet. @@ -21845,7 +21047,7 @@ declare namespace Excel { copy(positionType?: "None" | "Before" | "After" | "Beginning" | "End", relativeTo?: Excel.Worksheet): Excel.Worksheet; /** * - * Deletes the worksheet from the workbook. + * Deletes the worksheet from the workbook. Note that if the worksheet's visibility is set to "VeryHidden", the delete operation will fail with a GeneralException. * * [Api set: ExcelApi 1.1] */ @@ -22761,7 +21963,28 @@ declare namespace Excel { set(properties: Interfaces.RangeUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ set(properties: Excel.Range): void; + /** + * + * Fills range from the current range to the destination range. + The destination range must extend the source either horizontally or vertically. Discontiguous ranges are not supported. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param destinationRange The destination range to autofill. + * @param autoFillType The type of autofill. Specifies how the destination range is to be filled, based on the contents of the current range. Default is "FillDefault". + */ autoFill(destinationRange: Range | string, autoFillType?: Excel.AutoFillType): void; + /** + * + * Fills range from the current range to the destination range. + The destination range must extend the source either horizontally or vertically. Discontiguous ranges are not supported. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * + * @param destinationRange The destination range to autofill. + * @param autoFillType The type of autofill. Specifies how the destination range is to be filled, based on the contents of the current range. Default is "FillDefault". + */ autoFill(destinationRange: Range | string, autoFillType?: "FillDefault" | "FillCopy" | "FillSeries" | "FillFormats" | "FillValues" | "FillDays" | "FillWeekdays" | "FillMonths" | "FillYears" | "LinearTrend" | "GrowthTrend" | "FlashFill"): void; /** * @@ -22879,6 +22102,14 @@ declare namespace Excel { * @returns The Range which matched the search criteria. */ findOrNullObject(text: string, criteria: Excel.SearchCriteria): Excel.Range; + /** + * + * Does FlashFill to current range. Flash Fill will automatically fills data when it senses a pattern, so the range must be single column range and have data around in order to find pattern. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + flashFill(): void; /** * * Gets a Range object with the same top-left cell as the current Range object, but with the specified numbers of rows and columns. @@ -23088,7 +22319,7 @@ declare namespace Excel { * @param cellType The type of cells to include. * @param cellValueType If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type. */ - getSpecialCells(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Comments" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; + getSpecialCells(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; /** * * Gets the RangeAreas object, comprising one or more ranges, that represents all the cells that match the specified type and value. @@ -23111,7 +22342,7 @@ declare namespace Excel { * @param cellType The type of cells to include. * @param cellValueType If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type. */ - getSpecialCellsOrNullObject(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Comments" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; + getSpecialCellsOrNullObject(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; /** * * Gets the range object containing the anchor cell for a cell getting spilled into. Fails if applied to a range with more than one cell. Read only. @@ -23626,7 +22857,7 @@ declare namespace Excel { * @param cellType The type of cells to include. * @param cellValueType If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type. */ - getSpecialCells(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Comments" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; + getSpecialCells(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; /** * * Returns a RangeAreas object that represents all the cells that match the specified type and value. Returns a null object if no special cells are found that match the criteria. @@ -23648,7 +22879,7 @@ declare namespace Excel { * @param cellType The type of cells to include. * @param cellValueType If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type. */ - getSpecialCellsOrNullObject(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Comments" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; + getSpecialCellsOrNullObject(cellType: "ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas; /** * * Returns a scoped collection of tables that overlap with any range in this RangeAreas object. @@ -36060,7 +35291,7 @@ declare namespace Excel { * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta * - * @param index Index value of the object to be retrieved. Zero-indexed. + * @param index Index value of the style object to be retrieved. Zero-indexed. */ getItemAt(index: number): Excel.Style; /** @@ -37297,12 +36528,8 @@ declare namespace Excel { * @beta * * @param geometricShapeType Represents the geometric type of the shape. See Excel.GeometricShapeType for details. - * @param left The distance, in points, from the left side of the shape to the left side of the worksheet. - * @param top The distance, in points, from the top edge of the shape to the top of the worksheet. - * @param width The width, in points, of the shape. - * @param height The height, in points, of the shape. */ - addGeometricShape(geometricShapeType: Excel.GeometricShapeType, left: number, top: number, width: number, height: number): Excel.Shape; + addGeometricShape(geometricShapeType: Excel.GeometricShapeType): Excel.Shape; /** * * Adds a geometric shape to worksheet. Returns a Shape object that represents the new shape. @@ -37311,12 +36538,8 @@ declare namespace Excel { * @beta * * @param geometricShapeType Represents the geometric type of the shape. See Excel.GeometricShapeType for details. - * @param left The distance, in points, from the left side of the shape to the left side of the worksheet. - * @param top The distance, in points, from the top edge of the shape to the top of the worksheet. - * @param width The width, in points, of the shape. - * @param height The height, in points, of the shape. */ - addGeometricShape(geometricShapeType: "LineInverse" | "Triangle" | "RightTriangle" | "Rectangle" | "Diamond" | "Parallelogram" | "Trapezoid" | "NonIsoscelesTrapezoid" | "Pentagon" | "Hexagon" | "Heptagon" | "Octagon" | "Decagon" | "Dodecagon" | "Star4" | "Star5" | "Star6" | "Star7" | "Star8" | "Star10" | "Star12" | "Star16" | "Star24" | "Star32" | "RoundRectangle" | "Round1Rectangle" | "Round2SameRectangle" | "Round2DiagonalRectangle" | "SnipRoundRectangle" | "Snip1Rectangle" | "Snip2SameRectangle" | "Snip2DiagonalRectangle" | "Plaque" | "Ellipse" | "Teardrop" | "HomePlate" | "Chevron" | "PieWedge" | "Pie" | "BlockArc" | "Donut" | "NoSmoking" | "RightArrow" | "LeftArrow" | "UpArrow" | "DownArrow" | "StripedRightArrow" | "NotchedRightArrow" | "BentUpArrow" | "LeftRightArrow" | "UpDownArrow" | "LeftUpArrow" | "LeftRightUpArrow" | "QuadArrow" | "LeftArrowCallout" | "RightArrowCallout" | "UpArrowCallout" | "DownArrowCallout" | "LeftRightArrowCallout" | "UpDownArrowCallout" | "QuadArrowCallout" | "BentArrow" | "UturnArrow" | "CircularArrow" | "LeftCircularArrow" | "LeftRightCircularArrow" | "CurvedRightArrow" | "CurvedLeftArrow" | "CurvedUpArrow" | "CurvedDownArrow" | "SwooshArrow" | "Cube" | "Can" | "LightningBolt" | "Heart" | "Sun" | "Moon" | "SmileyFace" | "IrregularSeal1" | "IrregularSeal2" | "FoldedCorner" | "Bevel" | "Frame" | "HalfFrame" | "Corner" | "DiagonalStripe" | "Chord" | "Arc" | "LeftBracket" | "RightBracket" | "LeftBrace" | "RightBrace" | "BracketPair" | "BracePair" | "Callout1" | "Callout2" | "Callout3" | "AccentCallout1" | "AccentCallout2" | "AccentCallout3" | "BorderCallout1" | "BorderCallout2" | "BorderCallout3" | "AccentBorderCallout1" | "AccentBorderCallout2" | "AccentBorderCallout3" | "WedgeRectCallout" | "WedgeRRectCallout" | "WedgeEllipseCallout" | "CloudCallout" | "Cloud" | "Ribbon" | "Ribbon2" | "EllipseRibbon" | "EllipseRibbon2" | "LeftRightRibbon" | "VerticalScroll" | "HorizontalScroll" | "Wave" | "DoubleWave" | "Plus" | "FlowChartProcess" | "FlowChartDecision" | "FlowChartInputOutput" | "FlowChartPredefinedProcess" | "FlowChartInternalStorage" | "FlowChartDocument" | "FlowChartMultidocument" | "FlowChartTerminator" | "FlowChartPreparation" | "FlowChartManualInput" | "FlowChartManualOperation" | "FlowChartConnector" | "FlowChartPunchedCard" | "FlowChartPunchedTape" | "FlowChartSummingJunction" | "FlowChartOr" | "FlowChartCollate" | "FlowChartSort" | "FlowChartExtract" | "FlowChartMerge" | "FlowChartOfflineStorage" | "FlowChartOnlineStorage" | "FlowChartMagneticTape" | "FlowChartMagneticDisk" | "FlowChartMagneticDrum" | "FlowChartDisplay" | "FlowChartDelay" | "FlowChartAlternateProcess" | "FlowChartOffpageConnector" | "ActionButtonBlank" | "ActionButtonHome" | "ActionButtonHelp" | "ActionButtonInformation" | "ActionButtonForwardNext" | "ActionButtonBackPrevious" | "ActionButtonEnd" | "ActionButtonBeginning" | "ActionButtonReturn" | "ActionButtonDocument" | "ActionButtonSound" | "ActionButtonMovie" | "Gear6" | "Gear9" | "Funnel" | "MathPlus" | "MathMinus" | "MathMultiply" | "MathDivide" | "MathEqual" | "MathNotEqual" | "CornerTabs" | "SquareTabs" | "PlaqueTabs" | "ChartX" | "ChartStar" | "ChartPlus", left: number, top: number, width: number, height: number): Excel.Shape; + addGeometricShape(geometricShapeType: "LineInverse" | "Triangle" | "RightTriangle" | "Rectangle" | "Diamond" | "Parallelogram" | "Trapezoid" | "NonIsoscelesTrapezoid" | "Pentagon" | "Hexagon" | "Heptagon" | "Octagon" | "Decagon" | "Dodecagon" | "Star4" | "Star5" | "Star6" | "Star7" | "Star8" | "Star10" | "Star12" | "Star16" | "Star24" | "Star32" | "RoundRectangle" | "Round1Rectangle" | "Round2SameRectangle" | "Round2DiagonalRectangle" | "SnipRoundRectangle" | "Snip1Rectangle" | "Snip2SameRectangle" | "Snip2DiagonalRectangle" | "Plaque" | "Ellipse" | "Teardrop" | "HomePlate" | "Chevron" | "PieWedge" | "Pie" | "BlockArc" | "Donut" | "NoSmoking" | "RightArrow" | "LeftArrow" | "UpArrow" | "DownArrow" | "StripedRightArrow" | "NotchedRightArrow" | "BentUpArrow" | "LeftRightArrow" | "UpDownArrow" | "LeftUpArrow" | "LeftRightUpArrow" | "QuadArrow" | "LeftArrowCallout" | "RightArrowCallout" | "UpArrowCallout" | "DownArrowCallout" | "LeftRightArrowCallout" | "UpDownArrowCallout" | "QuadArrowCallout" | "BentArrow" | "UturnArrow" | "CircularArrow" | "LeftCircularArrow" | "LeftRightCircularArrow" | "CurvedRightArrow" | "CurvedLeftArrow" | "CurvedUpArrow" | "CurvedDownArrow" | "SwooshArrow" | "Cube" | "Can" | "LightningBolt" | "Heart" | "Sun" | "Moon" | "SmileyFace" | "IrregularSeal1" | "IrregularSeal2" | "FoldedCorner" | "Bevel" | "Frame" | "HalfFrame" | "Corner" | "DiagonalStripe" | "Chord" | "Arc" | "LeftBracket" | "RightBracket" | "LeftBrace" | "RightBrace" | "BracketPair" | "BracePair" | "Callout1" | "Callout2" | "Callout3" | "AccentCallout1" | "AccentCallout2" | "AccentCallout3" | "BorderCallout1" | "BorderCallout2" | "BorderCallout3" | "AccentBorderCallout1" | "AccentBorderCallout2" | "AccentBorderCallout3" | "WedgeRectCallout" | "WedgeRRectCallout" | "WedgeEllipseCallout" | "CloudCallout" | "Cloud" | "Ribbon" | "Ribbon2" | "EllipseRibbon" | "EllipseRibbon2" | "LeftRightRibbon" | "VerticalScroll" | "HorizontalScroll" | "Wave" | "DoubleWave" | "Plus" | "FlowChartProcess" | "FlowChartDecision" | "FlowChartInputOutput" | "FlowChartPredefinedProcess" | "FlowChartInternalStorage" | "FlowChartDocument" | "FlowChartMultidocument" | "FlowChartTerminator" | "FlowChartPreparation" | "FlowChartManualInput" | "FlowChartManualOperation" | "FlowChartConnector" | "FlowChartPunchedCard" | "FlowChartPunchedTape" | "FlowChartSummingJunction" | "FlowChartOr" | "FlowChartCollate" | "FlowChartSort" | "FlowChartExtract" | "FlowChartMerge" | "FlowChartOfflineStorage" | "FlowChartOnlineStorage" | "FlowChartMagneticTape" | "FlowChartMagneticDisk" | "FlowChartMagneticDrum" | "FlowChartDisplay" | "FlowChartDelay" | "FlowChartAlternateProcess" | "FlowChartOffpageConnector" | "ActionButtonBlank" | "ActionButtonHome" | "ActionButtonHelp" | "ActionButtonInformation" | "ActionButtonForwardNext" | "ActionButtonBackPrevious" | "ActionButtonEnd" | "ActionButtonBeginning" | "ActionButtonReturn" | "ActionButtonDocument" | "ActionButtonSound" | "ActionButtonMovie" | "Gear6" | "Gear9" | "Funnel" | "MathPlus" | "MathMinus" | "MathMultiply" | "MathDivide" | "MathEqual" | "MathNotEqual" | "CornerTabs" | "SquareTabs" | "PlaqueTabs" | "ChartX" | "ChartStar" | "ChartPlus"): Excel.Shape; /** * * Group a subset of shapes in a worksheet. Returns a Shape object that represents the new group of shapes. @@ -37527,6 +36750,14 @@ declare namespace Excel { * @beta */ altTextTitle: string; + /** + * + * Returns the number of connection sites on the specified shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly connectionSiteCount: number; /** * * Represents the geometric shape type of the specified shape. See Excel.GeometricShapeType for detail. Returns null if the shape is not geometric, for example, get GeometricShapeType of a line or a chart will return null. @@ -38084,6 +37315,22 @@ declare namespace Excel { class Line extends OfficeExtension.ClientObject { /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ context: RequestContext; + /** + * + * Represents the shape object that the beginning of the specified line is attached to. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly beginConnectedShape: Excel.Shape; + /** + * + * Represents the shape object that the end of the specified line is attached to. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly endConnectedShape: Excel.Shape; /** * * Returns the shape object for the line. Read-only. @@ -38092,6 +37339,70 @@ declare namespace Excel { * @beta */ readonly shape: Excel.Shape; + /** + * + * Represents the length of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadLength: Excel.ArrowHeadLength | "Short" | "Medium" | "Long"; + /** + * + * Represents the style of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadStyle: Excel.ArrowHeadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"; + /** + * + * Represents the width of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadWidth: Excel.ArrowHeadWidth | "Narrow" | "Medium" | "Wide"; + /** + * + * Represents an integer that specifies the connection site that the beginning of a connector is connected to. Read-only. Returns null when the beginning of the line is not attached to any shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly beginConnectedSite: number; + /** + * + * Represents the length of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadLength: Excel.ArrowHeadLength | "Short" | "Medium" | "Long"; + /** + * + * Represents the style of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadStyle: Excel.ArrowHeadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"; + /** + * + * Represents the width of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadWidth: Excel.ArrowHeadWidth | "Narrow" | "Medium" | "Wide"; + /** + * + * Represents an integer that specifies the connection site that the end of a connector is connected to. Read-only. Returns null when the end of the line is not attached to any shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly endConnectedSite: number; /** * * Represents the shape identifier. Read-only. @@ -38100,6 +37411,22 @@ declare namespace Excel { * @beta */ readonly id: string; + /** + * + * Represents whether the beginning of the specified line is connected to a shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly isBeginConnected: boolean; + /** + * + * Represents whether the end of the specified line is connected to a shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + readonly isEndConnected: boolean; /** * * Represents the connector type for the line. @@ -38122,6 +37449,44 @@ declare namespace Excel { set(properties: Interfaces.LineUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ set(properties: Excel.Line): void; + /** + * + * Attaches the beginning of the specified connector to a specified shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param shape The shape to attach the beginning of the connector to. + * @param connectionSite The connection site on the shape which the beginning of the connector attach to. Must be an integer between 0 and the connection site count(not included) of the specified shape. + */ + beginConnect(shape: Excel.Shape, connectionSite: number): void; + /** + * + * Detaches the beginning of the specified connector from the shape it's attached to. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginDisconnect(): void; + /** + * + * Attaches the end of the specified connector to a specified shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + * + * @param shape The shape to attach the end of the connector to. + * @param connectionSite The connection site on the shape which the end of the connector attach to. Must be an integer between 0 and the connection site count(not included) of the specified shape. + */ + endConnect(shape: Excel.Shape, connectionSite: number): void; + /** + * + * Detaches the end of the specified connector from the shape it's attached to. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endDisconnect(): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -38351,6 +37716,13 @@ declare namespace Excel { class TextFrame extends OfficeExtension.ClientObject { /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ context: RequestContext; + /** + * + * Represents the text range in the text frame. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ readonly textRange: Excel.TextRange; /** * @@ -38757,7 +38129,7 @@ declare namespace Excel { nameInFormula: string; /** * - * Represents the sort order of the items in the slicer. + * Represents the sort order of the items in the slicer. Possible values are: DataSourceOrder, Ascending, Descending. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -38773,7 +38145,7 @@ declare namespace Excel { style: string; /** * - * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + * Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an invalid argument exception when set with negative value as input. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -38821,7 +38193,7 @@ declare namespace Excel { delete(): void; /** * - * Returns an array of selected items' names. Read-only. + * Returns an array of selected items' keys. Read-only. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -38829,8 +38201,8 @@ declare namespace Excel { getSelectedItems(): OfficeExtension.ClientResult; /** * - * Select slicer items based on their names. Previous selection will be cleared. - All items will be deselected if the array is empty. + * Select slicer items based on their keys. Previous selection will be cleared. + All items will be selected by default if the array is empty. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -38972,7 +38344,9 @@ declare namespace Excel { readonly hasData: boolean; /** * - * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * True if the slicer item is selected. + Setting this value will not clear other SlicerItems' selected state. + By default, if the slicer item is the only one selected, when it is deselected, all items will be selected. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -39817,6 +39191,36 @@ declare namespace Excel { systemDot = "SystemDot", systemDashDot = "SystemDashDot" } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum ArrowHeadLength { + short = "Short", + medium = "Medium", + long = "Long" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum ArrowHeadStyle { + none = "None", + triangle = "Triangle", + stealth = "Stealth", + diamond = "Diamond", + oval = "Oval", + open = "Open" + } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum ArrowHeadWidth { + narrow = "Narrow", + medium = "Medium", + wide = "Wide" + } /** * [Api set: ExcelApi 1.1] */ @@ -40729,7 +40133,13 @@ declare namespace Excel { * */ worksheetFormatChanged = "WorksheetFormatChanged", - wacoperationEvent = "WACOperationEvent" + wacoperationEvent = "WACOperationEvent", + /** + * + * RibbonCommandExecuted represents the type of event registered on ribbon, and occurs when user click on ribbon + * + */ + ribbonCommandExecuted = "RibbonCommandExecuted" } /** * [Api set: ExcelApi 1.7] @@ -41339,12 +40749,6 @@ declare namespace Excel { * */ blanks = "Blanks", - /** - * - * Cells containing comments. - * - */ - comments = "Comments", /** * * Cells containing constants. @@ -41638,6 +41042,24 @@ declare namespace Excel { ascending = "Ascending", descending = "Descending" } + /** + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + enum RibbonTab { + others = "Others", + home = "Home", + insert = "Insert", + draw = "Draw", + pageLayout = "PageLayout", + formulas = "Formulas", + data = "Data", + review = "Review", + view = "View", + developer = "Developer", + addIns = "AddIns", + help = "Help" + } /** * * An object containing the result of a function-evaluation operation @@ -49801,6 +49223,54 @@ declare namespace Excel { } /** An interface for updating data on the Line object, for use in "line.set({ ... })". */ interface LineUpdateData { + /** + * + * Represents the length of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadLength?: Excel.ArrowHeadLength | "Short" | "Medium" | "Long"; + /** + * + * Represents the style of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadStyle?: Excel.ArrowHeadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"; + /** + * + * Represents the width of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadWidth?: Excel.ArrowHeadWidth | "Narrow" | "Medium" | "Wide"; + /** + * + * Represents the length of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadLength?: Excel.ArrowHeadLength | "Short" | "Medium" | "Long"; + /** + * + * Represents the style of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadStyle?: Excel.ArrowHeadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"; + /** + * + * Represents the width of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadWidth?: Excel.ArrowHeadWidth | "Narrow" | "Medium" | "Wide"; /** * * Represents the connector type for the line. @@ -50095,7 +49565,7 @@ declare namespace Excel { nameInFormula?: string; /** * - * Represents the sort order of the items in the slicer. + * Represents the sort order of the items in the slicer. Possible values are: DataSourceOrder, Ascending, Descending. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -50111,7 +49581,7 @@ declare namespace Excel { style?: string; /** * - * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + * Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an invalid argument exception when set with negative value as input. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -50136,7 +49606,9 @@ declare namespace Excel { interface SlicerItemUpdateData { /** * - * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * True if the slicer item is selected. + Setting this value will not clear other SlicerItems' selected state. + By default, if the slicer item is the only one selected, when it is deselected, all items will be selected. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -55519,6 +54991,14 @@ declare namespace Excel { * @beta */ altTextTitle?: string; + /** + * + * Returns the number of connection sites on the specified shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectionSiteCount?: number; /** * * Represents the geometric shape type of the specified shape. See Excel.GeometricShapeType for detail. Returns null if the shape is not geometric, for example, get GeometricShapeType of a line or a chart will return null. @@ -55691,6 +55171,70 @@ declare namespace Excel { } /** An interface describing the data returned by calling "line.toJSON()". */ interface LineData { + /** + * + * Represents the length of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadLength?: Excel.ArrowHeadLength | "Short" | "Medium" | "Long"; + /** + * + * Represents the style of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadStyle?: Excel.ArrowHeadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"; + /** + * + * Represents the width of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadWidth?: Excel.ArrowHeadWidth | "Narrow" | "Medium" | "Wide"; + /** + * + * Represents an integer that specifies the connection site that the beginning of a connector is connected to. Read-only. Returns null when the beginning of the line is not attached to any shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginConnectedSite?: number; + /** + * + * Represents the length of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadLength?: Excel.ArrowHeadLength | "Short" | "Medium" | "Long"; + /** + * + * Represents the style of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadStyle?: Excel.ArrowHeadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"; + /** + * + * Represents the width of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadWidth?: Excel.ArrowHeadWidth | "Narrow" | "Medium" | "Wide"; + /** + * + * Represents an integer that specifies the connection site that the end of a connector is connected to. Read-only. Returns null when the end of the line is not attached to any shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endConnectedSite?: number; /** * * Represents the shape identifier. Read-only. @@ -55699,6 +55243,22 @@ declare namespace Excel { * @beta */ id?: string; + /** + * + * Represents whether the beginning of the specified line is connected to a shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isBeginConnected?: boolean; + /** + * + * Represents whether the end of the specified line is connected to a shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isEndConnected?: boolean; /** * * Represents the connector type for the line. @@ -56033,7 +55593,7 @@ declare namespace Excel { nameInFormula?: string; /** * - * Represents the sort order of the items in the slicer. + * Represents the sort order of the items in the slicer. Possible values are: DataSourceOrder, Ascending, Descending. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -56049,7 +55609,7 @@ declare namespace Excel { style?: string; /** * - * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + * Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an invalid argument exception when set with negative value as input. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -56082,7 +55642,9 @@ declare namespace Excel { hasData?: boolean; /** * - * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * True if the slicer item is selected. + Setting this value will not clear other SlicerItems' selected state. + By default, if the slicer item is the only one selected, when it is deselected, all items will be selected. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -64299,6 +63861,14 @@ declare namespace Excel { * @beta */ altTextTitle?: boolean; + /** + * + * For EACH ITEM in the collection: Returns the number of connection sites on the specified shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectionSiteCount?: boolean; /** * * For EACH ITEM in the collection: Represents the geometric shape type of the specified shape. See Excel.GeometricShapeType for detail. Returns null if the shape is not geometric, for example, get GeometricShapeType of a line or a chart will return null. @@ -64505,6 +64075,14 @@ declare namespace Excel { * @beta */ altTextTitle?: boolean; + /** + * + * Returns the number of connection sites on the specified shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectionSiteCount?: boolean; /** * * Represents the geometric shape type of the specified shape. See Excel.GeometricShapeType for detail. Returns null if the shape is not geometric, for example, get GeometricShapeType of a line or a chart will return null. @@ -64797,6 +64375,14 @@ declare namespace Excel { * @beta */ altTextTitle?: boolean; + /** + * + * For EACH ITEM in the collection: Returns the number of connection sites on the specified shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + connectionSiteCount?: boolean; /** * * For EACH ITEM in the collection: Represents the geometric shape type of the specified shape. See Excel.GeometricShapeType for detail. Returns null if the shape is not geometric, for example, get GeometricShapeType of a line or a chart will return null. @@ -64925,12 +64511,92 @@ declare namespace Excel { $all?: boolean; /** * + * Represents the shape object that the beginning of the specified line is attached to. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginConnectedShape?: Excel.Interfaces.ShapeLoadOptions; + /** + * + * Represents the shape object that the end of the specified line is attached to. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endConnectedShape?: Excel.Interfaces.ShapeLoadOptions; + /** + * * Returns the shape object for the line. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta */ shape?: Excel.Interfaces.ShapeLoadOptions; + /** + * + * Represents the length of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadLength?: boolean; + /** + * + * Represents the style of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadStyle?: boolean; + /** + * + * Represents the width of the arrowhead at the beginning of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginArrowHeadWidth?: boolean; + /** + * + * Represents an integer that specifies the connection site that the beginning of a connector is connected to. Read-only. Returns null when the beginning of the line is not attached to any shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + beginConnectedSite?: boolean; + /** + * + * Represents the length of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadLength?: boolean; + /** + * + * Represents the style of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadStyle?: boolean; + /** + * + * Represents the width of the arrowhead at the end of the specified line. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endArrowHeadWidth?: boolean; + /** + * + * Represents an integer that specifies the connection site that the end of a connector is connected to. Read-only. Returns null when the end of the line is not attached to any shape. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + endConnectedSite?: boolean; /** * * Represents the shape identifier. Read-only. @@ -64939,6 +64605,22 @@ declare namespace Excel { * @beta */ id?: boolean; + /** + * + * Represents whether the beginning of the specified line is connected to a shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isBeginConnected?: boolean; + /** + * + * Represents whether the end of the specified line is connected to a shape. Read-only. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ + isEndConnected?: boolean; /** * * Represents the connector type for the line. @@ -65049,6 +64731,13 @@ declare namespace Excel { */ interface TextFrameLoadOptions { $all?: boolean; + /** + * + * Represents the text range in the text frame. + * + * [Api set: ExcelApi BETA (PREVIEW ONLY)] + * @beta + */ textRange?: Excel.Interfaces.TextRangeLoadOptions; /** * @@ -65305,7 +64994,7 @@ declare namespace Excel { nameInFormula?: boolean; /** * - * Represents the sort order of the items in the slicer. + * Represents the sort order of the items in the slicer. Possible values are: DataSourceOrder, Ascending, Descending. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -65321,7 +65010,7 @@ declare namespace Excel { style?: boolean; /** * - * Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + * Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an invalid argument exception when set with negative value as input. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -65415,7 +65104,7 @@ declare namespace Excel { nameInFormula?: boolean; /** * - * For EACH ITEM in the collection: Represents the sort order of the items in the slicer. + * For EACH ITEM in the collection: Represents the sort order of the items in the slicer. Possible values are: DataSourceOrder, Ascending, Descending. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -65431,7 +65120,7 @@ declare namespace Excel { style?: boolean; /** * - * For EACH ITEM in the collection: Represents the distance, in points, from the top edge of the slicer to the right of the worksheet. + * For EACH ITEM in the collection: Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an invalid argument exception when set with negative value as input. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] @@ -65467,7 +65156,9 @@ declare namespace Excel { hasData?: boolean; /** * - * True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * True if the slicer item is selected. + Setting this value will not clear other SlicerItems' selected state. + By default, if the slicer item is the only one selected, when it is deselected, all items will be selected. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -65509,7 +65200,9 @@ declare namespace Excel { hasData?: boolean; /** * - * For EACH ITEM in the collection: True if the slicer item is selected. Setting this value will not clear other SlicerItems' selected state. + * For EACH ITEM in the collection: True if the slicer item is selected. + Setting this value will not clear other SlicerItems' selected state. + By default, if the slicer item is the only one selected, when it is deselected, all items will be selected. * * [Api set: ExcelApi BETA (PREVIEW ONLY)] * @beta @@ -65558,6 +65251,7 @@ declare namespace Excel { } } + //////////////////////////////////////////////////////////////// //////////////////////// End Excel APIs //////////////////////// //////////////////////////////////////////////////////////////// diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index caafa47822..ef05ead31d 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -729,7 +729,7 @@ declare namespace Office { * * In content add-ins for Access web apps, the `displayLanguage property` gets the add-in language (e.g., "en-US"). * - * When using in Outlook, the applicable modes are Compose or read. + * When using in Outlook, the applicable modes are Compose or Read. * * **Support details** * @@ -797,9 +797,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ mailbox: Office.Mailbox; /** @@ -823,9 +824,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ roamingSettings: Office.RoamingSettings; /** @@ -905,11 +907,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
Add-in typeContent, task pane, Outlook
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * + * + * + *
Add-in typeContent, task pane, Outlook
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Event { @@ -945,9 +947,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * **Support details** * @@ -997,9 +1000,10 @@ declare namespace Office { * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * * @remarks - * - * - *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
+ * + * + * + *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
* * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 * for Outlook. For more on how to specify a requirement set in your manifest, see @@ -1097,9 +1101,10 @@ declare namespace Office { * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * * @remarks - * - * - *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
+ * + * + * + *
HostsWord, Excel, Outlook, PowerPoint
Requirement setsDialogApi, Mailbox 1.4
* * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 * for Outlook. For more on how to specify a requirement set in your manifest, see @@ -1911,7 +1916,7 @@ declare namespace Office { * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and * `Office.EventType.ViewSelectionChanged` event types. * - * BindingDataChanged and BindingSelectionChanged hosts
Access, Excel, Word
+ *
BindingDataChanged and BindingSelectionChanged hostsAccess, Excel, Word
* * @remarks * @@ -2046,6 +2051,12 @@ declare namespace Office { * [Api set: Mailbox 1.5] */ ItemChanged, + /** + * Triggers when the appointment location is changed in Outlook. + * + * [Api set: Mailbox Preview] + */ + EnhancedLocationsChanged, /** * Triggers when a customXmlPart node is deleted. */ @@ -3360,9 +3371,10 @@ declare namespace Office { * Asynchronously sets the text of an XML node in a custom XML part. * * @remarks - * - * - *
HostsWord
Requirement SetsCustomXmlParts
+ * + * + * + *
HostsWord
Requirement SetsCustomXmlParts
* * @param text Required. The text value of the XML node. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. @@ -3373,9 +3385,10 @@ declare namespace Office { * Asynchronously sets the text of an XML node in a custom XML part. * * @remarks - * - * - *
HostsWord
Requirement SetsCustomXmlParts
+ * + * + * + *
HostsWord
Requirement SetsCustomXmlParts
* * @param text Required. The text value of the XML node. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. @@ -4540,26 +4553,94 @@ declare namespace Office { * The following application-specific actions apply when writing data to a selection. * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * + * + * + * + * + * + * + * + * + * + * * - * + * + * + * + * + * *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* * The possible values for the {@link Office.CoercionType} parameter vary by the host. @@ -4657,26 +4738,93 @@ declare namespace Office { * The following application-specific actions apply when writing data to a selection. * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * - * - * + * + * + * + * + * + * + * + * + * + * * - * + * + * + * + * + * *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* * The possible values for the {@link Office.CoercionType} parameter vary by the host. @@ -5625,18 +5773,20 @@ declare namespace Office { * Gets the number of columns in the matrix data structure, as an integer value. * * @remarks - * - * - *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
+ * + * + * + *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
*/ columnCount: number; /** * Gets the number of rows in the matrix data structure, as an integer value. * * @remarks - * - * - *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
+ * + * + * + *
HostsAccess, Excel, PowerPoint, Project, Word
Requirement SetsMatrixBindings
*/ rowCount: number; } @@ -5644,9 +5794,10 @@ declare namespace Office { * Represents custom settings for a task pane or content add-in that are stored in the host document as name/value pairs. * * @remarks - * - * - *
HostsAccess, Excel, PowerPoint, Word
Requirement SetsSettings
+ * + * + * + *
HostsAccess, Excel, PowerPoint, Word
Requirement SetsSettings
* * The settings created by using the methods of the Settings object are saved per add-in and per document. * That is, they are available only to the add-in that created them, and only from the document in which they are saved. @@ -6892,9 +7043,10 @@ declare namespace Office { * Updates table formatting options on the bound table. * * @remarks - * - * - *
HostsExcel
Requirement SetsNot in a set
+ * + * + * + *
HostsExcel
Requirement SetsNot in a set
* * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * @@ -6945,9 +7097,10 @@ declare namespace Office { * Updates table formatting options on the bound table. * * @remarks - * - * - *
HostsExcel
Requirement SetsNot in a set
+ * + * + * + *
HostsExcel
Requirement SetsNot in a set
* * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * @@ -6998,9 +7151,10 @@ declare namespace Office { * Represents the data in a table or an {@link Office.TableBinding}. * * @remarks - * - * - *
HostsExcel, Word
Requirement SetsTableBindings
+ * + * + * + *
HostsExcel, Word
Requirement SetsTableBindings
*/ class TableData { constructor(rows: any[][], headers: any[]); @@ -7009,10 +7163,11 @@ declare namespace Office { * Gets or sets the headers of the table. * * @remarks - * + *
HostsExcel, Word
+ * + * + *
HostsExcel, Word
Requirement SetsTableBindings
* - * Requirement SetsTableBindings - * * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers * for a two-column table you would set the header property to [['header1', 'header2']]. * @@ -7029,10 +7184,11 @@ declare namespace Office { * Returns an empty array if there are no rows. * * @remarks - * + *
HostsExcel, Word
+ * + * + *
HostsExcel, Word
Requirement SetsTableBindings
* - * Requirement SetsTableBindings - * * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of * string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. * @@ -9279,9 +9435,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -9312,9 +9468,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -9335,9 +9491,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum AttachmentType { /** @@ -9359,9 +9515,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum Days { /** @@ -9411,9 +9567,9 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -9449,9 +9605,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum EntityType { /** @@ -9489,9 +9645,9 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum ItemNotificationMessageType { /** @@ -9513,9 +9669,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum ItemType { /** @@ -9534,10 +9690,7 @@ declare namespace Office { * * @remarks * - * - * - * - * + * *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta @@ -9558,9 +9711,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum Month { /** @@ -9636,9 +9789,9 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RecipientType { /** @@ -9664,9 +9817,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RecurrenceTimeZone { /** @@ -10222,9 +10375,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RecurrenceType { /** @@ -10254,9 +10407,9 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum ResponseType { /** @@ -10286,9 +10439,9 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum RestVersion { /** @@ -10310,9 +10463,9 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - *
- * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode} - * Compose or read
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ enum WeekNumber { /** @@ -10356,9 +10509,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface AppointmentForm { /** @@ -10368,9 +10522,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ body: string; /** @@ -10394,9 +10549,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ end: Date; /** @@ -10414,8 +10570,10 @@ declare namespace Office { * * @remarks * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ location: string; /** @@ -10433,11 +10591,24 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ optionalAttendees: string[] | EmailAddressDetails[]; + /** + * Provides access to the resources of an event. Returns an array of strings containing the resources required for the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ */ resources: string[]; /** * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. @@ -10454,9 +10625,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ requiredAttendees: string[] | EmailAddressDetails[]; /** @@ -10480,9 +10652,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ start: Date; /** @@ -10502,9 +10675,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ subject: string; } @@ -10514,9 +10688,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -10546,9 +10721,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface AttachmentDetails { /** @@ -10583,9 +10759,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Body { /** @@ -10600,13 +10777,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, this method also has the following signature: - * - * `getAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 options - Optional. An object literal that contains one or more of the following properties: @@ -10614,7 +10788,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 Office.AsyncResult. * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coercionType: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(coercionType: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current body in a specified format. * @@ -10627,32 +10801,48 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; - + getAsync(coercionType: Office.CoercionType, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. * * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @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 Office.AsyncResult. * The content type is returned as one of the CoercionType values in the asyncResult.value property. */ - getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getTypeAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets a value that indicates whether the content is in HTML or text format. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * The content type is returned as one of the CoercionType values in the asyncResult.value property. + */ + getTypeAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -10665,20 +10855,12 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters. - * - * In addition to this signature, this method also has the following signatures: - * - * `prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `prependAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * - * `prependAsync(data: string): void;` - * * @param data - The string to be inserted at the beginning of the body. The string is limited to 1,000,000 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. @@ -10686,7 +10868,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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * @@ -10699,58 +10881,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 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. - */ - prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Adds the specified content to the beginning of the item body. - * - * The prependAsync method inserts the specified string at the beginning of the item body. - * After insertion, the cursor is returned to its original place, relative to the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, callback: (result: Office.AsyncResult) => void): void; - /** - * Adds the specified content to the beginning of the item body. - * - * The prependAsync method inserts the specified string at the beginning of the item body. - * After insertion, the cursor is returned to its original place, relative to the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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. - */ - prependAsync(data: string): void; + prependAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -10764,20 +10905,13 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * - * `setAsync(data: string): void;` - * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 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. @@ -10785,7 +10919,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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @@ -10799,64 +10933,18 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 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. - */ - setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Replaces the entire body with the specified text. - * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. - * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method - * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, callback: (result: Office.AsyncResult) => void): void; - /** - * Replaces the entire body with the specified text. - * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. - * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method - * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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. - */ - setAsync(data: string): void; + setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. @@ -10871,20 +10959,13 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
* - * In addition to this signature, this method also has the following signatures: - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * - * `setSelectedDataAsync(data: string): void;` - * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 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. @@ -10892,7 +10973,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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * @@ -10906,64 +10987,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 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. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Replaces the selection in the body with the specified text. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in - * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the - * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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.
+ * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 Office.AsyncResult. * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; - /** - * Replaces the selection in the body with the specified text. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in - * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the - * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. - * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (\) to "LPNoLP" - * (please see the Examples section for a sample). - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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. - */ - setSelectedDataAsync(data: string): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a contact stored on the server. Read mode only. @@ -10974,9 +11009,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface Contact { /** @@ -10988,7 +11024,7 @@ declare namespace Office { */ businessName: string; /** - * An array of strings containing the SMTP email addresses associated with the contact. Nullable, + * An array of strings containing the SMTP email addresses associated with the contact. Nullable. */ emailAddresses: string[]; /** @@ -11015,9 +11051,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface CustomProperties { /** @@ -11028,9 +11065,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ get(name: string): any; /** @@ -11045,9 +11083,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The name of the property to be set. * @param value - The value of the property to be set. @@ -11062,9 +11101,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ remove(name: string): void; /** @@ -11086,11 +11126,12 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ - saveAsync(callback?: (result: Office.AsyncResult) => void, asyncContext?: any): void; + saveAsync(callback?: (asyncResult: Office.AsyncResult) => void, asyncContext?: any): void; } /** * Provides diagnostic information to an Outlook add-in. @@ -11098,9 +11139,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Diagnostics { /** @@ -11111,9 +11153,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ hostName: string; /** @@ -11125,9 +11168,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ hostVersion: string; /** @@ -11150,9 +11194,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ OWAView: MailboxEnums.OWAView | "OneColumn" | "TwoColumns" | "ThreeColumns"; } @@ -11162,9 +11207,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface EmailAddressDetails { /** @@ -11192,9 +11238,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface EmailUser { /** @@ -11213,14 +11260,8 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta @@ -11233,24 +11274,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
* - * In addition to this signature, this method also has the following signatures: - * - * `addAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void;` - * * @param locationIdentifiers The locations to be added to the current list of locations. * @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. @@ -11259,7 +11287,7 @@ declare namespace Office { * * @beta */ - addAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResultStatus) => void): void; + addAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResultStatus) => void): void; /** * Adds to the set of locations associated with the appointment. * @@ -11267,18 +11295,9 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidFormatError - The format of the specified data object is not valid.
* * @param locationIdentifiers The locations to be added to the current list of locations. @@ -11287,7 +11306,7 @@ declare namespace Office { * * @beta */ - addAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void; + addAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResultStatus) => void): void; /** * Gets the set of locations associated with the appointment. * @@ -11295,20 +11314,10 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signatures: - * - * `getAsync(callback?: (result: Office.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, @@ -11316,7 +11325,7 @@ declare namespace Office { * * @beta */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the set of locations associated with the appointment. * @@ -11324,14 +11333,8 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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, @@ -11339,7 +11342,7 @@ declare namespace Office { * * @beta */ - getAsync(callback?: (result: Office.AsyncResult) => void): void; + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the set of locations associated with the appointment. * @@ -11349,20 +11352,10 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signatures: - * - * `removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void;` - * * @param locationIdentifiers The locations to be removed from the current list of locations. * @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. @@ -11371,7 +11364,7 @@ declare namespace Office { * * @beta */ - removeAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResultStatus) => void): void; + removeAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResultStatus) => void): void; /** * Removes the set of locations associated with the appointment. * @@ -11381,14 +11374,8 @@ declare namespace Office { * * @remarks * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param locationIdentifiers The locations to be removed from the current list of locations. @@ -11397,7 +11384,7 @@ declare namespace Office { * * @beta */ - removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (result: Office.AsyncResultStatus) => void): void; + removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResultStatus) => void): void; } /** * Represents a collection of entities found in an email message or appointment. Read mode only. @@ -11425,9 +11412,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface Entities { /** @@ -11466,9 +11454,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface From { /** @@ -11481,20 +11470,18 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * In addition to this signature, the method also has the following signature: - * - * `getAsync(callback?: (result: Office.AsyncResult) => void): void;` - * - * @param options - An object literal that contains one or more of the following properties. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. - * The `value` property of the result is message's from value, as an EmailAddressDetails object. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is the item's from value, as an EmailAddressDetails object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the from value of a message. * @@ -11506,14 +11493,16 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@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 Office.AsyncResult object. - * The `value` property of the result is message's from value, as an EmailAddressDetails object. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. + * The `value` property of the result is the item's from value, as an EmailAddressDetails object. */ - getAsync(callback?: (result: Office.AsyncResult) => void): void; + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -11525,9 +11514,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -11539,13 +11529,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, this method also has the following signature: - * - * `getAsync(names: string[], callback: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param names - The names of the internet headers to be returned. * @param options - Optional. An object literal that contains one or more of the following properties: @@ -11555,7 +11542,7 @@ declare namespace Office { * * @beta */ - getAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method returns a dictionary containing those internet headers and their values. * If the add-in requests an x-header that is not available, that x-header will not be returned in the results. @@ -11563,9 +11550,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param names - The names of the internet headers to be returned. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, @@ -11573,20 +11561,17 @@ declare namespace Office { * * @beta */ - getAsync(names: string[], callback?: (result: Office.AsyncResult) => void): void; + getAsync(names: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method removes the specified headers from the internet header collection. * * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
- * - * In addition to this signature, this method also has the following signature: - * - * `removeAsync(names: string[], callback: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param names - The names of the internet headers to be removed. * @param options - Optional. An object literal that contains one or more of the following properties: @@ -11596,16 +11581,17 @@ declare namespace Office { * * @beta */ - removeAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAsync(names: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method removes the specified headers from the internet header collection. * * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param names - The names of the internet headers to be removed. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, @@ -11613,7 +11599,7 @@ declare namespace Office { * * @beta */ - removeAsync(names: string[], callback?: (result: Office.AsyncResult) => void): void; + removeAsync(names: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the specified internet headers to the specified values. * @@ -11623,14 +11609,11 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(headers: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param headers - The names and corresponding values of the headers to be set. Should be a dictionary object with keys being the names of the * internet headers and values being the values of the internet headers. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -11640,7 +11623,7 @@ declare namespace Office { * * @beta */ - setAsync(headers: Object, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(headers: Object, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the specified internet headers to the specified values. * @@ -11650,9 +11633,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param headers - The names and corresponding values of the headers to be set. Should be a dictionary object with keys being the names of the * internet headers and values being the values of the internet headers. @@ -11661,13 +11645,19 @@ declare namespace Office { * * @beta */ - setAsync(headers: Object, callback?: (result: Office.AsyncResult) => void): void; + setAsync(headers: Object, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a location. Read only. * * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -11690,6 +11680,12 @@ declare namespace Office { * Represents the id of a location. * * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -11715,9 +11711,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Organizer { /** @@ -11726,16 +11723,32 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @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. + * @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 the appointment's organizer value, as an EmailAddressDetails object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the organizer value of an appointment as an {@link Office.EmailAddressDetails} in the asyncResult.value property. + * + * [Api set: Mailbox 1.7] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * The `value` property of the result is the appointment's organizer value, as an EmailAddressDetails object. + */ + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -11762,9 +11775,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ body: Body; /** @@ -11780,9 +11794,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ end: Time; /** @@ -11794,14 +11809,8 @@ declare namespace Office { * @remarks * * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @beta @@ -11816,9 +11825,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ itemType: MailboxEnums.ItemType; /** @@ -11829,9 +11839,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ location: Location; /** @@ -11841,9 +11852,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ notificationMessages: NotificationMessages; /** @@ -11855,9 +11867,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ optionalAttendees: Recipients; /** @@ -11869,9 +11882,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ organizer: Organizer; /** @@ -11889,9 +11903,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ recurrence: Recurrence; /** @@ -11903,9 +11918,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ requiredAttendees: Recipients; /** @@ -11926,9 +11942,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ seriesId: string; /** @@ -11944,9 +11961,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ start: Time; /** @@ -11960,9 +11978,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ subject: Subject; /** @@ -11975,30 +11994,24 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, the method also has the following signatures: - * - * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -12009,62 +12022,21 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addFileAttachmentAsync(uri: string, attachmentName: string): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -12075,41 +12047,68 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @param base64File - The base64 encoded content of an image or file to be added to an email or event. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. * * @beta */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds a file to a message or appointment as an attachment. + * + * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the asyncResult.value object. + * + * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * @param base64File - The base64 encoded content of an image or file to be added to an email or event. + * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * + * @beta + */ + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -12119,20 +12118,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -12140,7 +12141,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -12157,29 +12158,21 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, this method also has the following signatures: - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -12196,73 +12189,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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 Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -12278,9 +12217,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
*/ close(): void; /** @@ -12290,9 +12230,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @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. @@ -12302,7 +12243,26 @@ declare namespace Office { * * @beta */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the item's attachments as an array. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for + * the failure. + * + * @beta + */ + getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is activated by an actionable message. * @@ -12312,9 +12272,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -12326,7 +12287,30 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets initialization data passed when the add-in is activated by an actionable message. + * + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. + * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * + * @beta + */ + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -12343,9 +12327,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. @@ -12353,7 +12338,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 Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -12370,16 +12355,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -12395,16 +12381,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -12418,19 +12405,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * In addition to this signature, the method also has the following signatures: - * - * `removeAttachmentAsync(attachmentId: string): void;` - * - * `removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void;` - * - * `removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void;` + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -12438,53 +12417,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 Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - */ - removeAttachmentAsync(attachmentId: string): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void; + removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -12499,35 +12432,33 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -12535,26 +12466,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -12580,93 +12513,17 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `saveAsync(): void;` - * - * `saveAsync(options: Office.AsyncContextOptions): void;` - * - * `saveAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - */ - saveAsync(): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @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. - */ - saveAsync(options: Office.AsyncContextOptions): void; + saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -12691,15 +12548,15 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer - * - * 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 Office.AsyncResult. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ - saveAsync(callback: (result: Office.AsyncResult) => void): void; + saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -12711,20 +12568,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `setSelectedDataAsync(data: string): void;` - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -12739,7 +12588,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 Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -12751,68 +12600,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - */ - setSelectedDataAsync(data: string): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the - * default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -12830,9 +12629,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. @@ -12846,9 +12646,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ body: Body; /** @@ -12858,9 +12659,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ dateTimeCreated: Date; /** @@ -12870,9 +12672,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * **Note**: This member is not supported in Outlook for iOS or Outlook for Android. */ @@ -12890,9 +12693,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ end: Date; /** @@ -12906,14 +12710,8 @@ declare namespace Office { * @remarks * * - * - * - * - * - * - * - * - * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @beta @@ -12929,9 +12727,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. * @@ -12971,9 +12770,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ itemId: string; /** @@ -12985,9 +12785,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ itemType: MailboxEnums.ItemType; /** @@ -12999,9 +12800,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ location: string; /** @@ -13014,9 +12816,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ normalizedSubject: string; /** @@ -13026,9 +12829,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ notificationMessages: NotificationMessages; /** @@ -13041,9 +12845,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ optionalAttendees: EmailAddressDetails[]; /** @@ -13053,9 +12858,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ organizer: EmailAddressDetails; /** @@ -13073,9 +12879,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ recurrence: Recurrence; /** @@ -13088,9 +12895,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ requiredAttendees: EmailAddressDetails[]; /** @@ -13103,9 +12911,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ start: Date; /** @@ -13126,9 +12935,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ seriesId: string; /** @@ -13142,9 +12952,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ subject: string; @@ -13152,19 +12963,17 @@ declare namespace Office { * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13174,21 +12983,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; - + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13196,7 +13006,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.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. @@ -13214,15 +13024,17 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyAllForm(formData: string | ReplyFormData): void; + displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. * @@ -13240,15 +13052,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyForm(formData: string | ReplyFormData): void; + displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.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}. * @@ -13259,13 +13073,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @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. @@ -13277,7 +13088,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.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}. * @@ -13287,9 +13098,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. @@ -13299,7 +13111,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -13309,9 +13121,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ getEntities(): Entities; /** @@ -13329,9 +13142,10 @@ declare namespace Office { * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. * @@ -13339,7 +13153,7 @@ declare namespace Office { * * Value of entityType * Type of objects in returned array - * Required Permission Leve + * Required Permission Level * * * Address @@ -13391,9 +13205,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, @@ -13426,9 +13241,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ getRegExMatches(): any; /** @@ -13450,9 +13266,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -13466,9 +13283,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -13498,9 +13316,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
*/ getSelectedRegExMatches(): any; /** @@ -13518,34 +13337,33 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -13553,26 +13371,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -13582,9 +13402,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Item { /** @@ -13594,9 +13415,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ body: Body; /** @@ -13609,9 +13431,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ itemType: MailboxEnums.ItemType; /** @@ -13621,9 +13444,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ notificationMessages: NotificationMessages; @@ -13645,9 +13469,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ seriesId: string; @@ -13655,19 +13480,17 @@ declare namespace Office { * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13677,21 +13500,23 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -13699,7 +13524,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. @@ -13714,11 +13539,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment you want to get. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -13729,7 +13554,35 @@ declare namespace Office { * * @beta */ - getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + * + * @beta + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.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}. @@ -13741,13 +13594,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @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. @@ -13759,7 +13609,32 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + + /** + * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. + * + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. + * + * @beta + */ + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. @@ -13767,14 +13642,11 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 @@ -13783,7 +13655,7 @@ declare namespace Office { * * @beta */ - getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. @@ -13791,9 +13663,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. @@ -13801,7 +13674,7 @@ declare namespace Office { * * @beta */ - getSharedPropertiesAsync(callback: (result: Office.AsyncResult) => void): void; + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. @@ -13818,34 +13691,34 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; + /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -13853,27 +13726,29 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -13894,11 +13769,13 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ subject: Subject; + /** * Adds a file to a message or appointment as an attachment. * @@ -13909,32 +13786,26 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, the method also has the following signatures: - * - * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the * attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -13945,64 +13816,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addFileAttachmentAsync(uri: string, attachmentName: string): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the - * attachment list. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. @@ -14014,24 +13843,53 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @param base64File - The base64 encoded content of an image or file to be added to an email or event. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. * * @beta */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds a file to a message or appointment as an attachment. + * + * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the asyncResult.value object. + * + * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * @param base64File - The base64 encoded content of an image or file to be added to an email or event. + * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * + * @beta + */ + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. @@ -14049,30 +13907,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, this method also has the following signatures: - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -14089,74 +13939,20 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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 + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current item that is being composed @@ -14173,9 +13969,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ close(): void; /** @@ -14185,9 +13982,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @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. @@ -14197,7 +13995,26 @@ declare namespace Office { * * @beta */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the item's attachments as an array. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for + * the failure. + * + * @beta + */ + getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is activated by an actionable message. * @@ -14207,9 +14024,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -14223,40 +14041,39 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** - * Asynchronously returns selected data from the subject or body of a message. + * Gets initialization data passed when the add-in is activated by an actionable message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes - * from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * + * [Api set: Mailbox Preview] * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose + * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. + * + * @beta */ - getSelectedDataAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. + * To access the selected data from the callback method, call asyncResult.value.data. * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] @@ -14266,9 +14083,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. @@ -14277,7 +14095,34 @@ declare namespace Office { * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Asynchronously returns selected data from the subject or body of a message. + * + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * + * [Api set: Mailbox 1.2] + * + * @returns + * The selected data as a string with format determined by coercionType. + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + getSelectedDataAsync(coercionType: Office.CoercionType, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -14291,20 +14136,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `removeAttachmentAsync(attachmentId: string): void;` - * - * `removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void;` - * - * `removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param attachmentId - The identifier of the attachment to remove. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. @@ -14312,7 +14149,7 @@ declare namespace Office { * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -14326,64 +14163,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - */ - removeAttachmentAsync(attachmentId: string): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. @@ -14410,27 +14201,19 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `saveAsync(): void;` - * - * `saveAsync(options: Office.AsyncContextOptions): void;` - * - * `saveAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -14456,85 +14239,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose - * - * ErrorsInvalidAttachmentId - The attachment identifier does not exist. - * - */ - saveAsync(): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @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. - */ - saveAsync(options: Office.AsyncContextOptions): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
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 + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -14546,20 +14261,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `setSelectedDataAsync(data: string): void;` - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -14574,7 +14281,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 Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -14586,69 +14293,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - */ - setSelectedDataAsync(data: string): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is - * applied in Outlook. - * If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -14664,9 +14320,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. * For more information, see @@ -14685,9 +14342,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or * appointment item. @@ -14727,9 +14385,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ itemId: string; /** @@ -14742,9 +14401,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ normalizedSubject: string; /** @@ -14758,9 +14418,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ subject: string; /** @@ -14780,15 +14441,17 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyAllForm(formData: string | ReplyFormData): void; + displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. * @@ -14806,15 +14469,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read/td>
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyForm(formData: string | ReplyFormData): void; + displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.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}. * @@ -14825,13 +14490,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @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. @@ -14843,7 +14505,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.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}. * @@ -14854,9 +14516,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. @@ -14866,7 +14529,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -14876,9 +14539,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ getEntities(): Entities; /** @@ -14896,9 +14560,10 @@ declare namespace Office { * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * +
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the * following table. @@ -14907,7 +14572,7 @@ declare namespace Office { * * Value of entityType * Type of objects in returned array - * Required Permission Leve + * Required Permission Level * * * Address @@ -14959,9 +14624,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, @@ -14994,9 +14660,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ getRegExMatches(): any; /** @@ -15018,9 +14685,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -15034,9 +14702,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -15064,9 +14733,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ getSelectedRegExMatches(): any; } @@ -15092,9 +14762,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ conversationId: string; } @@ -15114,9 +14785,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ bcc: Recipients; /** @@ -15126,9 +14798,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ body: Body; /** @@ -15142,9 +14815,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ cc: Recipients; /** @@ -15161,9 +14835,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ conversationId: string; /** @@ -15178,9 +14853,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ from: From; /** @@ -15192,9 +14868,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @beta */ @@ -15209,9 +14886,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ itemType: MailboxEnums.ItemType; /** @@ -15221,9 +14899,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ notificationMessages: NotificationMessages; /** @@ -15244,9 +14923,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ seriesId: string; /** @@ -15260,9 +14940,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ subject: Subject; /** @@ -15275,9 +14956,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ to: Recipients; @@ -15291,32 +14973,26 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, the method also has the following signatures: - * - * `addFileAttachmentAsync(uri: string, attachmentName: string): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;` - * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the * attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -15327,63 +15003,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addFileAttachmentAsync(uri: string, attachmentName: string): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: Office.AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -15394,41 +15029,68 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @param base64File - The base64 encoded content of an image or file to be added to an email or event. * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * On success, the attachment identifier will be provided in the asyncResult.value property. * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. * * @beta */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds a file to a message or appointment as an attachment. + * + * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. This method returns the attachment identifier in the asyncResult.value object. + * + * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsAttachmentSizeExceeded - The attachment is larger than allowed.
FileTypeNotSupported - The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * @param base64File - The base64 encoded content of an image or file to be added to an email or event. + * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * + * @beta + */ + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -15438,20 +15100,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -15459,7 +15123,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -15476,30 +15140,22 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* - * In addition to this signature, this method also has the following signatures: - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` - * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -15516,74 +15172,20 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
* * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. - * You can use the options parameter to pass state information to the callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsNumberOfAttachmentsExceeded - The message or appointment has too many attachments.
- * - * @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 + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -15599,9 +15201,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
*/ close(): void; /** @@ -15611,9 +15214,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @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. @@ -15623,7 +15227,26 @@ declare namespace Office { * * @beta */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the item's attachments as an array. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for + * the failure. + * + * @beta + */ + getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is activated by an actionable message. * @@ -15634,9 +15257,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * @@ -15650,33 +15274,33 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** - * Asynchronously returns selected data from the subject or body of a message. + * Gets initialization data passed when the add-in is activated by an actionable message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. - * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. + * **Note**: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. + * + * [Api set: Mailbox Preview] * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose + * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. + * + * @beta */ - getSelectedDataAsync(coercionType: Office.CoercionType, callback: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * @@ -15693,9 +15317,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. @@ -15704,7 +15329,34 @@ declare namespace Office { * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getSelectedDataAsync(coercionType: Office.CoercionType, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Asynchronously returns selected data from the subject or body of a message. + * + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * + * [Api set: Mailbox 1.2] + * + * @returns + * The selected data as a string with format determined by coercionType. + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + getSelectedDataAsync(coercionType: Office.CoercionType, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -15720,16 +15372,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -15743,20 +15396,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `removeAttachmentAsync(attachmentId: string): void;` - * - * `removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void;` - * - * `removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param attachmentId - The identifier of the attachment to remove. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. @@ -15764,7 +15409,7 @@ declare namespace Office { * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * @@ -15778,81 +15423,33 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - */ - removeAttachmentAsync(attachmentId: string): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - removeAttachmentAsync(attachmentId: string, options: Office.AsyncContextOptions): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param attachmentId - The identifier of the attachment to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentId: string, callback: (result: Office.AsyncResult) => void): void; + removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -15860,26 +15457,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -15905,26 +15504,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `saveAsync(): void;` - * - * `saveAsync(options: Office.AsyncContextOptions): void;` - * - * `saveAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -15950,83 +15541,16 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose - * - * ErrorsInvalidAttachmentId - The attachment identifier does not exist. - * - */ - saveAsync(): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @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. - */ - saveAsync(options: Office.AsyncContextOptions): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook Web App or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Mac Outlook does not support saveAsync on a meeting in compose mode. Calling saveAsync on a meeting in Mac Outlook will return an error. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
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 + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - saveAsync(callback: (result: Office.AsyncResult) => void): void; + saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -16038,20 +15562,12 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* - * In addition to this signature, the method also has the following signatures: - * - * `setSelectedDataAsync(data: string): void;` - * - * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` - * - * `setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -16065,7 +15581,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 Office.AsyncResult. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * @@ -16077,68 +15593,18 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - */ - setSelectedDataAsync(data: string): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
- * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is - * applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - */ - setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
ErrorsInvalidAttachmentId - The attachment identifier does not exist.
* * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - setSelectedDataAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The message read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -16155,9 +15621,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. * For more information, see @@ -16172,9 +15639,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ body: Body; /** @@ -16188,9 +15656,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ cc: EmailAddressDetails[]; /** @@ -16207,9 +15676,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ conversationId: string; /** @@ -16219,9 +15689,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ dateTimeCreated: Date; /** @@ -16231,9 +15702,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * **Note**: This member is not supported in Outlook for iOS or Outlook for Android. */ @@ -16252,9 +15724,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ from: EmailAddressDetails; /** @@ -16266,9 +15739,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @beta */ @@ -16280,9 +15754,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ internetMessageId: string; /** @@ -16295,9 +15770,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* The itemClass property specifies the message class of the selected item. * The following are the default message classes for the message or appointment item. @@ -16338,9 +15814,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ itemId: string; /** @@ -16353,9 +15830,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ itemType: MailboxEnums.ItemType; /** @@ -16369,9 +15847,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ normalizedSubject: string; /** @@ -16381,9 +15860,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ notificationMessages: NotificationMessages; /** @@ -16403,9 +15883,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ recurrence: Recurrence; /** @@ -16426,9 +15907,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ seriesId: string; /** @@ -16443,9 +15925,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ sender: EmailAddressDetails; /** @@ -16459,9 +15942,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ subject: string; /** @@ -16475,9 +15959,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ to: EmailAddressDetails[]; @@ -16485,19 +15970,17 @@ declare namespace Office { * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -16507,21 +15990,22 @@ 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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: Office.AsyncResult) => void): void; - + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds an event handler for a supported event. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -16529,7 +16013,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 Office.AsyncResult object. */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (asyncResult: Office.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. @@ -16547,15 +16031,17 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyAllForm(formData: string | ReplyFormData): void; + displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. * @@ -16573,15 +16059,17 @@ declare namespace Office { * * @remarks * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
+ * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* - * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * OR - * An {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR an {@link Office.ReplyFormData} object that contains body or attachment data and a callback function. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. */ - displayReplyForm(formData: string | ReplyFormData): void; + displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.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}. @@ -16593,13 +16081,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
- * - * In addition to this signature, the method also has the following signature: - * - * `getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @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. @@ -16611,7 +16096,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.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}. @@ -16623,9 +16108,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. @@ -16635,7 +16121,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: Office.AsyncResult) => void): void; + getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -16645,9 +16131,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ getEntities(): Entities; /** @@ -16666,9 +16153,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the * following table. @@ -16677,7 +16165,7 @@ declare namespace Office { * * Value of entityType * Type of objects in returned array - * Required Permission Leve + * Required Permission Level * * * Address @@ -16729,9 +16217,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, @@ -16764,9 +16253,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ getRegExMatches(): any; /** @@ -16788,9 +16278,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -16804,9 +16295,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. */ @@ -16836,9 +16328,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
*/ getSelectedRegExMatches(): any; /** @@ -16856,33 +16349,32 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should revoke the handler. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -16890,26 +16382,28 @@ 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 Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the event handlers for a supported event type. * * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and - * `Office.EventType.RecurrenceChanged`. In Preview, `Office.EventType.AttachmentsChanged` is also supported. + * `Office.EventType.RecurrenceChanged`. + * In Preview, `Office.EventType.AttachmentsChanged` and `Office.EventType.EnhancedLocationsChanged` are also supported. * * [Api set: Mailbox 1.7] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType - The event that should revoke the handler. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - removeHandlerAsync(eventType: Office.EventType, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -16919,9 +16413,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface LocalClientTime { /** @@ -16963,9 +16458,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Location { /** @@ -16974,41 +16470,38 @@ declare namespace Office { * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. * The location of the appointment is provided as a string in the asyncResult.value property. * - * @param options - Optional. An object literal that contains one or more of the following properties. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `getAsync(callback: (result: Office.AsyncResult) => void): void;` - * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the location of an appointment. * * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. * The location of the appointment is provided as a string in the asyncResult.value property. * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -17024,59 +16517,13 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
- * - * In addition to this signature, the method also has the following signatures: - * - * `setAsync(location: string): void;` - * - * `setAsync(location: string, options: Office.AsyncContextOptions): void;` - * - * `setAsync(location: string, callback: (result: Office.AsyncResult) => void): void;` + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ - setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Sets the location of an appointment. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. - * Setting the location of an appointment overwrites the current location. - * - * @param location - The location of the appointment. The string is limited to 255 characters. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
- */ - setAsync(location: string): void; - /** - * Sets the location of an appointment. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. - * Setting the location of an appointment overwrites the current location. - * - * @param location - The location of the appointment. The string is limited to 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
- */ - setAsync(location: string, options: Office.AsyncContextOptions): void; + setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the location of an appointment. * @@ -17090,13 +16537,13 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters.
*/ - setAsync(location: string, callback: (result: Office.AsyncResult) => void): void; + setAsync(location: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides access to the Outlook Add-in object model for Microsoft Outlook and Microsoft Outlook on the web. @@ -17112,9 +16559,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface Mailbox { /** @@ -17140,9 +16588,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ diagnostics: Diagnostics; /** @@ -17157,9 +16606,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The ewsUrl value can be used by a remote service to make EWS calls to the user's mailbox. For example, you can create a remote service to {@link https://docs.microsoft.com/outlook/add-ins/get-attachments-of-an-outlook-item | get attachments from the selected item}. * @@ -17184,9 +16634,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The restUrl value can be used to make {@link https://docs.microsoft.com/outlook/rest/ | REST API} calls to the user's mailbox. */ @@ -17200,15 +16651,17 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently, the only supported event type is `Office.EventType.ItemChanged`. In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. * * [Api set: Mailbox 1.5] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should invoke the handler. * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. @@ -17217,7 +16670,29 @@ 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 Office.AsyncResult. */ - addHandlerAsync(eventType: Office.EventType, handler: (type: Office.EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (type: Office.EventType) => void, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds an event handler for a supported event. + * + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * + * [Api set: Mailbox 1.5] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @param eventType - The event that should invoke the handler. + * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + addHandlerAsync(eventType: Office.EventType, handler: (type: Office.EventType) => void, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * @@ -17230,9 +16705,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param itemId - An item ID formatted for the Outlook REST APIs. * @param restVersion - A value indicating the version of the Outlook REST API used to retrieve the item ID. @@ -17255,9 +16731,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param timeValue - A Date object. */ @@ -17271,9 +16748,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the * {@link https://docs.microsoft.com/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations | Outlook Mail API} or the {@link https://graph.microsoft.io/ | Microsoft Graph}. @@ -17293,9 +16771,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param input - The local time value to convert. * @returns A Date object with the time expressed in UTC. @@ -17322,9 +16801,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param itemId - The Exchange Web Services (EWS) identifier for an existing calendar appointment. */ @@ -17348,9 +16828,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param itemId - The Exchange Web Services (EWS) identifier for an existing message. */ @@ -17377,9 +16858,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param parameters - An AppointmentForm describing the new appointment. All properties are optional. */ @@ -17396,9 +16878,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param parameters - A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * @@ -17459,16 +16942,11 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, the method has the following signatures: - * - * `getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void): void;` - * - * `getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void;` - * * @param options - An object literal that contains one or more of the following properties. * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. @@ -17476,35 +16954,7 @@ declare namespace Office { * type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property. * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. */ - getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: Office.AsyncResult) => void): void; - /** - * Gets a string that contains a token used to get an attachment or item from an Exchange Server. - * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. - * The lifetime of the callback token is 5 minutes. - * - * You can pass the token and an attachment identifier or item identifier to a third-party system. - * The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or - * GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. - * - * Your app must have the ReadItem permission specified in its manifest to call the getCallbackTokenAsync method in read mode. - * - * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. - * Your app must have ReadWriteItem permissions to call the saveAsync method. - * - * [Api set: Mailbox 1.5] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. - * The token is provided as a string in the `asyncResult.value` property. - * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. - */ - getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void): void; + getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * @@ -17524,16 +16974,17 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. The token is provided as a string in the `asyncResult.value` property. * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext - Optional. Any state data that is passed to the asynchronous method. */ - getCallbackTokenAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + getCallbackTokenAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Gets a token identifying the user and the Office Add-in. * @@ -17543,9 +16994,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The getUserIdentityTokenAsync method returns a token that you can use to identify and * {@link https://docs.microsoft.com/outlook/add-ins/authentication | authenticate the add-in and user with a third-party system}. @@ -17556,7 +17008,7 @@ declare namespace Office { * If there was an error, then the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext - Optional. Any state data that is passed to the asynchronous method.| */ - getUserIdentityTokenAsync(callback: (result: Office.AsyncResult) => void, userContext?: any): void; + getUserIdentityTokenAsync(callback: (asyncResult: Office.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. * @@ -17599,9 +17051,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or 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 Office.AsyncResult. @@ -17609,26 +17062,48 @@ declare namespace Office { * 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: Office.AsyncResult) => void, userContext?: any): void; + makeEwsRequestAsync(data: any, callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. * - * Currently, the only supported event type is `Office.EventType.ItemChanged`. In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. * * [Api set: Mailbox 1.5] * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param eventType - The event that should revoke the handler. * @param options - Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - removeHandlerAsync(eventType: Office.EventType, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Removes the event handlers for a supported event type. + * + * Currently, the only supported event type is `Office.EventType.ItemChanged`. + * In Preview, `Office.EventType.OfficeThemeChanged` is also supported. + * + * [Api set: Mailbox 1.5] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @param eventType - The event that should revoke the handler. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + */ + removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -17644,9 +17119,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface MeetingSuggestion { /** @@ -17680,9 +17156,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface NotificationMessageDetails { /** @@ -17720,9 +17197,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface NotificationMessages { /** @@ -17742,58 +17220,12 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, the method also has the following signatures: - * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails): void;` - * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` - * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void;` - * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; - /** - * Adds a notification to an item. - * - * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. - * - * @param key - A developer-specified key used to reference this notification message. Developers can use it to modify this message later. - * It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the notification message to be added to the item. - * It contains a NotificationMessageDetails object. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- */ - addAsync(key: string, JSONmessage: NotificationMessageDetails): void; - /** - * Adds a notification to an item. - * - * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. - * - * @param key - A developer-specified key used to reference this notification message. Developers can use it to modify this message later. - * It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the notification message to be added to the item. - * It contains a NotificationMessageDetails object. - * @param 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. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a notification to an item. * @@ -17809,113 +17241,78 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ - addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns all keys and messages for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signature: - * - * `getAllAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns all keys and messages for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(callback: (result: Office.AsyncResult) => void): void; + getAllAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes a notification message for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signatures: - * - * `removeAsync(key: string): void;` - * - * `removeAsync(key: string, options: Office.AsyncContextOptions): void;` - * - * `removeAsync(key: string, callback: (result: Office.AsyncResult) => void): void;` - * * @param key - The key for the notification message to remove. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes a notification message for an item. * * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to remove. - */ - removeAsync(key: string): void; - /** - * Removes a notification message for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to remove. - * @param 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. - */ - removeAsync(key: string, options: Office.AsyncContextOptions): void; - /** - * Removes a notification message for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param key - The key for the notification message to remove. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. */ - removeAsync(key: string, callback: (result: Office.AsyncResult) => void): void; + removeAsync(key: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -17924,18 +17321,11 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* - * In addition to this signature, this method also has the following signatures: - * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void;` - * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` - * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void;` - * * @param key - The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. * It contains a NotificationMessageDetails object. @@ -17944,7 +17334,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 Office.AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -17953,45 +17343,10 @@ declare namespace Office { * [Api set: Mailbox 1.3] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. - * It contains a NotificationMessageDetails object. - */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void; - /** - * Replaces a notification message that has a given key with another message. - * - * If a notification message with the specified key doesn't exist, replaceAsync will add the notification. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * @param key - The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. - * It contains a NotificationMessageDetails object. - * @param 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. - */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void; - /** - * Replaces a notification message that has a given key with another message. - * - * If a notification message with the specified key doesn't exist, replaceAsync will add the notification. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param key - The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. @@ -17999,7 +17354,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 Office.AsyncResult. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: Office.AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a phone number identified in an item. Read mode only. @@ -18010,9 +17365,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface PhoneNumber { /** @@ -18032,9 +17388,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Recipients { /** @@ -18051,50 +17408,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* - * In addition to this signature, this method also has the following signatures: - * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;` - * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` - * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.AsyncResult) => void): void;` - * * @param recipients - The recipients to add to the recipients list. * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; - /** - * Adds a recipient list to the existing recipients for an appointment or message. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - EmailUser objects - * - * - EmailAddressDetails objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * @@ -18109,42 +17435,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void; - /** - * Adds a recipient list to the existing recipients for an appointment or message. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - {@link Office.EmailUser} objects - * - * - {@link Office.EmailAddressDetails} objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* * @param recipients - The recipients to add to the recipients list. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -18153,21 +17454,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -18176,15 +17474,16 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -18201,29 +17500,21 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;` - * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` - * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.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. + * @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 - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -18240,72 +17531,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
* * @param recipients - The recipients to add to the recipients list. - */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void; - /** - * Sets a recipient list for an appointment or message. - * - * The setAsync method overwrites the current recipient list. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - {@link Office.EmailUser} objects - * - * - {@link Office.EmailAddressDetails} objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void; - /** - * Sets a recipient list for an appointment or message. - * - * The setAsync method overwrites the current recipient list. - * - * The recipients parameter can be an array of one of the following: - * - * - Strings containing SMTP email addresses - * - * - {@link Office.EmailUser} objects - * - * - {@link Office.EmailAddressDetails} objects - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
- * - * @param recipients - The recipients to add to the recipients list. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: Office.AsyncResult) => void): void; - + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -18317,9 +17555,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * **States** * @@ -18369,9 +17608,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ recurrenceProperties: RecurrenceProperties; /** @@ -18381,9 +17621,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ recurrenceTimeZone: RecurrenceTimeZone; @@ -18394,9 +17635,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ recurrenceType: MailboxEnums.RecurrenceType; @@ -18409,9 +17651,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ seriesTime: SeriesTime; @@ -18424,13 +17667,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
- * - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @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. @@ -18438,7 +17678,7 @@ declare namespace Office { * asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is a Recurrence object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current recurrence object of an appointment series. @@ -18449,15 +17689,16 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is a Recurrence object. */ - getAsync(callback?: (result: Office.AsyncResult) => void): void; + getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -18468,15 +17709,11 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
- * - * In addition to this signature, this method also has the following signature: - * - * `setAsync(recurrencePattern: Recurrence, callback?: (result: Office.AsyncResult) => void): void;` + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
* * @param recurrencePattern - A recurrence object. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -18484,7 +17721,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 Office.AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -18495,17 +17732,17 @@ declare namespace Office { * * @remarks * - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before its start time.
* * @param recurrencePattern - A recurrence object. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, * asyncResult, which is an Office.AsyncResult object. */ - setAsync(recurrencePattern: Recurrence, callback?: (result: Office.AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -18515,9 +17752,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface RecurrenceProperties { /** @@ -18558,9 +17796,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface RecurrenceTimeZone { /** @@ -18615,9 +17854,9 @@ declare namespace Office { attachments?: ReplyFormAttachment[]; /** * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, - *asyncResult, which is an Office.AsyncResult object. + * asyncResult, which is an Office.AsyncResult object. */ - callback?: (result: Office.AsyncResult) => void; + callback?: (asyncResult: Office.AsyncResult) => void; } /** * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. @@ -18639,9 +17878,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface RoamingSettings { /** @@ -18650,9 +17890,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The case-sensitive name of the setting to retrieve. * @returns Type: String | Number | Boolean | Object | Array @@ -18664,9 +17905,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The case-sensitive name of the setting to remove. */ @@ -18681,14 +17923,15 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}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 Office.AsyncResult. */ - saveAsync(callback?: (result: Office.AsyncResult) => void): void; + saveAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets or creates the specified setting. * @@ -18702,9 +17945,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @param name - The case-sensitive name of the setting to set or create. * @param value - Specifies the value to be stored. @@ -18719,9 +17963,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface SeriesTime { /** @@ -18730,9 +17975,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getDuration(): number; @@ -18742,9 +17988,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getEndDate(): string; @@ -18756,9 +18003,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getEndTime(): string; @@ -18768,9 +18016,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getStartDate(): string; @@ -18781,9 +18030,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ getStartTime(): string; @@ -18793,9 +18043,10 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* * @param minutes - The length of the appointment in minutes. */ @@ -18807,16 +18058,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
- * - * In addition to this signature, this method also has the following signature: - * - * `setEndDate(date: string): void;` (Where date is the end date of the recurring appointment series represented in the - * {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* * @param year - The year value of the end date. * @param month - The month value of the end date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month. @@ -18829,11 +18075,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* * @param date - End date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD". */ @@ -18844,16 +18090,12 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* - * ErrorsInvalid date format - The date is not in an acceptable format. - * - * In addition to this signature, this method also has the following signature: - * - * `setStartDate(date: string): void;` (Where date is the start date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). - * * @param year - The year value of the start date. * @param month - The month value of the start date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month. * @param day - The day value of the start date. @@ -18866,11 +18108,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid date format - The date is not in an acceptable format.
* * @param date - Start date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD". */ @@ -18883,15 +18125,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
- * - * In addition to this signature, this method also has the following signature: - * - * `setStartTime(time: string): void;` (Where time is the start time of all instances represented by standard datetime string format: "THH:mm:ss:mmm"). + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
* * @param hours - The hour value of the start time. Valid range: 0-24. * @param minutes - The minute value of the start time. Valid range: 0-59. @@ -18905,11 +18143,11 @@ declare namespace Office { * [Api set: Mailbox 1.7] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalid time format - The time is not in an acceptable format.
* * @param time - Start time of all instances represented by standard datetime string format: "THH:mm:ss:mmm". */ @@ -18922,9 +18160,10 @@ declare namespace Office { * [Api set: Mailbox Preview] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * @beta */ @@ -18949,9 +18188,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Subject { /** @@ -18962,21 +18202,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is the subject of the item. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the subject of an appointment or message. * @@ -18985,14 +18222,15 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is the subject of the item. */ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -19002,27 +18240,19 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(subject: string): void;` - * - * `setAsync(subject: string, options: Office.AsyncContextOptions): void;` - * - * `setAsync(subject: string, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * @@ -19032,55 +18262,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
* * @param subject - The subject of the appointment or message. The string is limited to 255 characters. - */ - setAsync(data: string): void; - /** - * Sets the subject of an appointment or message. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. - * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
- * - * @param subject - The subject of the appointment or message. The string is limited to 255 characters. - * @param 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. - */ - setAsync(data: string, options: Office.AsyncContextOptions): void; - /** - * Sets the subject of an appointment or message. - * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. - * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.
- * - * @param subject - The subject of the appointment or message. The string is limited to 255 characters. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(data: string, callback: (result: Office.AsyncResult) => void): void; + setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -19092,9 +18284,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
*/ interface TaskSuggestion { /** @@ -19112,9 +18305,10 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
*/ interface Time { /** @@ -19126,20 +18320,17 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
* - * In addition to this signature, this method also has the following signature: - * - * `getAsync(callback: (result: Office.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 Office.AsyncResult. * The `value` property of the result is a Date object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the start or end time of an appointment. * @@ -19149,14 +18340,15 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@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 Office.AsyncResult. * The `value` property of the result is a Date object. */ - getAsync(callback: (result: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -19168,28 +18360,20 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* - * In addition to this signature, this method also has the following signatures: - * - * `setAsync(dateTime: Date): void;` - * - * `setAsync(dateTime: Date, options: Office.AsyncContextOptions): void;` - * - * `setAsync(dateTime: Date, callback: (result: Office.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. + * @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 - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type 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: Office.AsyncResult) => void): void; + setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * @@ -19201,60 +18385,18 @@ declare namespace Office { * [Api set: Mailbox 1.1] * * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
+ * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
* * @param dateTime - A date-time object in Coordinated Universal Time (UTC). - */ - setAsync(dateTime: Date): void; - /** - * Sets the start or end time of an appointment. - * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as - * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. - * - * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
- * - * @param dateTime - A date-time object in Coordinated Universal Time (UTC). - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - */ - setAsync(dateTime: Date, options: Office.AsyncContextOptions): void; - /** - * Sets the start or end time of an appointment. - * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as - * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. - * - * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.
- * - * @param dateTime - A date-time object in Coordinated Universal Time (UTC). - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of * type Office.AsyncResult. * If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, callback: (result: Office.AsyncResult) => void): void; + setAsync(dateTime: Date, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** @@ -19263,9 +18405,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ interface UserProfile { /** @@ -19277,9 +18420,10 @@ declare namespace Office { * * @remarks * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
* * The possible account types are listed in the following table. * @@ -19313,9 +18457,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ displayName: string; /** @@ -19324,9 +18469,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ emailAddress: string; /** @@ -19335,9 +18481,10 @@ declare namespace Office { * [Api set: Mailbox 1.0] * * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
+ * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
*/ timeZone: string; } @@ -21101,7 +20248,7 @@ declare namespace Excel { copy(positionType?: "None" | "Before" | "After" | "Beginning" | "End", relativeTo?: Excel.Worksheet): Excel.Worksheet; /** * - * Deletes the worksheet from the workbook. + * Deletes the worksheet from the workbook. Note that if the worksheet's visibility is set to "VeryHidden", the delete operation will fail with a GeneralException. * * [Api set: ExcelApi 1.1] */ diff --git a/types/ora/index.d.ts b/types/ora/index.d.ts index 08a1946c5d..13104b0b5c 100644 --- a/types/ora/index.d.ts +++ b/types/ora/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ora 3.0 +// Type definitions for ora 3.1 // Project: https://github.com/sindresorhus/ora // Definitions by: Basarat Ali Syed // Christian Rackerseder @@ -45,6 +45,16 @@ declare namespace ora { */ color: Color; + /** + * Change the spinner. + */ + spinner: SpinnerName | Spinner; + + /** + * Change the spinner indent. + */ + indent: number; + /** * Start the spinner. * @@ -149,6 +159,11 @@ declare namespace ora { * @default true */ hideCursor?: boolean; + /** + * Indent the spinner with the given number of spaces. + * @default 0 + */ + indent?: number; /** * Interval between each frame. * diff --git a/types/ora/ora-tests.ts b/types/ora/ora-tests.ts index 2c1b8ee82d..4e06c11248 100644 --- a/types/ora/ora-tests.ts +++ b/types/ora/ora-tests.ts @@ -9,6 +9,7 @@ ora({ spinner: { interval: 80, frames: ['-', '+', '-'] } }); ora({ color: 'cyan' }); ora({ color: 'foo' }); // $ExpectError ora({ hideCursor: true }); +ora({ indent: 1 }); ora({ interval: 80 }); ora({ stream: new PassThrough() }); ora({ isEnabled: true }); @@ -17,6 +18,8 @@ spinner.color = 'yellow'; spinner.text = 'Loading rainbows'; spinner.isSpinning; // $ExpectType boolean spinner.isSpinning = true; // $ExpectError +spinner.spinner = 'dots'; +spinner.indent = 5; spinner.start(); spinner.start('Test text'); diff --git a/types/p-event/index.d.ts b/types/p-event/index.d.ts index 0fde40d140..6f76b75748 100644 --- a/types/p-event/index.d.ts +++ b/types/p-event/index.d.ts @@ -1,17 +1,84 @@ -// Type definitions for p-event 1.3 +// Type definitions for p-event 2.3 // Project: https://github.com/sindresorhus/p-event#readme // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { PCancelable } from 'p-cancelable'; + export = pEvent; -declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, options: MultiArgsOptions): Promise>; -declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, filter: FilterFn): Promise; -declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, options?: pEvent.Options): Promise; +/** + * Promisify an event by waiting for it to be emitted. + * + * Returns a `Promise` that is fulfilled when emitter emits an event matching `event`, or rejects if emitter emits + * any of the events defined in the `rejectionEvents` option. + * + * **Note**: `event` is a string for a single event type, for example, `'data'`. To listen on multiple + * events, pass an array of strings, such as `['started', 'stopped']`. + * + * The returned promise has a `.cancel()` method, which when called, removes the event listeners and causes the promise to never be settled. + * + * @param emitter Event emitter object. Should have either a `.on()`/`.addListener()`/`.addEventListener()` and + * `.off()`/`.removeListener()`/`.removeEventListener()` method, like the [Node.js `EventEmitter`](https://nodejs.org/api/events.html) and + * [DOM events](https://developer.mozilla.org/en-US/docs/Web/Events). + * @param event Name of the event or events to listen to. If the same event is defined both here and in + * `rejectionEvents`, this one takes priority. + */ +declare function pEvent( + emitter: pEvent.Emitter, + event: string | symbol | Array, + options: pEvent.MultiArgsOptions +): PCancelable>; +declare function pEvent( + emitter: pEvent.Emitter, + event: string | symbol | Array, + filter: pEvent.FilterFn +): PCancelable; +declare function pEvent( + emitter: pEvent.Emitter, + event: string | symbol | Array, + options?: pEvent.Options +): PCancelable; declare namespace pEvent { - interface Emitter { + /** + * Wait for multiple event emissions. Returns an array. + */ + function multiple( + emitter: Emitter, + event: string | symbol | Array, + options: MultipleMultiArgsOptions + ): PCancelable>>; + function multiple( + emitter: Emitter, + event: string | symbol | Array, + options: MultipleOptions + ): PCancelable; + + /** + * Returns an [async iterator](http://2ality.com/2016/10/asynchronous-iteration.html) that lets you asynchronously + * iterate over events of `event` emitted from `emitter`. The iterator ends when `emitter` emits an event matching + * any of the events defined in `resolutionEvents`, or rejects if `emitter` emits any of the events defined in + * the `rejectionEvents` option. + */ + function iterator( + emitter: Emitter, + event: string | symbol | Array, + options: IteratorMultiArgsOptions + ): AsyncIterableIterator>; + function iterator( + emitter: Emitter, + event: string | symbol | Array, + filter: FilterFn + ): AsyncIterableIterator; + function iterator( + emitter: Emitter, + event: string | symbol | Array, + options?: IteratorOptions + ): AsyncIterableIterator; + + interface Emitter { on?: AddRmListenerFn; addListener?: AddRmListenerFn; addEventListener?: AddRmListenerFn; @@ -20,17 +87,119 @@ declare namespace pEvent { removeEventListener?: AddRmListenerFn; } + type FilterFn = (el: T) => boolean; + interface Options { - rejectionEvents?: string[]; + /** + * Events that will reject the promise. + * @default ['error'] + */ + rejectionEvents?: Array; + /** + * By default, the promisified function will only return the first argument from the event callback, + * which works fine for most APIs. This option can be useful for APIs that return multiple arguments + * in the callback. Turning this on will make it return an array of all arguments from the callback, + * instead of just the first argument. This also applies to rejections. + * + * @example + * const pEvent = require('p-event'); + * const emitter = require('./some-event-emitter'); + * + * (async () => { + * const [foo, bar] = await pEvent(emitter, 'finish', {multiArgs: true}); + * })(); + * + * @default false + */ multiArgs?: boolean; + /** + * Time in milliseconds before timing out. + * @default Infinity + */ timeout?: number; + /** + * Filter function for accepting an event. + * + * @example + * const pEvent = require('p-event'); + * const emitter = require('./some-event-emitter'); + * + * (async () => { + * const result = await pEvent(emitter, '🦄', value => value > 3); + * // Do something with first 🦄 event with a value greater than 3 + * })(); + */ filter?: FilterFn; } + + interface MultiArgsOptions extends Options { + multiArgs: true; + } + + interface MultipleOptions extends Options { + /** + * The number of times the event needs to be emitted before the promise resolves. + */ + count: number; + /** + * Whether to resolve the promise immediately. Emitting one of the `rejectionEvents` won't throw an error. + * + * **Note**: The returned array will be mutated when an event is emitted. + * + * @example + * const emitter = new EventEmitter(); + * + * const promise = pEvent.multiple(emitter, 'hello', { + * resolveImmediately: true, + * count: Infinity + * }); + * + * const result = await promise; + * console.log(result); + * //=> [] + * + * emitter.emit('hello', 'Jack'); + * console.log(result); + * //=> ['Jack'] + * + * emitter.emit('hello', 'Mark'); + * console.log(result); + * //=> ['Jack', 'Mark'] + * + * // Stops listening + * emitter.emit('error', new Error('😿')); + * + * emitter.emit('hello', 'John'); + * console.log(result); + * //=> ['Jack', 'Mark'] + */ + resolveImmediately?: boolean; + } + + interface MultipleMultiArgsOptions extends MultipleOptions { + multiArgs: true; + } + + interface IteratorOptions extends Options { + /** + * Maximum number of events for the iterator before it ends. When the limit is reached, the iterator will be + * marked as `done`. This option is useful to paginate events, for example, fetching 10 events per page. + * @default Infinity + */ + limit?: number; + /** + * Events that will end the iterator. + * @default [] + */ + resolutionEvents?: Array; + } + + interface IteratorMultiArgsOptions extends IteratorOptions { + multiArgs: true; + } } -type AddRmListenerFn = (event: string | symbol, listener: (arg1: T, ...args: TRest[]) => void) => void; -type FilterFn = (el: T) => boolean; - -interface MultiArgsOptions extends pEvent.Options { - multiArgs: true; -} +type AddRmListenerFn = ( + event: string | symbol, + listener: (arg1: T, ...args: TRest[]) => void +) => void; diff --git a/types/p-event/p-event-tests.ts b/types/p-event/p-event-tests.ts index 0295cdb34b..dbbe50eee7 100644 --- a/types/p-event/p-event-tests.ts +++ b/types/p-event/p-event-tests.ts @@ -1,51 +1,85 @@ /// import pEvent = require('p-event'); -import * as events from 'events'; +import { EventEmitter } from 'events'; import * as fs from 'fs'; -class MyEmitter extends events.EventEmitter { +class NodeEmitter extends EventEmitter { + on(event: 'finish', listener: (num: number, str: string) => void) { + return this; + } + addListener(event: 'finish', listener: (num: number, str: string) => void) { + return this; + } + addEventListener(event: 'finish', listener: (num: number, str: string) => void) { + return this; + } + off(event: 'finish', listener: (num: number, str: string) => void) { + return this; + } + removeListener(event: 'finish', listener: (num: number, str: string) => void) { + return this; + } + removeEventListener(event: 'finish', listener: (num: number, str: string) => void) { + return this; + } } -class MyDomEmitter implements EventTarget { - addEventListener(type: 'foo', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { - } +class DomEmitter implements EventTarget { + addEventListener( + type: 'foo', + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions + ): void {} dispatchEvent(event: Event): boolean { return false; } - removeEventListener(type: 'foo', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { - } + removeEventListener( + type: 'foo', + listener: EventListenerOrEventListenerObject, + options?: boolean | AddEventListenerOptions + ): void {} } -pEvent(new MyEmitter(), 'finish') - .then(result => { - console.log(result); - }) - .catch(error => { - console.error(error); - }); +pEvent(new NodeEmitter(), 'finish'); // $ExpectType PCancelable +pEvent(new NodeEmitter(), '🦄', value => value > 3); // $ExpectType PCancelable +pEvent(new DomEmitter(), 'finish'); // $ExpectType PCancelable +pEvent(document, 'DOMContentLoaded'); // $ExpectType PCancelable -pEvent(new MyEmitter(), 'finish').then(result => { - const str: string = result; -}); +pEvent(new NodeEmitter(), 'finish', { rejectionEvents: ['error'] }); // $ExpectType PCancelable +pEvent(new NodeEmitter(), 'finish', { timeout: 1 }); // $ExpectType PCancelable +pEvent(new NodeEmitter(), 'finish', { filter: value => value > 3 }); // $ExpectType PCancelable +pEvent(new NodeEmitter(), 'finish', { multiArgs: true }); // $ExpectType PCancelable<(string | number)[]> -pEvent(new MyDomEmitter(), 'finish').then(result => { - const e: Event | undefined = result; -}); +pEvent(new NodeEmitter(), 'finish').cancel(); -pEvent(document, 'DOMContentLoaded').then(() => { - console.log('😎'); +// $ExpectType PCancelable +pEvent.multiple(new NodeEmitter(), 'hello', { + count: Infinity, }); +// $ExpectType PCancelable +pEvent.multiple(new NodeEmitter(), 'hello', { + resolveImmediately: true, + count: Infinity, +}); +// $ExpectType PCancelable<(string | number)[][]> +pEvent.multiple(new NodeEmitter(), 'hello', { + count: Infinity, + multiArgs: true, +}); +// $ExpectError +pEvent.multiple(new NodeEmitter(), 'hello', {}); +// $ExpectError +pEvent.multiple(new NodeEmitter(), 'hello'); -pEvent(new MyEmitter(), 'finish', {multiArgs: true}).then(result => { - const strArr: string[] = result; -}); +pEvent.iterator(new NodeEmitter(), 'finish'); // $ExpectType AsyncIterableIterator +pEvent.iterator(new NodeEmitter(), '🦄', value => value > 3); // $ExpectType AsyncIterableIterator -pEvent(new MyEmitter(), '🦄', value => value > 3).then(result => { - const num: number = result; -}); +pEvent.iterator(new NodeEmitter(), 'finish', { limit: 1 }); // $ExpectType AsyncIterableIterator +pEvent.iterator(new NodeEmitter(), 'finish', { resolutionEvents: ['finish'] }); // $ExpectType AsyncIterableIterator +pEvent.iterator(new NodeEmitter(), 'finish', { multiArgs: true }); // $ExpectType AsyncIterableIterator<(string | number)[]> async function getOpenReadStream(file: string) { const stream = fs.createReadStream(file); @@ -53,9 +87,24 @@ async function getOpenReadStream(file: string) { return stream; } -getOpenReadStream('unicorn.txt') - .then(stream => { - console.log('Is readable:', stream.readable); - stream.pipe(process.stdout); - }) - .catch(console.error); +(async () => { + const stream = await getOpenReadStream('unicorn.txt'); + stream.pipe(process.stdout); +})().catch(console.error); + +(async () => { + try { + const result = await pEvent(new NodeEmitter(), 'finish'); + + if (result === 1) { + throw new Error('Emitter finished with an error'); + } + + // `emitter` emitted a `finish` event with an acceptable value + console.log(result); + } catch (error) { + // `emitter` emitted an `error` event or + // emitted a `finish` with 'unwanted result' + console.error(error); + } +})(); diff --git a/types/p-event/tsconfig.json b/types/p-event/tsconfig.json index 0e047aa84b..dfde34c0e1 100644 --- a/types/p-event/tsconfig.json +++ b/types/p-event/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", + "es2016", "dom" ], "noImplicitAny": true, @@ -21,4 +21,4 @@ "index.d.ts", "p-event-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/p-event/v1/index.d.ts b/types/p-event/v1/index.d.ts new file mode 100644 index 0000000000..0fde40d140 --- /dev/null +++ b/types/p-event/v1/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for p-event 1.3 +// Project: https://github.com/sindresorhus/p-event#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = pEvent; + +declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, options: MultiArgsOptions): Promise>; +declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, filter: FilterFn): Promise; +declare function pEvent(emitter: pEvent.Emitter, event: string | symbol, options?: pEvent.Options): Promise; + +declare namespace pEvent { + interface Emitter { + on?: AddRmListenerFn; + addListener?: AddRmListenerFn; + addEventListener?: AddRmListenerFn; + off?: AddRmListenerFn; + removeListener?: AddRmListenerFn; + removeEventListener?: AddRmListenerFn; + } + + interface Options { + rejectionEvents?: string[]; + multiArgs?: boolean; + timeout?: number; + filter?: FilterFn; + } +} + +type AddRmListenerFn = (event: string | symbol, listener: (arg1: T, ...args: TRest[]) => void) => void; +type FilterFn = (el: T) => boolean; + +interface MultiArgsOptions extends pEvent.Options { + multiArgs: true; +} diff --git a/types/p-event/v1/p-event-tests.ts b/types/p-event/v1/p-event-tests.ts new file mode 100644 index 0000000000..0295cdb34b --- /dev/null +++ b/types/p-event/v1/p-event-tests.ts @@ -0,0 +1,61 @@ +/// + +import pEvent = require('p-event'); +import * as events from 'events'; +import * as fs from 'fs'; + +class MyEmitter extends events.EventEmitter { +} + +class MyDomEmitter implements EventTarget { + addEventListener(type: 'foo', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { + } + + dispatchEvent(event: Event): boolean { + return false; + } + + removeEventListener(type: 'foo', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { + } +} + +pEvent(new MyEmitter(), 'finish') + .then(result => { + console.log(result); + }) + .catch(error => { + console.error(error); + }); + +pEvent(new MyEmitter(), 'finish').then(result => { + const str: string = result; +}); + +pEvent(new MyDomEmitter(), 'finish').then(result => { + const e: Event | undefined = result; +}); + +pEvent(document, 'DOMContentLoaded').then(() => { + console.log('😎'); +}); + +pEvent(new MyEmitter(), 'finish', {multiArgs: true}).then(result => { + const strArr: string[] = result; +}); + +pEvent(new MyEmitter(), '🦄', value => value > 3).then(result => { + const num: number = result; +}); + +async function getOpenReadStream(file: string) { + const stream = fs.createReadStream(file); + await pEvent(stream, 'open'); + return stream; +} + +getOpenReadStream('unicorn.txt') + .then(stream => { + console.log('Is readable:', stream.readable); + stream.pipe(process.stdout); + }) + .catch(console.error); diff --git a/types/i18next-browser-languagedetector/v0/tsconfig.json b/types/p-event/v1/tsconfig.json similarity index 68% rename from types/i18next-browser-languagedetector/v0/tsconfig.json rename to types/p-event/v1/tsconfig.json index 9873c74134..e8374c9b9e 100644 --- a/types/i18next-browser-languagedetector/v0/tsconfig.json +++ b/types/p-event/v1/tsconfig.json @@ -2,19 +2,20 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": false, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "i18next-browser-languagedetector": [ - "i18next-browser-languagedetector/v0" + "p-event": [ + "p-event/v1" ] }, "types": [], @@ -23,6 +24,6 @@ }, "files": [ "index.d.ts", - "i18next-browser-languagedetector-tests.ts" + "p-event-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/p-event/v1/tslint.json b/types/p-event/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/p-event/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/p-limit/index.d.ts b/types/p-limit/index.d.ts index af0306cdd9..de7b0a07d9 100644 --- a/types/p-limit/index.d.ts +++ b/types/p-limit/index.d.ts @@ -1,18 +1,43 @@ -// Type definitions for p-limit 2.0 +// Type definitions for p-limit 2.1 // Project: https://github.com/sindresorhus/p-limit#readme // Definitions by: BendingBender // Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 export = pLimit; -declare function limit(cb: (a: A, b: B, c: C, d: D, e: E, f: F, ...args: any[]) => PromiseLike | T, a: A, b: B, c: C, d: D, e: E, f: F, ...args: any[]): Promise; -declare function limit(cb: (a: A, b: B, c: C, d: D, e: E, f: F) => PromiseLike | T, a: A, b: B, c: C, d: D, e: E, f: F): Promise; -declare function limit(cb: (a: A, b: B, c: C, d: D, e: E) => PromiseLike | T, a: A, b: B, c: C, d: D, e: E): Promise; -declare function limit(cb: (a: A, b: B, c: C, d: D) => PromiseLike | T, a: A, b: B, c: C, d: D): Promise; -declare function limit(cb: (a: A, b: B, c: C) => PromiseLike | T, a: A, b: B, c: C): Promise; -declare function limit(cb: (a: A, b: B) => PromiseLike | T, a: A, b: B): Promise; -declare function limit(cb: (a: A) => PromiseLike | T, a: A): Promise; -declare function limit(cb: () => PromiseLike | T): Promise; +/** + * Run multiple promise-returning & async functions with limited concurrency. + * @param concurrency Concurrency limit. Minimum: `1`. + * @returns A `limit` function. + */ +declare function pLimit(concurrency: number): pLimit.Limit; -declare function pLimit(concurrency: number): typeof limit; +declare namespace pLimit { + interface Limit { + /** + * Returns the promise returned by calling `fn(...args)`. + * + * @param fn Promise-returning/async function. + * @param args Any arguments to pass through to `fn`. + * Support for passing arguments on to the `fn` is provided in order to be able to avoid + * creating unnecessary closures. You probably don't need this optimization unless you're + * pushing a lot of functions. + */ + ( + fn: (...args: TArgs) => PromiseLike | R, + ...args: TArgs + ): Promise; + + /** + * The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + * The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + } +} diff --git a/types/p-limit/p-limit-tests.ts b/types/p-limit/p-limit-tests.ts index 51dcb394fe..3f9fb51083 100644 --- a/types/p-limit/p-limit-tests.ts +++ b/types/p-limit/p-limit-tests.ts @@ -8,28 +8,16 @@ const input = [ limit(() => Promise.resolve(undefined)), ]; -Promise.all(input).then(result => { - const str: string | undefined = result[0]; +Promise.all(input); // $ExpectType Promise<(string | undefined)[]> + +limit((a: string) => '', 'test').then(v => { + v; // $ExpectType string +}); +limit((a: string, b: number) => Promise.resolve(''), 'test', 1).then(v => { + v; // $ExpectType string }); -let str: string; - -declare function a(a: string): string; -declare function b(a: string, b: number): string; -declare function c(a: string, b: number, c: boolean): string; -declare function d(a: string, b: number, c: boolean, d: symbol): string; -declare function e(a: string, b: number, c: boolean, d: symbol, e: 'yes' | 'no'): string; -declare function f(a: string, b: number, c: boolean, d: symbol, e: 'yes' | 'no', f: 1 | 2): string; -declare function g(a: string, b: number, c: boolean, d: symbol, e: 'yes' | 'no', f: 1 | 2, g: true): string; - -limit(a, 'test').then(v => { str = v; }); -limit(b, 'test', 1).then(v => { str = v; }); -limit(c, 'test', 1, false).then(v => { str = v; }); -limit(d, 'test', 1, false, Symbol('test')).then(v => { str = v; }); -limit(e, 'test', 1, false, Symbol('test'), 'no').then(v => { str = v; }); -limit(f, 'test', 1, false, Symbol('test'), 'no', 2).then(v => { str = v; }); -limit(g, 'test', 1, false, Symbol('test'), 'no', 2, true).then(v => { str = v; }); - -declare function add(...args: number[]): number; - -limit(add, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13).then(v => (v === 91)); +limit.activeCount; // $ExpectType number +limit.activeCount = 1; // $ExpectError +limit.pendingCount; // $ExpectType number +limit.pendingCount = 1; // $ExpectError diff --git a/types/p-map/index.d.ts b/types/p-map/index.d.ts deleted file mode 100644 index ccaf32e711..0000000000 --- a/types/p-map/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for p-map 1.1 -// Project: https://github.com/sindresorhus/p-map#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -export = pMap; - -declare function pMap(input: Iterable>, mapper: Mapper, options?: pMap.Options): Promise; - -type Input = Promise | PromiseLike | T; -type Mapper = (el: T, index: number) => Promise | R; - -declare namespace pMap { - interface Options { - concurrency?: number; - } -} diff --git a/types/p-map/p-map-tests.ts b/types/p-map/p-map-tests.ts deleted file mode 100644 index 48d4ed5e5a..0000000000 --- a/types/p-map/p-map-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import pMap = require('p-map'); - -const sites = [ - Promise.resolve('sindresorhus'), - true, - 1 -]; - -const mapper = (el: number | string | boolean) => Promise.resolve(1); - -let num: number; -pMap(sites, mapper, {concurrency: 2}).then(result => { - num = result[3]; -}); - -pMap(sites, mapper).then(result => { - num = result[3]; -}); diff --git a/types/p-throttle/index.d.ts b/types/p-throttle/index.d.ts deleted file mode 100644 index ae331e1ca2..0000000000 --- a/types/p-throttle/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for p-throttle 1.1 -// Project: https://github.com/sindresorhus/p-throttle#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = pThrottle; - -declare function pThrottle(fn: () => PromiseLike | R, limit: number, interval: number): (() => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1) => PromiseLike | R, limit: number, interval: number): ((arg1: T1) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2) => PromiseLike | R, limit: number, interval: number): ((arg1: T1, arg2: T2) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (...args: any[]) => PromiseLike | R, limit: number, interval: number): ((...args: any[]) => Promise) & { abort(): void; }; - -declare namespace pThrottle { - class AbortError extends Error { - readonly name: 'AbortError'; - - constructor(); - } -} diff --git a/types/p-throttle/p-throttle-tests.ts b/types/p-throttle/p-throttle-tests.ts deleted file mode 100644 index 713d445e6b..0000000000 --- a/types/p-throttle/p-throttle-tests.ts +++ /dev/null @@ -1,47 +0,0 @@ -import pThrottle = require('p-throttle'); - -const now = Date.now(); - -const throttled = pThrottle((i: number) => { - const secDiff = ((Date.now() - now) / 1000).toFixed(); - return Promise.resolve(`${i}: ${secDiff}s`); -}, 2, 1000); - -for (let i = 1; i <= 6; i++) { - throttled(i).then(res => { - const str: string = res; - }); -} - -throttled.abort(); - -pThrottle(() => true, 2, 3).abort(); -pThrottle(() => true, 2, 3)(); -pThrottle((n: number, s: string) => true, 2, 3).abort(); -pThrottle((n: number, s: string) => true, 2, 3)(1, 's'); -pThrottle((n: number, s: string, b: boolean) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean) => true, 2, 3)(1, 's', true); -pThrottle((n: number, s: string, b: boolean, n2: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number) => true, 2, 3)(1, 's', true, 1); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string) => true, 2, 3)(1, 's', true, 1, 's'); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean) => true, 2, 3)(1, 's', true, 1, 's', false); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2, 3); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2, 3, 4); -pThrottle( - (n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number, s3: string) => true, - 2, - 3).abort(); -pThrottle( - (n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number, s3: string) => true, - 2, - 3)(1, 's', true, 1, 's', false, 1, 2, 3, 4, 'as'); - -throw new pThrottle.AbortError(); diff --git a/types/parcel-bundler/index.d.ts b/types/parcel-bundler/index.d.ts index c661d105cd..230d928db1 100644 --- a/types/parcel-bundler/index.d.ts +++ b/types/parcel-bundler/index.d.ts @@ -2,7 +2,9 @@ // Project: https://github.com/parcel-bundler/parcel#readme // Definitions by: pinage404 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 + +import * as express from "express-serve-static-core"; declare namespace ParcelBundler { interface ParcelOptions { @@ -173,6 +175,8 @@ declare class ParcelBundler { addPackager(type: string, packager: string): void; bundle(): Promise; + + middleware(): (req: express.Request, res: express.Response, next: express.NextFunction) => any; } export = ParcelBundler; diff --git a/types/parcel-bundler/parcel-bundler-tests.ts b/types/parcel-bundler/parcel-bundler-tests.ts index 5833b8527b..0623056c89 100644 --- a/types/parcel-bundler/parcel-bundler-tests.ts +++ b/types/parcel-bundler/parcel-bundler-tests.ts @@ -10,4 +10,6 @@ bundler.addAssetType('md', 'markdown-asset'); bundler.addPackager('md', 'markdown-packager'); +bundler.middleware(); + bundler.bundle().then(bundle => bundle.name); diff --git a/types/parse-unit/index.d.ts b/types/parse-unit/index.d.ts index 238f3cfc06..7b37d0e64b 100644 --- a/types/parse-unit/index.d.ts +++ b/types/parse-unit/index.d.ts @@ -3,5 +3,5 @@ // Definitions by: Jack Works // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function parse(value: string): [number, string]; +declare function parse(value: string | number): [number, string]; export = parse; diff --git a/types/parse-unit/parse-unit-tests.ts b/types/parse-unit/parse-unit-tests.ts index dd5dcb7e9f..5cd4b180b8 100644 --- a/types/parse-unit/parse-unit-tests.ts +++ b/types/parse-unit/parse-unit-tests.ts @@ -2,3 +2,7 @@ import parse = require('parse-unit'); const [number, length] = parse('10px'); number === 50; length === 'px'; + +parse(10).length === 2; +parse(10)[0] === 10; +parse(10)[1] === ''; diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index bf89204b04..b87a9f5f56 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -7,6 +7,7 @@ // Wes Grimes // Otherwise SAS // Andrew Goldis +// Alexandre Hétu Rivard // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -490,7 +491,7 @@ declare namespace Parse { /** * Represents a LiveQuery Subscription. - * + * * @see https://docs.parseplatform.org/js/guide/#live-queries * @see NodeJS.EventEmitter * @@ -556,7 +557,7 @@ subscription.on('close', () => {}); class LiveQuerySubscription extends NodeJS.EventEmitter { /** * Creates an instance of LiveQuerySubscription. - * + * * @param {string} id * @param {string} query * @param {string} [sessionToken] @@ -692,12 +693,7 @@ subscription.on('close', () => {}); interface JobRequest { params: any; - } - - interface JobStatus { - error?: (response: any) => void; - message?: (response: any) => void; - success?: (response: any) => void; + message: (response: any) => void; } interface FunctionRequest { @@ -707,12 +703,6 @@ subscription.on('close', () => {}); user?: User; } - interface FunctionResponse { - success: (response: any) => void; - error (code: number, response: any): void; - error (response: any): void; - } - interface Cookie { name?: string; options?: CookieOptions; @@ -734,11 +724,7 @@ subscription.on('close', () => {}); interface AfterSaveRequest extends TriggerRequest { } interface AfterDeleteRequest extends TriggerRequest { } interface BeforeDeleteRequest extends TriggerRequest { } - interface BeforeDeleteResponse extends FunctionResponse { } interface BeforeSaveRequest extends TriggerRequest { } - interface BeforeSaveResponse extends FunctionResponse { - success: () => void; - } // Read preference describes how MongoDB driver route read operations to the members of a replica set. enum ReadPreferenceOption { @@ -760,19 +746,16 @@ subscription.on('close', () => {}); objects: Object[] } - interface AfterFindResponse extends FunctionResponse { - success: (objects: Object[]) => void; - } - - function afterDelete(arg1: any, func?: (request: AfterDeleteRequest) => void): void; - function afterSave(arg1: any, func?: (request: AfterSaveRequest) => void): void; - function beforeDelete(arg1: any, func?: (request: BeforeDeleteRequest, response: BeforeDeleteResponse) => void): void; - function beforeSave(arg1: any, func?: (request: BeforeSaveRequest, response: BeforeSaveResponse) => void): void; - function beforeFind(arg1: any, func?: (request: BeforeFindRequest) => void): void; - function afterFind(arg1: any, func?: (request: AfterFindRequest, response: AfterFindResponse) => void): void; - function define(name: string, func?: (request: FunctionRequest, response: FunctionResponse) => void): void; + function afterDelete(arg1: any, func?: (request: AfterDeleteRequest) => Promise | void): void; + function afterSave(arg1: any, func?: (request: AfterSaveRequest) => Promise | void): void; + function beforeDelete(arg1: any, func?: (request: BeforeDeleteRequest) => Promise | void): void; + function beforeSave(arg1: any, func?: (request: BeforeSaveRequest) => Promise | void): void; + function beforeFind(arg1: any, func?: (request: BeforeFindRequest) => Promise | void): void; + function beforeFind(arg1: any, func?: (request: BeforeFindRequest) => Promise | Query): void; + function afterFind(arg1: any, func?: (request: AfterFindRequest) => Promise | any): void; + function define(name: string, func?: (request: FunctionRequest) => Promise | any): void; function httpRequest(options: HTTPOptions): Promise; - function job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse; + function job(name: string, func?: (request: JobRequest) => Promise | void): HttpResponse; function run(name: string, data?: any, options?: RunOptions): Promise; function useMasterKey(): void; diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 8a2064e968..cb80764cd4 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -126,7 +126,7 @@ function test_query() { // Find objects with distinct key query.distinct('name'); - const testQuery = Parse.Query.or(query, query); + const testQuery = Parse.Query.or(query, query); } async function test_query_promise() { @@ -348,30 +348,30 @@ function test_cloud_functions() { // result }); - Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest, - response: Parse.Cloud.BeforeDeleteResponse) => { + Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest) => { + // result + }); + + Parse.Cloud.beforeDelete('MyCustomClass', async (request: Parse.Cloud.BeforeDeleteRequest) => { // result }); const CUSTOM_ERROR_INVALID_CONDITION = 1001 const CUSTOM_ERROR_IMMUTABLE_FIELD = 1002 - Parse.Cloud.beforeSave('MyCustomClass', (request: Parse.Cloud.BeforeSaveRequest, - response: Parse.Cloud.BeforeSaveResponse) => { - + Parse.Cloud.beforeSave('MyCustomClass', async (request: Parse.Cloud.BeforeSaveRequest) => { if (request.object.isNew()) { - if (!request.object.has('immutable')) return response.error('Field immutable is required') + if (!request.object.has('immutable')) throw new Error('Field immutable is required') } else { const original = request.original; if (original == null) { // When the object is not new, request.original must be defined - return response.error(CUSTOM_ERROR_INVALID_CONDITION, 'Original must me defined for an existing object') + throw new Parse.Error(CUSTOM_ERROR_INVALID_CONDITION, 'Original must me defined for an existing object') } if (original.get('immutable') !== request.object.get('immutable')) { - return response.error(CUSTOM_ERROR_IMMUTABLE_FIELD, 'This field cannot be changed') + throw new Parse.Error(CUSTOM_ERROR_IMMUTABLE_FIELD, 'This field cannot be changed') } } - response.success() }); Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { @@ -388,6 +388,30 @@ function test_cloud_functions() { request.readPreference = Parse.Cloud.ReadPreferenceOption.SecondaryPreferred request.readPreference = Parse.Cloud.ReadPreferenceOption.Nearest }); + + Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { + let query = request.query; // the Parse.Query + + return new Parse.Query("QueryMe!"); + }); + + Parse.Cloud.beforeFind('MyCustomClass', async (request: Parse.Cloud.BeforeFindRequest) => { + let query = request.query; // the Parse.Query + + return new Parse.Query("QueryMe, IN THE FUTURE!"); + }); + + Parse.Cloud.afterFind('MyCustomClass', async (request: Parse.Cloud.AfterFindRequest) => { + return new Parse.Object('MyCustomClass'); + }); + + Parse.Cloud.define('AFunc', (request: Parse.Cloud.FunctionRequest) => { + return 'Some result'; + }); + + Parse.Cloud.job('AJob', (request: Parse.Cloud.JobRequest) => { + request.message('Message to associate with this job run'); + }); } class PlaceObject extends Parse.Object { } diff --git a/types/petit-dom/index.d.ts b/types/petit-dom/index.d.ts index 52e507f980..7f850bb1dd 100644 --- a/types/petit-dom/index.d.ts +++ b/types/petit-dom/index.d.ts @@ -98,6 +98,7 @@ export namespace PetitDom { }; interface IntrinsicProps { + content?: Content | ReadonlyArray; key?: Key; } diff --git a/types/pg-copy-streams/index.d.ts b/types/pg-copy-streams/index.d.ts new file mode 100644 index 0000000000..4f468d5639 --- /dev/null +++ b/types/pg-copy-streams/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for pg-copy-streams 1.2 +// Project: https://github.com/brianc/node-pg-copy-streams +// Definitions by: Brian Crowell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Submittable, Connection } from "pg"; +import { Transform, TransformOptions } from "stream"; + +export function from(txt: string, options?: TransformOptions): CopyStreamQuery; +export function to(txt: string, options?: TransformOptions): CopyToStreamQuery; + +export class CopyStreamQuery extends Transform implements Submittable { + submit(connection: Connection): void; +} + +export class CopyToStreamQuery extends Transform implements Submittable { + submit(connection: Connection): void; +} diff --git a/types/pg-copy-streams/pg-copy-streams-tests.ts b/types/pg-copy-streams/pg-copy-streams-tests.ts new file mode 100644 index 0000000000..41d960ab4e --- /dev/null +++ b/types/pg-copy-streams/pg-copy-streams-tests.ts @@ -0,0 +1,19 @@ +import { Client } from "pg"; +import { from, to } from "pg-copy-streams"; + +const client = new Client('fake-config-string'); + +const copyStream = client.query(from('copy data from stdin;')); + +copyStream.write('', err => { + if (err) { + console.error(err); + return; + } + + copyStream.end(); +}); + +const readStream = client.query(to('copy data to stdout;')); + +readStream.pipe(process.stdout); diff --git a/types/detect-browser/tsconfig.json b/types/pg-copy-streams/tsconfig.json similarity index 92% rename from types/detect-browser/tsconfig.json rename to types/pg-copy-streams/tsconfig.json index b1319407fc..6b8989eb58 100644 --- a/types/detect-browser/tsconfig.json +++ b/types/pg-copy-streams/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "detect-browser-tests.ts" + "pg-copy-streams-tests.ts" ] } \ No newline at end of file diff --git a/types/pg-copy-streams/tslint.json b/types/pg-copy-streams/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pg-copy-streams/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pikaday/index.d.ts b/types/pikaday/index.d.ts index fad074ae33..3061cd67e7 100644 --- a/types/pikaday/index.d.ts +++ b/types/pikaday/index.d.ts @@ -36,7 +36,7 @@ declare class Pikaday { * Returns a JavaScript Date object for the selected day, or null if * no date is selected. */ - getDate(): Date; + getDate(): Date | null; /** * Set the current selection. This will be restricted within the bounds @@ -44,13 +44,13 @@ declare class Pikaday { * can optionally be passed as the second parameter to prevent triggering * of the onSelect callback, allowing the date to be set silently. */ - setDate(date: string | Date, preventOnSelect?: boolean): void; + setDate(date: string | Date | null, preventOnSelect?: boolean): void; /** * Returns a Moment.js object for the selected date (Moment must be * loaded before Pikaday). */ - getMoment(): moment.Moment; + getMoment(): moment.Moment | null; /** * Set the current selection with a Moment.js object (see setDate). @@ -101,13 +101,13 @@ declare class Pikaday { * Update the range start date. For using two Pikaday instances to * select a date range. */ - setStartRange(date: Date): void; + setStartRange(date: Date | null): void; /** * Update the range end date. For using two Pikaday instances to select * a date range. */ - setEndRange(date: Date): void; + setEndRange(date: Date | null): void; /** * Update the HTML. @@ -138,6 +138,11 @@ declare class Pikaday { * Hide the picker and remove all event listeners - no going back! */ destroy(): void; + + /** + * Clear and reset the date + */ + clear(): void; } // merge the Pikaday class declaration with a module @@ -154,7 +159,7 @@ declare namespace Pikaday { /** * Bind the datepicker to a form field. */ - field?: HTMLElement; + field?: HTMLElement | null; /** * The default output format for toString() and field value. @@ -166,7 +171,7 @@ declare namespace Pikaday { * Use a different element to trigger opening the datepicker. * Default: field element. */ - trigger?: HTMLElement; + trigger?: HTMLElement | null; /** * Automatically show/hide the datepicker on field focus. @@ -196,7 +201,7 @@ declare namespace Pikaday { * DOM node to render calendar into, see container example. * Default: undefined. */ - container?: HTMLElement; + container?: HTMLElement | null; /** * The initial date to view when first opened. @@ -325,12 +330,12 @@ declare namespace Pikaday { * Function which will be used for parsing input string and getting a date object from it. * This function will take precedence over moment. */ - parse?(date: string, format: string): Date; + parse?(date: string, format: string): Date | null; /** * Callback function for when a date is selected. */ - onSelect?(date: Date): void; + onSelect?(this: Pikaday, date: Date): void; /** * Callback function for when the picker becomes visible. diff --git a/types/pikaday/pikaday-tests.ts b/types/pikaday/pikaday-tests.ts index 7a532efb6f..83790b70ec 100644 --- a/types/pikaday/pikaday-tests.ts +++ b/types/pikaday/pikaday-tests.ts @@ -14,15 +14,15 @@ new Pikaday({field: $('#datepicker')[0]}); console.log(date.toISOString()); } }); - field.parentNode.insertBefore(picker.el, field.nextSibling); + field.parentNode!.insertBefore(picker.el, field.nextSibling); })(); (() => { const picker = new Pikaday({ field: document.getElementById('datepicker'), format: 'D MMM YYYY', - onSelect: () => { - console.log(this.getMoment().format('Do MMMM YYYY')); + onSelect() { + console.log(this.getMoment()!.format('Do MMMM YYYY')); } }); @@ -31,6 +31,8 @@ new Pikaday({field: $('#datepicker')[0]}); picker.getDate(); picker.setDate('2015-01-01'); picker.setDate('2015-01-01', true); + picker.setDate(null); + picker.setDate(null, true); picker.getMoment(); picker.setMoment(moment('14th February 2014', 'DDo MMMM YYYY')); picker.setMoment(moment('14th February 2014', 'DDo MMMM YYYY'), true); @@ -45,11 +47,14 @@ new Pikaday({field: $('#datepicker')[0]}); picker.setMinDate(null); picker.setMaxDate(null); picker.setStartRange(new Date()); + picker.setStartRange(null); picker.setEndRange(new Date()); + picker.setEndRange(null); picker.isVisible(); picker.show(); picker.adjustPosition(); picker.hide(); + picker.clear(); picker.destroy(); })(); @@ -111,3 +116,7 @@ new Pikaday({field: $('#datepicker')[0]}); toString: (date, format) => '2017-08-23' }); })(); + +new Pikaday({ + parse: (date) => null +}); diff --git a/types/pikaday/tsconfig.json b/types/pikaday/tsconfig.json index 3c936ab905..0c18391e53 100644 --- a/types/pikaday/tsconfig.json +++ b/types/pikaday/tsconfig.json @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +21,4 @@ "index.d.ts", "pikaday-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/pkgcloud/README.md b/types/pkgcloud/README.md new file mode 100644 index 0000000000..20815adfb4 --- /dev/null +++ b/types/pkgcloud/README.md @@ -0,0 +1,7 @@ +This file exists for reminding contributors that this definition is **WIP**. + +### Note + +pkgcloud has a large number of client types and providers. Only some clients and providers have types defined. + +You are welcome to contribute definitions for other clients and providers and add provider specific properties. diff --git a/types/pkgcloud/index.d.ts b/types/pkgcloud/index.d.ts new file mode 100644 index 0000000000..7a0a55a773 --- /dev/null +++ b/types/pkgcloud/index.d.ts @@ -0,0 +1,131 @@ +// Type definitions for pkgcloud 1.7 +// Project: https://github.com/pkgcloud/pkgcloud#readme +// Definitions by: Daniel Friesen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +export const version: string; + +export interface ClientError extends Error { + provider?: Providers; + method?: string; + failCode?: string; + statusCode?: number; + href?: string; + headers?: { [headerName: string]: string }; + result?: any; +} + +export type Providers = + | 'amazon' + | 'azure' + | 'digitalocean' + | 'google' + | 'hp' + | 'iriscouch' + | 'joyent' + | 'mongohq' + | 'mongolab' + | 'oneandone' + | 'openstack' + | 'rackspace' + | 'redistogo' + | 'telefonic'; + +export interface BaseProviderOptions { + provider: Providers; +} + +export interface AmazonProviderOptions { + provider: 'amazon'; + keyId: string; + key: string; + region?: string; +} + +export interface AzureProviderOptions { + provider: 'azure'; + storageAccount: string; + storageAccessKey: string; + location?: string; +} + +export type ProviderOptions = BaseProviderOptions & Partial< + | AmazonProviderOptions + | AzureProviderOptions +>; + +/** + * Storage + */ + +export namespace storage { + interface StorageUploadOptions { + container: string; + remote: string; + } + + interface StorageDownloadOptions { + container: string; + remote: string; + } + + interface Client { + provider: string; + config: ProviderOptions; + protocol: string; + + getContainers( + callback: (err: ClientError, containers: Container[]) => any, + ): void; + createContainer( + options: any, + callback: (err: ClientError, container: Container) => any, + ): void; + destroyContainer( + containerName: string, + callback: (err: ClientError) => any, + ): void; + getContainer( + containerName: string, + callback: (err: ClientError, container: Container) => any, + ): void; + upload(options: StorageUploadOptions): NodeJS.WriteStream; + download(options: StorageDownloadOptions): NodeJS.ReadStream; + getFiles( + containerName: string, + callback: (err: ClientError, files: File[]) => any, + ): void; + getFile( + containerName: string, + file: string, + callback: (err: ClientError, file: File) => any, + ): void; + removeFile( + containerName: string, + file: string, + callback: (err: ClientError) => any, + ): void; + // Logs + on( + eventName: string, + callback: (message: string, object?: any) => any, + ): void; + } + + interface Container { + // files: ? + client: Client; + } + + interface File { + container: string; + name: string; + size: number; + client: Client; + } + + function createClient(options: ProviderOptions): Client; +} diff --git a/types/pkgcloud/pkgcloud-tests.ts b/types/pkgcloud/pkgcloud-tests.ts new file mode 100644 index 0000000000..62846b6b55 --- /dev/null +++ b/types/pkgcloud/pkgcloud-tests.ts @@ -0,0 +1,64 @@ +import { createReadStream, createWriteStream } from "fs"; +import * as pkgcloud from "pkgcloud"; + +/** + * Storage + */ + +// Amazon +pkgcloud.storage.createClient({ + provider: 'amazon', + keyId: 'ABDEFGHI', + key: 'AABDEF==', +}); + +// Azure +pkgcloud.storage.createClient({ + provider: 'azure', + storageAccount: 'abcdefg', + storageAccessKey: 'AABDEF==', +}); + +// Upload a File +{ + const client = pkgcloud.storage.createClient({ + provider: 'amazon' + }); + + const readStream = createReadStream('a-file.txt'); + const writeStream = client.upload({ + container: 'a-container', + remote: 'remote-file-name.txt' + }); + + writeStream.on('error', (err: pkgcloud.ClientError) => {}); + writeStream.on('success', (file: pkgcloud.storage.File) => {}); + readStream.pipe(writeStream); +} + +// Download a File +{ + const client = pkgcloud.storage.createClient({ + provider: 'amazon' + }); + + const readStream = client.download({ + container: 'a-container', + remote: 'remote-file-name.txt' + }); + readStream.pipe(createWriteStream('a-file.txt')); +} + +// Logs +{ + const client = pkgcloud.storage.createClient({ + provider: 'amazon' + }); + + client.on('log::*', (message, object) => { + console.log(message); + if (object) { + console.dir(object); + } + }); +} diff --git a/types/pkgcloud/tsconfig.json b/types/pkgcloud/tsconfig.json new file mode 100644 index 0000000000..f36ed5e952 --- /dev/null +++ b/types/pkgcloud/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pkgcloud-tests.ts" + ] +} diff --git a/types/pkgcloud/tslint.json b/types/pkgcloud/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pkgcloud/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index af90a6f6a0..8e5622bdef 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.43 +// Type definitions for plotly.js 1.44 // Project: https://plot.ly/javascript/, https://github.com/plotly/plotly.js // Definitions by: Chris Gervang // Martin Duparc @@ -10,6 +10,7 @@ // Sooraj Pudiyadath // Jon Freedman // Megan Riel-Mehan +// Takafumi Yamaguchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -205,7 +206,17 @@ export function deleteFrames(root: Root, frames: number[]): Promise; + xref: 'container' | 'paper'; + yref: 'container' | 'paper'; + x: number; + y: number; + xanchor: 'auto' | 'left' | 'center' | 'right'; + yanchor: 'auto' | 'top' | 'middle' | 'bottom'; + pad: Partial + }>; titlefont: Partial; autosize: boolean; showlegend: boolean; diff --git a/types/plotly.js/test/index-tests.ts b/types/plotly.js/test/index-tests.ts index 79343f43f7..828f2870a3 100644 --- a/types/plotly.js/test/index-tests.ts +++ b/types/plotly.js/test/index-tests.ts @@ -251,6 +251,24 @@ const graphDiv = '#test'; }; Plotly.update(graphDiv, data_update, layout_update); })(); + +(() => { + const update = { + title: { + text: 'some new title', + font: { + size: 1.2, + }, + x: 0.9, + pad: { + t: 20 + }, + }, // updates the title + 'xaxis.range': [0, 5], // updates the xaxis range + 'yaxis.range[1]': 15 // updates the end of the yaxis range + } as Layout; + Plotly.relayout(graphDiv, update); +})(); ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// diff --git a/types/pollyjs__core/index.d.ts b/types/pollyjs__core/index.d.ts index 8ffe642497..38cd511408 100644 --- a/types/pollyjs__core/index.d.ts +++ b/types/pollyjs__core/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for @pollyjs/core 2.0 +// Type definitions for @pollyjs/core 2.2 // Project: https://github.com/netflix/pollyjs/tree/master/packages/@pollyjs/core // Definitions by: feinoujc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -55,8 +55,10 @@ export interface PollyConfig { } export interface Request { getHeader(name: string): string | null; - setHeader(name: string, value: string): Request; - setHeaders(headers: any): Request; + setHeader(name: string, value?: string | null): Request; + setHeaders(headers: Record): Request; + removeHeader(name: string): Request; + removeHeaders(headers: string[]): Request; hasHeader(name: string): boolean; type(contentType: string): Request; send(body: any): Request; @@ -83,8 +85,10 @@ export interface Response { body: any; status(status: number): Response; getHeader(name: string): string | null; - setHeader(name: string, value: string): Response; - setHeaders(headers: any): Response; + setHeader(name: string, value?: string | null): Response; + setHeaders(headers: Record): Response; + removeHeader(name: string): Request; + removeHeaders(headers: string[]): Request; hasHeader(name: string): boolean; type(contentType: string): Response; send(body: any): Response; @@ -100,8 +104,10 @@ export interface Intercept { export type RequestRouteEvent = 'request'; export type RecordingRouteEvent = 'beforeReplay' | 'beforePersist'; export type ResponseRouteEvent = 'beforeResponse' | 'response'; +export type ErrorRouteEvent = 'error'; export type EventListenerResponse = any; +export type ErrorEventListener = (req: Request, error: any) => EventListenerResponse; export type RequestEventListener = (req: Request) => EventListenerResponse; export type RecordingEventListener = (req: Request, recording: any) => EventListenerResponse; export type ResponseEventListener = (req: Request, res: Response) => EventListenerResponse; @@ -114,12 +120,15 @@ export class RouteHandler { on(event: RequestRouteEvent, listener: RequestEventListener): RouteHandler; on(event: RecordingRouteEvent, listener: RecordingEventListener): RouteHandler; on(event: ResponseRouteEvent, listener: ResponseEventListener): RouteHandler; + on(event: ErrorRouteEvent, listener: ErrorEventListener): RouteHandler; off(event: RequestRouteEvent, listener: RequestEventListener): RouteHandler; off(event: RecordingRouteEvent, listener: RecordingEventListener): RouteHandler; off(event: ResponseRouteEvent, listener: ResponseEventListener): RouteHandler; + off(event: ErrorRouteEvent, listener: ErrorEventListener): RouteHandler; once(event: RequestRouteEvent, listener: RequestEventListener): RouteHandler; once(event: RecordingRouteEvent, listener: RecordingEventListener): RouteHandler; once(event: ResponseRouteEvent, listener: ResponseEventListener): RouteHandler; + once(event: ErrorRouteEvent, listener: ErrorEventListener): RouteHandler; passthrough(value?: boolean): RouteHandler; intercept( diff --git a/types/pollyjs__core/pollyjs__core-tests.ts b/types/pollyjs__core/pollyjs__core-tests.ts index 0644eff7f4..bccd074bcf 100644 --- a/types/pollyjs__core/pollyjs__core-tests.ts +++ b/types/pollyjs__core/pollyjs__core-tests.ts @@ -127,5 +127,19 @@ async function test() { .configure({ expiresIn: '5d' }) .passthrough(); + server.any().on('error', (req, error) => { + req + .setHeader('Content-Length', '2344') + .setHeaders({ + 'Content-Type': 'application/json', + 'Content-Length': '42' + }) + .removeHeader('Content-Length') + .removeHeaders(['Content-Type', 'Content-Length']); + + req.removeHeaders(['Content-Type', 'Content-Length']); + log(req.pathname + JSON.stringify(error)); + }); + await polly.flush(); } diff --git a/types/postcss-nested/index.d.ts b/types/postcss-nested/index.d.ts new file mode 100644 index 0000000000..6bf8c45349 --- /dev/null +++ b/types/postcss-nested/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for postcss-nested 4.1 +// Project: https://github.com/postcss/postcss-nested#readme +// Definitions by: Maxim Vorontsov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { Plugin } from 'postcss'; + +declare namespace nested { + interface Options { + /** + * By default, plugin will bubble only @media and @supports at-rules. + * You can add your custom at-rules to this list by this option. + */ + bubble?: string[]; + + /** + * By default, plugin will unwrap only @font-face, @keyframes and @document at-rules. + * You can add your custom at-rules to this list by this option. + */ + unwrap?: string[]; + + /** + * By default, plugin will strip out any empty selector generated by intermediate nesting + * levels. You can set this option to true to preserve them. + */ + preserveEmpty?: boolean; + } + + type Nested = Plugin; +} + +declare const nested: nested.Nested; +export = nested; diff --git a/types/postcss-nested/package.json b/types/postcss-nested/package.json new file mode 100644 index 0000000000..1e1a719545 --- /dev/null +++ b/types/postcss-nested/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "postcss": "7.x.x" + } +} diff --git a/types/postcss-nested/postcss-nested-tests.ts b/types/postcss-nested/postcss-nested-tests.ts new file mode 100644 index 0000000000..86b0401559 --- /dev/null +++ b/types/postcss-nested/postcss-nested-tests.ts @@ -0,0 +1,12 @@ +import * as postcss from 'postcss'; +import nested = require('postcss-nested'); + +const withDefaultOptions: postcss.Transformer = nested(); +const withCustomOptions: postcss.Transformer = nested({ + bubble: ['phone'], + unwrap: ['phone'], + preserveEmpty: true +}); + +postcss().use(withDefaultOptions); +postcss().use(withCustomOptions); diff --git a/types/postcss-nested/tsconfig.json b/types/postcss-nested/tsconfig.json new file mode 100644 index 0000000000..b6e9346303 --- /dev/null +++ b/types/postcss-nested/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "postcss-nested-tests.ts" + ] +} diff --git a/types/postcss-nested/tslint.json b/types/postcss-nested/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/postcss-nested/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/postcss-url/index.d.ts b/types/postcss-url/index.d.ts index 361b69f1c7..472fccc21b 100644 --- a/types/postcss-url/index.d.ts +++ b/types/postcss-url/index.d.ts @@ -84,6 +84,13 @@ declare namespace url { */ ignoreFragmentWarning?: boolean; + /** + * Reduce size of inlined svg (IE9+, Android 3+) + * + * @default false + */ + optimizeSvgEncode?: boolean; + /** * Determine wether a file should be inlined. */ diff --git a/types/postcss-url/postcss-url-tests.ts b/types/postcss-url/postcss-url-tests.ts index a258b49be4..70086036ab 100644 --- a/types/postcss-url/postcss-url-tests.ts +++ b/types/postcss-url/postcss-url-tests.ts @@ -7,7 +7,7 @@ const single: postcss.Transformer = url({ url: 'copy', assetsPath: 'img', useHas const multiple: postcss.Transformer = url([ { filter: '**/assets/copy/*.png', url: 'copy', assetsPath: 'img', useHash: true }, - { filter: '**/assets/inline/*.svg', url: 'inline' }, + { filter: '**/assets/inline/*.svg', url: 'inline', optimizeSvgEncode: true }, { filter: '**/assets/**/*.gif', url: 'rebase' }, { filter: 'cdn/**/*', url: (asset) => `https://cdn.url/${asset.url}` }, ]); diff --git a/types/postman-collection/index.d.ts b/types/postman-collection/index.d.ts index 7a05c39128..0b32209b4f 100644 --- a/types/postman-collection/index.d.ts +++ b/types/postman-collection/index.d.ts @@ -154,7 +154,7 @@ export interface ItemGroupDefinition extends PropertyDefinition { export class ItemGroup extends Property { auth?: RequestAuth; - items: PropertyList; + items: PropertyList>; events: EventList; constructor(definition?: ItemGroupDefinition); diff --git a/types/postman-collection/postman-collection-tests.ts b/types/postman-collection/postman-collection-tests.ts index d203ed68f0..6b00083e74 100644 --- a/types/postman-collection/postman-collection-tests.ts +++ b/types/postman-collection/postman-collection-tests.ts @@ -137,7 +137,7 @@ igDef.event; // $ExpectType EventDefinition[] | undefined // ItemGroup Tests const ig = new pmCollection.ItemGroup(); ig.auth; // $ExpectType RequestAuth | undefined -ig.items; // $ExpectType PropertyList +ig.items; // $ExpectType PropertyList> ig.events; // $ExpectType EventList ig.authorizeRequestsUsing("string"); // $ExpectType void diff --git a/types/pretty/index.d.ts b/types/pretty/index.d.ts new file mode 100644 index 0000000000..a1bdfcb5a7 --- /dev/null +++ b/types/pretty/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for pretty 2.0 +// Project: https://github.com/jonschlinkert/pretty +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface PrettyOptions { + ocd: boolean; +} + +declare function pretty(str: string, options?: PrettyOptions): string; + +export = pretty; diff --git a/types/pretty/pretty-tests.ts b/types/pretty/pretty-tests.ts new file mode 100644 index 0000000000..0fe99519b4 --- /dev/null +++ b/types/pretty/pretty-tests.ts @@ -0,0 +1,5 @@ +import pretty = require("pretty"); + +pretty(`

nice

`); + +pretty(`

nice

`, {ocd: true}); diff --git a/types/pretty/tsconfig.json b/types/pretty/tsconfig.json new file mode 100644 index 0000000000..b46d610e45 --- /dev/null +++ b/types/pretty/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pretty-tests.ts" + ] +} diff --git a/types/pretty/tslint.json b/types/pretty/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/pretty/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/progress-stream/index.d.ts b/types/progress-stream/index.d.ts new file mode 100644 index 0000000000..17410ea177 --- /dev/null +++ b/types/progress-stream/index.d.ts @@ -0,0 +1,102 @@ +// Type definitions for progress-stream 2.0 +// Project: https://github.com/freeall/progress-stream +// Definitions by: Mick Dekkers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import stream = require("stream"); +export = progress_stream; + +declare function progress_stream( + options: progress_stream.Options, + progressListener: progress_stream.ProgressListener, +): progress_stream.ProgressStream; + +declare function progress_stream( + optionsOrProgressListener?: + | progress_stream.Options + | progress_stream.ProgressListener, +): progress_stream.ProgressStream; + +declare namespace progress_stream { + interface Options { + time?: number; + speed?: number; + length?: number; + drain?: boolean; + transferred?: number; + } + + type ProgressListener = (progress: Progress) => void; + + interface ProgressStream extends stream.Transform { + on(event: "progress", listener: ProgressListener): this; + on(event: "length", listener: (length: number) => void): this; + once(event: "progress", listener: ProgressListener): this; + once(event: "length", listener: (length: number) => void): this; + setLength(length: number): void; + progress(): Progress; + + // We have to redeclare all on/once overloads from stream.Transform in + // order for this ProgressStream interface to extend stream.Transform + // correctly. Using an intersection type instead may be an option once + // https://github.com/Microsoft/TypeScript/issues/30031 is resolved. + + // stream.Readable events + + /* tslint:disable-next-line adjacent-overload-signatures */ + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: any) => void): this; + /* tslint:disable-next-line unified-signatures */ + on(event: "end", listener: () => void): this; + /* tslint:disable-next-line unified-signatures */ + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + /* tslint:disable-next-line adjacent-overload-signatures */ + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: any) => void): this; + /* tslint:disable-next-line unified-signatures */ + once(event: "end", listener: () => void): this; + /* tslint:disable-next-line unified-signatures */ + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + + // stream.Writable events + + /* tslint:disable-next-line adjacent-overload-signatures unified-signatures */ + on(event: "drain", listener: () => void): this; + /* tslint:disable-next-line unified-signatures */ + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + /* tslint:disable-next-line unified-signatures */ + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + /* tslint:disable-next-line adjacent-overload-signatures unified-signatures */ + once(event: "drain", listener: () => void): this; + /* tslint:disable-next-line unified-signatures */ + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + /* tslint:disable-next-line unified-signatures */ + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + + // events shared by stream.Readable and stream.Writable + + /* tslint:disable-next-line adjacent-overload-signatures */ + on(event: string | symbol, listener: (...args: any[]) => void): this; + /* tslint:disable-next-line adjacent-overload-signatures */ + once(event: string | symbol, listener: (...args: any[]) => void): this; + /* tslint:enable adjacent-overload-signatures unified-signatures */ + } + + interface Progress { + percentage: number; + transferred: number; + length: number; + remaining: number; + eta: number; + runtime: number; + delta: number; + speed: number; + } +} diff --git a/types/progress-stream/progress-stream-tests.ts b/types/progress-stream/progress-stream-tests.ts new file mode 100644 index 0000000000..e10ab0f925 --- /dev/null +++ b/types/progress-stream/progress-stream-tests.ts @@ -0,0 +1,71 @@ +import progress = require("progress-stream"); +import stream = require("stream"); + +const options: progress.Options = { + time: 100, + speed: 100, + length: 100, + drain: true, + transferred: 0, +}; + +const progressListener = (progress: progress.Progress) => { + // $ExpectType number + progress.percentage; + // $ExpectType number + progress.transferred; + // $ExpectType number + progress.length; + // $ExpectType number + progress.remaining; + // $ExpectType number + progress.eta; + // $ExpectType number + progress.runtime; + // $ExpectType number + progress.delta; + // $ExpectType number + progress.speed; +}; + +// $ExpectType ProgressStream +const p = progress(); + +// $ExpectType ProgressStream +progress(options); + +// $ExpectType ProgressStream +progress(options, progressListener); + +// $ExpectType ProgressStream +progress(progressListener); + +// $ExpectType ProgressStream +p.on("progress", progressListener); + +// $ExpectType ProgressStream +p.on("length", (length: number) => {}); + +p.setLength(200); // $ExpectType void + +p.progress(); // $ExpectType Progress + +// Check if ProgressStream extends stream.Transform correctly + +// $ExpectType ProgressStream +p.on("close", () => {}); +// $ExpectType ProgressStream +p.on("data", (chunk: any) => {}); +// $ExpectType ProgressStream +p.on("end", () => {}); +// $ExpectType ProgressStream +p.on("error", (err: Error) => {}); +// $ExpectType ProgressStream +p.on("readable", () => {}); +// $ExpectType ProgressStream +p.pause(); + +const writable = new stream.Writable(); + +// $ExpectType Writable +p.pipe(writable); diff --git a/types/progress-stream/tsconfig.json b/types/progress-stream/tsconfig.json new file mode 100644 index 0000000000..0dfc8b25fc --- /dev/null +++ b/types/progress-stream/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "progress-stream-tests.ts"] +} diff --git a/types/progress-stream/tslint.json b/types/progress-stream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/progress-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/proper-lockfile/index.d.ts b/types/proper-lockfile/index.d.ts index 885e63808b..3e49e79fe3 100644 --- a/types/proper-lockfile/index.d.ts +++ b/types/proper-lockfile/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for proper-lockfile 3.0 // Project: https://github.com/moxystudio/node-proper-lockfile // Definitions by: Nikita Volodin +// Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface LockOptions { @@ -10,17 +11,20 @@ export interface LockOptions { realpath?: boolean; // default: true fs?: any; // default: graceful-fs onCompromised?: (err: Error) => any; // default: (err) => throw err + lockfilePath?: string; // default: `${file}.lock` } export interface UnlockOptions { realpath?: boolean; // default: true fs?: any; // default: graceful-fs + lockfilePath?: string; // default: `${file}.lock` } export interface CheckOptions { stale?: number; // default: 10000 realpath?: boolean; // default: true fs?: any; // default: graceful-fs + lockfilePath?: string; // default: `${file}.lock` } export function lock(file: string, options?: LockOptions): Promise<() => Promise>; diff --git a/types/proper-lockfile/proper-lockfile-tests.ts b/types/proper-lockfile/proper-lockfile-tests.ts index 7555fd5116..344e7be3f8 100644 --- a/types/proper-lockfile/proper-lockfile-tests.ts +++ b/types/proper-lockfile/proper-lockfile-tests.ts @@ -39,7 +39,12 @@ check('some/file') // isLocked will be true if 'some/file' is locked, false otherwise }); +lock('', { lockfilePath: 'some/file-lock' }) + .then((release) => release()); + const release = lockSync('some/file'); // $ExpectType () => void release(); // $ExpectType void unlockSync('some/file'); // $ExpectType void +unlockSync('', { lockfilePath: 'some/file-lock' }); // $ExpectType void checkSync('some/file'); // $ExpectType boolean +checkSync('', { lockfilePath: 'some/file-lock' }); // $ExpectType boolean diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index a0c2b6ae69..0fc8950838 100644 --- a/types/prosemirror-state/index.d.ts +++ b/types/prosemirror-state/index.d.ts @@ -22,7 +22,7 @@ import { EditorProps, EditorView } from 'prosemirror-view'; * This is the type passed to the [`Plugin`](#state.Plugin) * constructor. It provides a definition for a plugin. */ -export interface PluginSpec { +export interface PluginSpec { /** * The [view props](#view.EditorProps) added by this plugin. Props * that are functions will be bound to have the plugin instance as @@ -33,14 +33,14 @@ export interface PluginSpec { * Allows a plugin to define a [state field](#state.StateField), an * extra slot in the state object in which it can keep its own data. */ - state?: StateField | null; + state?: StateField | null; /** * Can be used to make this a keyed plugin. You can have only one * plugin with a given key in a given state, but it is possible to * access the plugin's configuration and state through the key, * without having access to the plugin instance object. */ - key?: PluginKey | null; + key?: PluginKey | null; /** * When the plugin needs to interact with the editor view, or * set something up in the DOM, use this field. The function @@ -82,11 +82,11 @@ export interface PluginSpec { * They are part of the [editor state](#state.EditorState) and * may influence that state and the view that contains it. */ -export class Plugin { +export class Plugin { /** * Create a plugin. */ - constructor(spec: PluginSpec); + constructor(spec: PluginSpec); /** * The [props](#view.EditorProps) exported by this plugin. */ @@ -94,11 +94,11 @@ export class Plugin { /** * The plugin's [spec object](#state.PluginSpec). */ - spec: { [key: string]: any }; + spec: PluginSpec; /** * Extract the plugin's state field from an editor state. */ - getState(state: EditorState): any; + getState(state: EditorState): T; } /** * A plugin spec may provide a state field (under its @@ -106,7 +106,7 @@ export class Plugin { * describes the state it wants to keep. Functions provided here are * always called with the plugin instance as their `this` binding. */ -export interface StateField { +export interface StateField { /** * Initialize the value of the field. `config` will be the object * passed to [`EditorState.create`](#state.EditorState^create). Note @@ -138,7 +138,7 @@ export interface StateField { * editor state. Assigning a key does mean only one plugin of that * type can be active in a state. */ -export class PluginKey { +export class PluginKey { /** * Create a plugin key. */ @@ -147,7 +147,7 @@ export class PluginKey { * Get the active plugin with this key, if any, from an editor * state. */ - get(state: EditorState): Plugin | null | undefined; + get(state: EditorState): Plugin | null | undefined; /** * Get the plugin's state from an editor state. */ @@ -440,7 +440,7 @@ export class EditorState { /** * The plugins that are active in this state. */ - plugins: Array>; + plugins: Array>; /** * Apply the given transaction to produce a new state. */ @@ -465,13 +465,13 @@ export class EditorState { * [`init`](#state.StateField.init) method, passing in the new * configuration object.. */ - reconfigure(config: { schema?: S | null; plugins?: Array> | null }): EditorState; + reconfigure(config: { schema?: S | null; plugins?: Array> | null }): EditorState; /** * Serialize this state to JSON. If you want to serialize the state * of plugins, pass an object mapping property names to use in the * resulting JSON object to plugin objects. */ - toJSON(pluginFields?: { [name: string]: Plugin } | string | number): { [key: string]: any }; + toJSON(pluginFields?: { [name: string]: Plugin } | string | number): { [key: string]: any }; /** * Create a new state. */ @@ -480,7 +480,7 @@ export class EditorState { doc?: ProsemirrorNode | null; selection?: Selection | null; storedMarks?: Mark[] | null; - plugins?: Array> | null; + plugins?: Array> | null; }): EditorState; /** * Deserialize a JSON representation of a state. `config` should @@ -490,9 +490,9 @@ export class EditorState { * instances with the property names they use in the JSON object. */ static fromJSON( - config: { schema: S; plugins?: Array> | null }, + config: { schema: S; plugins?: Array> | null }, json: { [key: string]: any }, - pluginFields?: { [name: string]: Plugin } + pluginFields?: { [name: string]: Plugin } ): EditorState; } /** @@ -589,11 +589,11 @@ export class Transaction extends Transform { * Store a metadata property in this transaction, keyed either by * name or by plugin. */ - setMeta(key: string | Plugin | PluginKey, value: any): Transaction; + setMeta(key: string | Plugin | PluginKey, value: any): Transaction; /** * Retrieve a metadata property for a given name or plugin. */ - getMeta(key: string | Plugin | PluginKey): any; + getMeta(key: string | Plugin | PluginKey): any; /** * Returns true if this transaction doesn't contain any metadata, * and can thus safely be extended. diff --git a/types/prosemirror-view/index.d.ts b/types/prosemirror-view/index.d.ts index a539be4593..da83390c40 100644 --- a/types/prosemirror-view/index.d.ts +++ b/types/prosemirror-view/index.d.ts @@ -79,6 +79,7 @@ export class Decoration { pos: number, toDOM: ((view: EditorView, getPos: () => number) => Node) | Node, spec?: { + [key: string]: any; side?: number | null; marks?: Mark[] | null; stopEvent?: ((event: Event) => boolean) | null; diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 2c21363b1a..e1b1f21334 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -473,8 +473,8 @@ declare namespace R { * Applies a function to the value at the given index of an array, returning a new copy of the array with the * element at the given index replaced with the result of the function application. */ - adjust(fn: (a: T) => T, index: number, list: ReadonlyArray): T[]; - adjust(fn: (a: T) => T, index: number): (list: ReadonlyArray) => T[]; + adjust(index: number, fn: (a: T) => T, list: ReadonlyArray): T[]; + adjust(index: number, fn: (a: T) => T): (list: ReadonlyArray) => T[]; /** * Returns true if all elements of the list match the predicate, false if there are any that don't. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 6a03cbc3f0..9db133c971 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -299,7 +299,7 @@ class F2 { const capitalize = (str: string) => R.pipe( R.split(""), - R.adjust(R.toUpper, 0), + R.adjust(0, R.toUpper), R.join("") )(str); diff --git a/types/raygun/index.d.ts b/types/raygun/index.d.ts index 9315161a33..b2da46c446 100644 --- a/types/raygun/index.d.ts +++ b/types/raygun/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -declare namespace raygun { +export namespace raygun { interface KeyValueObject { [key: string]: string | number | boolean | KeyValueObject; } @@ -143,4 +143,4 @@ declare class Client { ): void; } -export = Client; +export { Client }; diff --git a/types/raygun/raygun-tests.ts b/types/raygun/raygun-tests.ts index 76328b01c5..abef1e9021 100644 --- a/types/raygun/raygun-tests.ts +++ b/types/raygun/raygun-tests.ts @@ -1,6 +1,6 @@ -import Client = require('raygun'); +import raygun = require('raygun'); -const client = new Client(); // $ExpectType Client +const client = new raygun.Client(); // $ExpectType Client client.init({apiKey: '1'}); // $ExpectType Client client.init(); // $ExpectError diff --git a/types/rc-time-picker/package.json b/types/rc-time-picker/package.json new file mode 100644 index 0000000000..f06689a6b9 --- /dev/null +++ b/types/rc-time-picker/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "moment": "^2.19.4" + } +} diff --git a/types/react-aria-menubutton/index.d.ts b/types/react-aria-menubutton/index.d.ts index 157fdff642..dc3d975d64 100644 --- a/types/react-aria-menubutton/index.d.ts +++ b/types/react-aria-menubutton/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-aria-menubutton 6.1 +// Type definitions for react-aria-menubutton 6.2 // Project: https://github.com/davidtheclark/react-aria-menubutton // Definitions by: Muhammad Fawwaz Orabi // Chris Rohlfs @@ -100,7 +100,7 @@ export interface MenuItemProps * If value has a value, it will be passed to the onSelection handler * when the `MenuItem` is selected */ - value?: string | boolean | number; + value?: any; /** * If `text` has a value, its first letter will be the letter a user can diff --git a/types/react-aria-menubutton/react-aria-menubutton-tests.tsx b/types/react-aria-menubutton/react-aria-menubutton-tests.tsx index f284e932a4..e3b543103a 100644 --- a/types/react-aria-menubutton/react-aria-menubutton-tests.tsx +++ b/types/react-aria-menubutton/react-aria-menubutton-tests.tsx @@ -121,3 +121,18 @@ closeMenu("", { focusMenu: true }); openMenu(""); openMenu("", { focusMenu: true }); + +class ObjectMenuItem extends React.Component { + render() { + const itemValue = { name: "Test name", label: "Only item to select" }; + return ( + console.log(value.name)}> +
  • + {itemValue.label} +
  • +
    + ); + } +} + +ReactDOM.render(, document.body); diff --git a/types/react-avatar-editor/index.d.ts b/types/react-avatar-editor/index.d.ts index 3d4135120c..00603c898e 100644 --- a/types/react-avatar-editor/index.d.ts +++ b/types/react-avatar-editor/index.d.ts @@ -3,26 +3,26 @@ // Definitions by: Diogo Corrêa // Gabriel Prates // Laurent Senta +// David Spiess // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; -export interface ImageState { - height: number; - width: number; +export interface Position { x: number; y: number; - resource: ImageData; } -export interface CroppedRect { - x: number; - y: number; +export interface CroppedRect extends Position { width: number; height: number; } +export interface ImageState extends CroppedRect { + resource: ImageData; +} + export interface AvatarEditorProps { className?: string; image: string | File; @@ -33,7 +33,7 @@ export interface AvatarEditorProps { color?: number[]; style?: object; scale?: number; - position?: object; + position?: Position; rotate?: number; crossOrigin?: string; disableDrop?: boolean; @@ -44,7 +44,7 @@ export interface AvatarEditorProps { onMouseUp?(): void; onMouseMove?(event: Event): void; onImageChange?(): void; - onPositionChange?(): void; + onPositionChange?(position: Position): void; } export default class AvatarEditor extends React.Component { diff --git a/types/react-avatar-editor/react-avatar-editor-tests.tsx b/types/react-avatar-editor/react-avatar-editor-tests.tsx index bee4ff6a56..5942f55a7e 100644 --- a/types/react-avatar-editor/react-avatar-editor-tests.tsx +++ b/types/react-avatar-editor/react-avatar-editor-tests.tsx @@ -1,8 +1,16 @@ import * as React from "react"; -import AvatarEditor, { ImageState, CroppedRect } from "react-avatar-editor"; +import AvatarEditor, { + ImageState, + CroppedRect, + Position +} from "react-avatar-editor"; const file: File = new File(["str"], "image.jpg"); const image: ImageData = new ImageData(1, 2); +const position: Position = { + x: 1, + y: 1 +}; const imageState: ImageState = { height: 1, width: 1, @@ -34,7 +42,7 @@ class AvatarEditorTest extends React.Component { - + @@ -45,7 +53,7 @@ class AvatarEditorTest extends React.Component { {}} /> {}} /> {}} /> - {}} /> + {}} /> { diff --git a/types/react-big-calendar/index.d.ts b/types/react-big-calendar/index.d.ts index 3607086e06..7a6bebe1c2 100644 --- a/types/react-big-calendar/index.d.ts +++ b/types/react-big-calendar/index.d.ts @@ -114,7 +114,7 @@ export interface HeaderProps { } export interface Components { - event?: React.SFC | React.Component | React.ComponentClass | JSX.Element; + event?: React.ComponentType; eventWrapper?: React.ComponentType; eventContainerWrapper?: React.SFC | React.Component | React.ComponentClass | JSX.Element; dayWrapper?: React.SFC | React.Component | React.ComponentClass | JSX.Element; @@ -157,6 +157,11 @@ export interface ToolbarProps { children?: React.ReactNode; } +export interface EventProps { + event: T; + title: string; +} + export interface EventWrapperProps { // https://github.com/intljusticemission/react-big-calendar/blob/27a2656b40ac8729634d24376dff8ea781a66d50/src/TimeGridEvent.js#L28 style?: React.CSSProperties & { xOffset: number }; diff --git a/types/react-big-calendar/react-big-calendar-tests.tsx b/types/react-big-calendar/react-big-calendar-tests.tsx index 4bb6f23943..692db797ed 100644 --- a/types/react-big-calendar/react-big-calendar-tests.tsx +++ b/types/react-big-calendar/react-big-calendar-tests.tsx @@ -203,7 +203,7 @@ function Event(event: any) { class EventWrapper extends React.Component { render() { - const { continuesEarlier, label, accessors = {}, style } = this.props; + const { continuesEarlier, event, label, accessors = {}, style } = this.props; return (
    {continuesEarlier}-{label}-{accessors.title && event && accessors.title(event)}}
    diff --git a/types/react-click-outside/index.d.ts b/types/react-click-outside/index.d.ts index c09dccb155..3684c87484 100644 --- a/types/react-click-outside/index.d.ts +++ b/types/react-click-outside/index.d.ts @@ -1,11 +1,12 @@ // Type definitions for react-click-outside 3.0 // Project: https://github.com/kentor/react-click-outside // Definitions by: Christian Rackerseder +// Roman Nuritdinov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; -declare function enhanceWithClickOutside

    (wrappedComponent: React.ComponentClass

    ): React.ComponentClass

    ; +declare function enhanceWithClickOutside>(wrappedComponent: C): C; declare namespace enhanceWithClickOutside { } export = enhanceWithClickOutside; diff --git a/types/react-click-outside/react-click-outside-tests.tsx b/types/react-click-outside/react-click-outside-tests.tsx index d51516281e..fe8e7af110 100644 --- a/types/react-click-outside/react-click-outside-tests.tsx +++ b/types/react-click-outside/react-click-outside-tests.tsx @@ -22,6 +22,20 @@ class StatefulComponent extends React.Component { } } +@enhanceWithClickOutside +class ComponentWithDecorator extends React.Component { + state = { isOpened: true }; + + handleClickOutside() { + this.setState({ isOpened: false }); + } + + render() { + return

    {this.props.text}
    ; + } +} + const ClickOutsideStatefulComponent = enhanceWithClickOutside(StatefulComponent); render(, document.getElementById('test')); +render(, document.getElementById('test')); diff --git a/types/react-click-outside/tsconfig.json b/types/react-click-outside/tsconfig.json index caf91fdc1d..68d52cdab4 100644 --- a/types/react-click-outside/tsconfig.json +++ b/types/react-click-outside/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true }, "files": [ "index.d.ts", "react-click-outside-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-dom/index.d.ts b/types/react-dom/index.d.ts index f81bbf4021..19c842f5a2 100644 --- a/types/react-dom/index.d.ts +++ b/types/react-dom/index.d.ts @@ -17,7 +17,7 @@ import { DOMAttributes, DOMElement, ReactNode, ReactPortal } from 'react'; -export function findDOMNode(instance: ReactInstance): Element | null | Text; +export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text; export function unmountComponentAtNode(container: Element): boolean; export function createPortal(children: ReactNode, container: Element, key?: null | string): ReactPortal; diff --git a/types/react-dom/react-dom-tests.tsx b/types/react-dom/react-dom-tests.tsx index 46274e3ffd..20bfda53ea 100644 --- a/types/react-dom/react-dom-tests.tsx +++ b/types/react-dom/react-dom-tests.tsx @@ -30,6 +30,8 @@ describe('ReactDOM', () => { const rootElement = document.createElement('div'); ReactDOM.render(React.createElement('div'), rootElement); ReactDOM.findDOMNode(rootElement); + ReactDOM.findDOMNode(null); + ReactDOM.findDOMNode(undefined); }); it('createPortal', () => { diff --git a/types/react-dom/v15/index.d.ts b/types/react-dom/v15/index.d.ts index 8a22fd9bc2..653469b277 100644 --- a/types/react-dom/v15/index.d.ts +++ b/types/react-dom/v15/index.d.ts @@ -15,7 +15,7 @@ import { DOMAttributes, DOMElement } from 'react'; -export function findDOMNode(instance: ReactInstance): E; +export function findDOMNode(instance: ReactInstance | null | undefined): E; export function findDOMNode(instance: ReactInstance): Element; export function render

    , T extends Element>( diff --git a/types/react-dom/v15/react-dom-tests.ts b/types/react-dom/v15/react-dom-tests.ts index 865d74e386..5f5b149594 100644 --- a/types/react-dom/v15/react-dom-tests.ts +++ b/types/react-dom/v15/react-dom-tests.ts @@ -25,6 +25,8 @@ describe('ReactDOM', () => { const rootElement = document.createElement('div'); ReactDOM.render(React.createElement('div'), rootElement); ReactDOM.findDOMNode(rootElement); + ReactDOM.findDOMNode(null); + ReactDOM.findDOMNode(undefined); }); }); diff --git a/types/react-draft-wysiwyg/index.d.ts b/types/react-draft-wysiwyg/index.d.ts index 7b9b3577d8..46fab16511 100644 --- a/types/react-draft-wysiwyg/index.d.ts +++ b/types/react-draft-wysiwyg/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jpuri/react-draft-wysiwyg#readme // Definitions by: imechZhangLY // brunoMaurice +// ldanet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -18,9 +19,9 @@ export class ContentBlock extends Draft.ContentBlock {} export class SelectionState extends Draft.SelectionState {} export interface EditorProps { - onChange?(contentState: ContentState): RawDraftContentState; + onChange?(contentState: RawDraftContentState): void; onEditorStateChange?(editorState: EditorState): void; - onContentStateChange?(contentState: ContentState): RawDraftContentState; + onContentStateChange?(contentState: RawDraftContentState): void; initialContentState?: RawDraftContentState; defaultContentState?: RawDraftContentState; contentState?: RawDraftContentState; diff --git a/types/react-draft-wysiwyg/test/uncontrolled-raw-draft-content-state.tsx b/types/react-draft-wysiwyg/test/uncontrolled-raw-draft-content-state.tsx new file mode 100644 index 0000000000..4118ce2d09 --- /dev/null +++ b/types/react-draft-wysiwyg/test/uncontrolled-raw-draft-content-state.tsx @@ -0,0 +1,48 @@ +// From https://github.com/jpuri/react-draft-wysiwyg/blob/master/docs/src/components/Docs/Props/EditorStateProp/index.js#L125 + +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import { Editor, RawDraftContentState } from "react-draft-wysiwyg"; + +class UncontrolledEditor extends React.Component< + {}, + { contentState: RawDraftContentState } +> { + constructor(props: any) { + super(props); + this.state = { + contentState: JSON.parse(`{ + "entityMap":{}, + "blocks":[{ + "key":"1ljs", + "text":"Initializing from content state", + "type":"unstyled", + "depth":0, + "inlineStyleRanges":[], + "entityRanges":[], + "data":{} + }] + }`) + }; + } + + onContentStateChange = (contentState: RawDraftContentState) => { + this.setState({ + contentState + }); + } + + render() { + const { contentState } = this.state; + return ( + + ); + } +} + +ReactDOM.render(, document.getElementById("target")); diff --git a/types/react-draft-wysiwyg/tsconfig.json b/types/react-draft-wysiwyg/tsconfig.json index 35720c1979..0218edab95 100644 --- a/types/react-draft-wysiwyg/tsconfig.json +++ b/types/react-draft-wysiwyg/tsconfig.json @@ -24,6 +24,7 @@ "test/basic-controlled-tests.tsx", "test/basic-tests.tsx", "test/custom-toolbar-tests.tsx", - "test/focus-blur-callbacks-tests.tsx" + "test/focus-blur-callbacks-tests.tsx", + "test/uncontrolled-raw-draft-content-state.tsx" ] } diff --git a/types/react-hammerjs/index.d.ts b/types/react-hammerjs/index.d.ts index 03f3f36f98..6c9e29fab9 100644 --- a/types/react-hammerjs/index.d.ts +++ b/types/react-hammerjs/index.d.ts @@ -38,6 +38,7 @@ declare namespace ReactHammer { onPinchCancel?: HammerListener; onPinchEnd?: HammerListener; onPinchIn?: HammerListener; + onPinchOut?: HammerListener; onPinchStart?: HammerListener; onPress?: HammerListener; onPressUp?: HammerListener; diff --git a/types/react-instantsearch-core/index.d.ts b/types/react-instantsearch-core/index.d.ts index bceb91ca85..0092feb370 100644 --- a/types/react-instantsearch-core/index.d.ts +++ b/types/react-instantsearch-core/index.d.ts @@ -3,10 +3,13 @@ // Definitions by: Gordon Burgett // Justin Powell // David Furlong +// Haroen Viaene +// Samuel Vaillant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 import * as React from 'react'; +import { SearchParameters } from 'algoliasearch-helper'; // Core /** @@ -29,7 +32,15 @@ export function createInstantSearch( */ export function createIndex(defaultRoot: object): React.ComponentClass; -export interface ConnectorDescription { +export interface ConnectorSearchResults { + results: AllSearchResults; + searching: boolean; + searchingForFacetValues: boolean; + isSearchStalled: boolean; + error: any; +} + +export interface ConnectorDescription { displayName: string; propTypes?: any; defaultProps?: any; @@ -43,14 +54,26 @@ export interface ConnectorDescription { * meta is the list of metadata from all widgets whose connector defines a getMetadata method. * searchForFacetValuesResults holds the search for facet values results. */ - getProvidedProps?(...args: any[]): any; + getProvidedProps( + this: React.Component, + props: TExposed, + searchState: SearchState, + searchResults: ConnectorSearchResults, + metadata: any, + resultsFacetValues: any, + ): TProvided; /** * This method defines exactly how the refine prop of widgets affects the search state. * It takes in the current props of the higher-order component, the search state of all widgets, as well as all arguments passed * to the refine and createURL props of stateful widgets, and returns a new state. */ - refine?(...args: any[]): any; + refine?( + this: React.Component, + props: TExposed, + searchState: SearchState, + ...args: any[], + ): SearchState; /** * This method applies the current props and state to the provided SearchParameters, and returns a new SearchParameters. The SearchParameters @@ -59,7 +82,12 @@ export interface ConnectorDescription { * to produce a new SearchParameters. Then, if the output SearchParameters differs from the previous one, a new search is triggered. * As such, the getSearchParameters method allows you to describe how the state and props of a widget should affect the search parameters. */ - getSearchParameters?(...args: any[]): any; + getSearchParameters?( + this: React.Component, + searchParameters: SearchParameters, + props: TExposed, + searchState: SearchState, + ): SearchParameters; /** * This method allows the widget to register a custom metadata object for any props and state combination. @@ -70,7 +98,11 @@ export interface ConnectorDescription { * The CurrentRefinements widget leverages this mechanism in order to allow any widget to declare the filters it has applied. If you want to add * your own filter, declare a filters property on your widget’s metadata */ - getMetadata?(...args: any[]): any; + getMetadata?( + this: React.Component, + props: TExposed, + searchState: SearchState, + ...args: any[]): any; /** * This method needs to be implemented if you want to have the ability to perform a search for facet values inside your widget. @@ -78,7 +110,11 @@ export interface ConnectorDescription { * props of stateful widgets, and returns an object of the shape: {facetName: string, query: string, maxFacetHits?: number}. The default value for the * maxFacetHits is the one set by the API which is 10. */ - searchForFacetValues?(...args: any[]): any; + searchForFacetValues?( + this: React.Component, + searchState: SearchState, + nextRefinement?: any, + ): any; /** * This method is called when a widget is about to unmount in order to clean the searchState. @@ -87,9 +123,13 @@ export interface ConnectorDescription { * searchState holds the searchState of all widgets, with the shape {[widgetId]: widgetState}. Stateful widgets describe the format of their searchState * in their respective documentation entry. */ - cleanUp?(...args: any[]): any; + cleanUp?(this: React.Component, props: TExposed, searchState: SearchState): SearchState; } +export type ConnectorProvided = TProvided & + { refine: (...args: any[]) => any, createURL: (...args: any[]) => string } & + { searchForItems: (...args: any[]) => any }; + /** * Connectors are the HOC used to transform React components * into InstantSearch widgets. @@ -100,7 +140,14 @@ export interface ConnectorDescription { * @return a function that wraps a component into * an instantsearch connected one. */ -export function createConnector(connectorDesc: ConnectorDescription): (Composed: React.ComponentType) => React.ComponentClass; +export function createConnector( + connectorDesc: ConnectorDescription, +): ( + (stateless: React.StatelessComponent>) => React.ComponentClass + ) & ( + >>(Composed: React.ComponentType) => + ConnectedComponentClass, TExposed> + ); // Utils export const HIGHLIGHT_TAGS: { @@ -108,7 +155,17 @@ export const HIGHLIGHT_TAGS: { highlightPostTag: string, }; export const version: string; -export function translatable(defaultTranslations: any): (Composed: React.ComponentType) => React.ComponentClass; + +export interface TranslatableProvided { + translate(key: string, ...params: any[]): string; +} +export interface TranslatableExposed { + translations?: { [key: string]: string | ((...args: any[]) => string) }; +} + +export function translatable(defaultTranslations: { [key: string]: string | ((...args: any[]) => string) }): + (ctor: React.ComponentType) => + ConnectedComponentClass; // Widgets /** @@ -125,7 +182,21 @@ export function translatable(defaultTranslations: any): (Composed: React.Compone export class Configure extends React.Component {} // Connectors -export function connectAutoComplete(Composed: React.ComponentType): React.ComponentClass; +export interface AutocompleteProvided { + hits: Array>; + currentRefinement: string; + refine(value?: string): void; +} + +export interface AutocompleteExposed { + defaultRefinement?: string; +} + +// tslint:disable-next-line:no-unnecessary-generics +export function connectAutoComplete(stateless: React.StatelessComponent>): React.ComponentClass; +export function connectAutoComplete, TDoc = BasicDoc>(Composed: React.ComponentType): + ConnectedComponentClass, AutocompleteExposed>; + export function connectBreadcrumb(Composed: React.ComponentType): React.ComponentClass; export function connectConfigure(Composed: React.ComponentType): React.ComponentClass; @@ -208,7 +279,51 @@ export function connectGeoSearch(stateless: React.StatelessComponent>, THit>(ctor: React.ComponentType): ConnectedComponentClass, GeoSearchExposed>; export function connectHierarchicalMenu(Composed: React.ComponentType): React.ComponentClass; -export function connectHighlight(Composed: React.ComponentType): React.ComponentClass; + +export interface HighlightProvided { + /** + * function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: + * * highlightProperty which is the property that contains the highlight structure from the records, + * * attribute which is the name of the attribute (it can be either a string or an array of strings) to look for, + * * hit which is the hit from Algolia. + * It returns an array of objects {value: string, isHighlighted: boolean}. + * If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects. + * In this case you should cast the result: + * ```ts + * highlight({ + * attribute: 'my_string_array', + * hit, + * highlightProperty: '_highlightResult' + * }) as Array> + * ``` + */ + highlight(configuration: { + attribute: string; + hit: Hit; + highlightProperty: string; + preTag?: string; + postTag?: string; + }): Array<{value: string, isHighlighted: boolean}>; +} + +interface HighlightPassedThru { + hit: Hit; + attribute: string; + highlightProperty?: string; +} + +export type HighlightProps = HighlightProvided & HighlightPassedThru; + +/** + * connectHighlight connector provides the logic to create an highlighter component that will retrieve, parse and render an highlighted attribute from an Algolia hit. + */ +export function connectHighlight(stateless: React.StatelessComponent>): React.ComponentClass>; +export function connectHighlight>, TDoc>(ctor: React.ComponentType): ConnectedComponentClass>; + +interface HitsProvided { + /** the records that matched the search state */ + hits: Array>; +} /** * connectHits connector provides the logic to create connected components that will render the results retrieved from Algolia. @@ -217,7 +332,9 @@ export function connectHighlight(Composed: React.ComponentType): React.Comp * * https://community.algolia.com/react-instantsearch/connectors/connectHits.html */ -export function connectHits(ctor: React.ComponentType): ConnectedComponentClass; +// tslint:disable-next-line:no-unnecessary-generics +export function connectHits(stateless: React.StatelessComponent>): React.ComponentClass; +export function connectHits, THit>(ctor: React.ComponentType): ConnectedComponentClass>; export function connectHitsPerPage(Composed: React.ComponentType): React.ComponentClass; @@ -386,7 +503,7 @@ export interface StateResultsProvided { */ searchResults: SearchResults; /** In case of multiple indices you can retrieve all the results */ - allSearchResults: { [index: string]: SearchResults }; + allSearchResults: AllSearchResults; /** If there is a search in progress. */ searching: boolean; /** Flag that indicates if React InstantSearch has detected that searches are stalled. */ @@ -402,10 +519,20 @@ export interface StateResultsProvided { * * https://community.algolia.com/react-instantsearch/connectors/connectStateResults.html */ -export function connectStateResults(stateless: React.StatelessComponent): React.ComponentClass; -export function connectStateResults>, TDoc>(ctor: React.ComponentType): ConnectedComponentClass>; +export function connectStateResults( + stateless: React.StatelessComponent): React.ComponentClass; +export function connectStateResults>>( + ctor: React.ComponentType): ConnectedComponentClass; + +interface StatsProvided { + nbHits: number; + processingTimeMS: number; +} + +export function connectStats(stateless: React.StatelessComponent): React.ComponentClass; +export function connectStats>(ctor: React.ComponentType): + ConnectedComponentClass; -export function connectStats(Composed: React.ComponentType): React.ComponentClass; export function connectToggleRefinement(Composed: React.ComponentType): React.ComponentClass; export interface AlgoliaError { @@ -428,6 +555,8 @@ export type ConnectedComponentClass * https://community.algolia.com/react-instantsearch/guide/Search_state.html */ export interface SearchState { + [widgetId: string]: any; + range?: { [key: string]: { min: number; @@ -487,7 +616,7 @@ export interface SearchResults { nbPages: number; page: number; processingTimeMS: number; - exhaustiveNbHits: true; + exhaustiveNbHits: boolean; disjunctiveFacets: any[]; hierarchicalFacets: any[]; facets: any[]; @@ -495,6 +624,14 @@ export interface SearchResults { automaticRadius?: string; } +/** + * The shape of the searchResults object when used in a multi-index search + * https://community.algolia.com/react-instantsearch/connectors/connectStateResults.html#default-props-entry-connectStateResults-searchResults + */ +export type AllSearchResults = { + [index: string]: SearchResults; +} & SearchResults; + /** * All the records that match the search parameters. * Each record is augmented with a new attribute `_highlightResult` which is an diff --git a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx index e39a9f53e6..76cc26f2a4 100644 --- a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx +++ b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx @@ -11,7 +11,21 @@ import { CurrentRefinementsProvided, connectCurrentRefinements, RefinementListProvided, - Refinement + Refinement, + connectHighlight, + connectHits, + HighlightProvided, + HighlightProps, + AutocompleteProvided, + connectAutoComplete, + Hit, + TranslatableProvided, + translatable, + ConnectorProvided, + StateResultsProvided, + ConnectorSearchResults, + BasicDoc, + AllSearchResults } from 'react-instantsearch-core'; () => { @@ -58,9 +72,12 @@ import { queryAndPage: [newQuery, newPage], }; }, - })(props => + })((props) =>

    The query is {props.query}, the page is {props.page}. + This is an error: { + props.somethingElse // $ExpectError + } {/* Clicking on this button will update the searchState to: { @@ -88,18 +105,143 @@ import { }; () => { + interface Provided { + query: string; + page: number; + } + + interface Exposed { + defaultRefinement: string; + startAtPage: number; + } + + const typedCoolConnector = createConnector({ + displayName: 'CoolWidget', + + getProvidedProps(props, searchState) { + // Since the `queryAndPage` searchState entry isn't necessarily defined, we need + // to default its value. + const [query, page] = searchState.queryAndPage || + [props.defaultRefinement, props.startAtPage]; + + // Connect the underlying component to the `queryAndPage` searchState entry. + return { + query, + page, + }; + }, + + refine(props, searchState, newQuery, newPage) { + // When the underlying component calls its `refine` prop, update the searchState + // with the new query and page. + return { + // `searchState` represents the search state of *all* widgets. We need to extend it + // instead of replacing it, otherwise other widgets will lose their + // respective state. + ...searchState, + queryAndPage: [newQuery, newPage], + }; + }, + }); + + const TypedCoolWidgetStateless = typedCoolConnector((props) => +
    + The query is {props.query}, the page is {props.page}. + This is an error: { + props.somethingElse // $ExpectError + } + {/* + Clicking on this button will update the searchState to: + { + ...otherSearchState, + query: 'algolia', + page: 20, + } + */} +
    + ); + + ; + + const TypedCoolWidget = typedCoolConnector( + class extends React.Component & { passThruName: string }> { + render() { + const props = this.props; + return
    + The query is {props.query}, the page is {props.page}. + The name is {props.passThruName} + {/* + Clicking on this button will update the searchState to: + { + ...otherSearchState, + query: 'algolia', + page: 20, + } + */} +
    ; + } + } + ); + + ; +}; + +() => { + interface MyDoc { + field1: string; + field2: number; + field3: { compound: string }; + } + interface StateResultsProps { - searchResults: SearchResults<{ - field1: string - field2: number - field3: { compound: string } - }>; + searchResults: SearchResults; // partial of StateResultsProvided additionalProp: string; } - const Stateless = ({ additionalProp, searchResults }: StateResultsProps) => + const Stateless = connectStateResults( + ({ + searchResults, + additionalProp, // $ExpectError + }) => (
    +

    {additionalProp}

    + {searchResults.hits.map((h) => { + return {h._highlightResult.field1!.value}; + })} +
    ) + ); + + ; + ; // $ExpectError + + const StatelessWithType = ({ additionalProp, searchResults }: StateResultsProps) =>

    {additionalProp}

    {searchResults.hits.map((h) => { @@ -108,11 +250,11 @@ import { return {compound}; })}
    ; - const ComposedStateless = connectStateResults(Stateless); + const ComposedStatelessWithType = connectStateResults(StatelessWithType); - ; // $ExpectError + ; // $ExpectError - ; + ; class MyComponent extends React.Component { render() { @@ -219,3 +361,348 @@ import { ; }; + +() => { + interface MyDoc { + a: 1; + b: { + c: '2' + }; + } + + const CustomHighlight = connectHighlight( + ({ highlight, attribute, hit }) => { + const highlights = highlight({ + highlightProperty: '_highlightResult', + attribute, + hit + }); + + return <> + {highlights.map(part => part.isHighlighted ? ( + {part.value} + ) : ( + {part.value} + )) + }; + } + ); + + class CustomHighlight2 extends React.Component { + render() { + const {highlight, attribute, hit, limit} = this.props; + const highlights = highlight({ + highlightProperty: '_highlightResult', + attribute, + hit + }); + + return <> + {highlights.slice(0, limit).map(part => part.isHighlighted ? ( + {part.value} + ) : ( + {part.value} + )) + }; + } + } + const ConnectedCustomHighlight2 = connectHighlight(CustomHighlight2); + + connectHits(({ hits }) => ( +

    + + +

    + )); +}; + +// https://github.com/algolia/react-instantsearch/blob/master/examples/autocomplete/src/App-Mentions.js +() => { + const Mention: any = null; // import Mention from 'antd/lib/mention'; + + const AsyncMention = ({ hits, refine }: AutocompleteProvided) => ( + hit.name)} + onSearchChange={refine} + /> + ); + + const ConnectedAsyncMention = connectAutoComplete(AsyncMention); + + ; +}; + +// https://github.com/algolia/react-instantsearch/blob/master/examples/autocomplete/src/App-Multi-Index.js +import * as Autosuggest from 'react-autosuggest'; +() => { + class Example extends React.Component { + state = { + value: this.props.currentRefinement, + }; + + onChange = (_event: any, { newValue }: { newValue: string }) => { + this.setState({ + value: newValue, + }); + } + + onSuggestionsFetchRequested = ({ value }: { value: string }) => { + this.props.refine(value); + } + + onSuggestionsClearRequested = () => { + this.props.refine(); + } + + getSuggestionValue(hit: Hit) { + return hit.name; + } + + renderSuggestion(hit: Hit) { + const Highlight: any = null; // import {Highlight} from 'react-instantsearch-dom' + return ; + } + + renderSectionTitle(section: any) { + return section.index; + } + + getSectionSuggestions(section: any) { + return section.hits; + } + + render() { + const { hits } = this.props; + const { value } = this.state; + + const inputProps = { + placeholder: 'Search for a product...', + onChange: this.onChange, + value, + }; + + return ( + + ); + } + } + + const AutoComplete = connectAutoComplete(Example); + + ; +}; + +() => { + type Props = SearchBoxProvided & TranslatableProvided & { + className?: string + showLoadingIndicator?: boolean + + submit?: JSX.Element; + reset?: JSX.Element; + loadingIndicator?: JSX.Element; + + onSubmit?: (event: React.SyntheticEvent) => any; + onReset?: (event: React.SyntheticEvent) => any; + onChange?: (event: React.SyntheticEvent) => any; + }; + interface State { + query: string | null; + } + + class SearchBox extends React.Component { + static defaultProps = { + currentRefinement: '', + className: 'ais-SearchBox', + focusShortcuts: ['s', '/'], + autoFocus: false, + searchAsYouType: true, + showLoadingIndicator: false, + isSearchStalled: false, + reset: clear, + submit: search, + }; + + constructor(props: SearchBox['props']) { + super(props); + + this.state = { + query: null, + }; + } + + getQuery = () => this.props.currentRefinement; + + onSubmit = (e: React.SyntheticEvent) => { + e.preventDefault(); + e.stopPropagation(); + + const { refine, onSubmit } = this.props; + + if (onSubmit) { + onSubmit(e); + } + return false; + } + + onChange = (event: React.ChangeEvent) => { + const { onChange } = this.props; + const value = event.target.value; + + this.setState({ query: value }); + + if (onChange) { + onChange(event); + } + } + + onReset = (event: React.FormEvent) => { + const { refine, onReset } = this.props; + + refine(''); + + this.setState({ query: '' }); + + if (onReset) { + onReset(event); + } + } + + render() { + const { + className, + translate, + loadingIndicator, + submit, + reset, + } = this.props; + const query = this.getQuery(); + + const isSearchStalled = + this.props.showLoadingIndicator && this.props.isSearchStalled; + + const isCurrentQuerySubmitted = + query && query === this.props.currentRefinement; + + const button = + isSearchStalled ? 'loading' : + isCurrentQuerySubmitted ? 'reset' : 'submit'; + + return ( +
    +
    + + + + +
    +
    + ); + } + } + + const TranslatableSearchBox = translatable({ + resetTitle: 'Clear the search query.', + submitTitle: 'Submit your search query.', + placeholder: 'Search here…', + })(SearchBox); + + const ConnectedSearchBox = connectSearchBox(TranslatableSearchBox); + + search} + onSubmit={(evt) => { console.log('submitted', evt); }} + />; +}; + +// can we recreate connectStateResults from source using the createConnector typedef? +() => { + function getIndexId(context: any): string { + return context && context.multiIndexContext + ? context.multiIndexContext.targetedIndex + : context.ais.mainTargetedIndex; + } + + function getResults(searchResults: { results: AllSearchResults }, context: any): SearchResults | null | undefined { + const {results} = searchResults; + if (results && !results.hits) { + return results[getIndexId(context)] + ? results[getIndexId(context)] + : null; + } else { + return results ? results : null; + } + } + + const csr = createConnector({ + displayName: 'AlgoliaStateResults', + + getProvidedProps(props, searchState, searchResults) { + const results = getResults(searchResults, this.context); + + return { + searchState, + searchResults: results, + allSearchResults: searchResults.results, + searching: searchResults.searching, + isSearchStalled: searchResults.isSearchStalled, + error: searchResults.error, + searchingForFacetValues: searchResults.searchingForFacetValues, + props, + }; + }, + }); + + const asConnectStateResults: typeof connectStateResults = csr; +}; diff --git a/types/react-instantsearch-dom/index.d.ts b/types/react-instantsearch-dom/index.d.ts index 6ecb03c981..6f270485b3 100644 --- a/types/react-instantsearch-dom/index.d.ts +++ b/types/react-instantsearch-dom/index.d.ts @@ -2,6 +2,8 @@ // Project: https://community.algolia.com/react-instantsearch/ // Definitions by: Gordon Burgett // Justin Powell +// Haroen Viaene +// Samuel Vaillant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 diff --git a/types/react-instantsearch-native/index.d.ts b/types/react-instantsearch-native/index.d.ts index 6b328de132..74933ebabf 100644 --- a/types/react-instantsearch-native/index.d.ts +++ b/types/react-instantsearch-native/index.d.ts @@ -2,6 +2,8 @@ // Project: https://community.algolia.com/react-instantsearch // Definitions by: Gordon Burgett // Justin Powell +// Haroen Viaene +// Samuel Vaillant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 diff --git a/types/react-instantsearch/index.d.ts b/types/react-instantsearch/index.d.ts index 3f80cf4aa3..64a415e6ba 100644 --- a/types/react-instantsearch/index.d.ts +++ b/types/react-instantsearch/index.d.ts @@ -2,6 +2,8 @@ // Project: https://community.algolia.com/react-instantsearch/ // Definitions by: Gordon Burgett // Justin Powell +// Haroen Viaene +// Samuel Vaillant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 diff --git a/types/react-jss/index.d.ts b/types/react-jss/index.d.ts index c2ee0a008a..b7dafa5982 100644 --- a/types/react-jss/index.d.ts +++ b/types/react-jss/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Sebastian Silbermann // James Lawrence // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import { createGenerateClassName, JSS, SheetsRegistry } from "jss"; import * as React from "react"; import { createTheming, ThemeProvider, withTheme } from "theming"; diff --git a/types/react-jss/lib/injectSheet.d.ts b/types/react-jss/lib/injectSheet.d.ts index d165ee7e6d..eb35117017 100644 --- a/types/react-jss/lib/injectSheet.d.ts +++ b/types/react-jss/lib/injectSheet.d.ts @@ -73,11 +73,11 @@ export interface CSSProperties { | DynamicCSSRule | CSSProperties; } -export type Styles = Record< +export type Styles = Record< ClassKey, CSSProperties >; -export type StyleCreator = ( +export type StyleCreator = ( theme: T ) => Styles; @@ -93,20 +93,20 @@ export interface InjectOptions extends CreateStyleSheetOptions { theming?: Theming; } -export type ClassNameMap = Record; +export type ClassNameMap = Record; export type WithSheet< - S extends string | Styles | StyleCreator, + S extends string | Styles | StyleCreator, GivenTheme = undefined, - Props = {} +Props = {}, > = { classes: ClassNameMap< - S extends string + S extends string | number | symbol ? S : S extends StyleCreator ? C : S extends Styles ? C : never >; -} & WithTheme ? T : GivenTheme>; +} & WithTheme ? T : GivenTheme>; export interface WithTheme { theme: T; diff --git a/types/react-kawaii/index.d.ts b/types/react-kawaii/index.d.ts new file mode 100644 index 0000000000..59a311c091 --- /dev/null +++ b/types/react-kawaii/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for react-kawaii 0.11 +// Project: https://github.com/miukimiu/react-kawaii +// Definitions by: Zhang Yi Jiang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export type KawaiiMood = + | 'sad' + | 'shocked' + | 'happy' + | 'blissful' + | 'lovestruck' + | 'excited' + | 'ko'; + +export interface KawaiiProps { + size?: number; + color?: string; + mood?: KawaiiMood; +} + +export const SpeechBubble: React.ComponentType; +export const Mug: React.ComponentType; +export const Browser: React.ComponentType; +export const Ghost: React.ComponentType; +export const Cat: React.ComponentType; +export const IceCream: React.ComponentType; +export const CreditCard: React.ComponentType; +export const File: React.ComponentType; +export const Backpack: React.ComponentType; +export const Planet: React.ComponentType; diff --git a/types/react-kawaii/react-kawaii-tests.tsx b/types/react-kawaii/react-kawaii-tests.tsx new file mode 100644 index 0000000000..d8412e3dbf --- /dev/null +++ b/types/react-kawaii/react-kawaii-tests.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import { Cat, Planet, Mug, Browser, Backpack, Ghost, File, SpeechBubble, KawaiiMood, KawaiiProps, IceCream } from 'react-kawaii'; + +const PlanetExample = () => ; +const MugExample = () => ; +const GhostExample = () => ; +const FileExample = () => ; +const IceCreamExample = () => ; +const BrowserExample = () => ; +const BackpackExample = () => ; +const SpeechBubbleExample = () => ; +const CatExample = () => ; + +// $ExpectError +const invalidMoodNumber: KawaiiMood = 5; + +// $ExpectError +const invalidMoodString: KawaiiMood = ''; + +// This is defined on one line to avoid the position of the error moving between TS2/3 +// $ExpectError +const invalidProps: KawaiiProps = { size: '200px' }; diff --git a/types/react-kawaii/tsconfig.json b/types/react-kawaii/tsconfig.json new file mode 100644 index 0000000000..9650d17bb0 --- /dev/null +++ b/types/react-kawaii/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-kawaii-tests.tsx" + ] +} diff --git a/types/react-kawaii/tslint.json b/types/react-kawaii/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-kawaii/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-lottie/index.d.ts b/types/react-lottie/index.d.ts index a57da91307..d547396a11 100644 --- a/types/react-lottie/index.d.ts +++ b/types/react-lottie/index.d.ts @@ -21,7 +21,7 @@ export interface Options { */ animationData: any; rendererSettings?: { - preserveAspectRatio?: boolean; + preserveAspectRatio?: string; /** * The canvas context */ diff --git a/types/react-measure/index.d.ts b/types/react-measure/index.d.ts index 9cd5853948..3236dc2a4c 100644 --- a/types/react-measure/index.d.ts +++ b/types/react-measure/index.d.ts @@ -57,7 +57,7 @@ export interface MeasureProps { children?: React.SFC; } -export declare function withContentRect(types: ReadonlyArray | MeasurementType): +export function withContentRect(types: ReadonlyArray | MeasurementType): (fn: MeasuredComponent) => React.ComponentType; declare class Measure extends React.Component {} diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 99865ac3be..a96ffd41eb 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7662,6 +7662,9 @@ export interface PanResponderStatic { export interface Rationale { title: string; message: string; + buttonPositive: string; + buttonNegative?: string; + buttonNeutral?: string; } export type Permission = @@ -9294,7 +9297,9 @@ export const PointPropType: React.Validator; export const ViewPropTypes: React.ValidationMap; declare global { - function require(name: string): any; + type ReactNativeRequireFunction = (name: string) => any; + + var require: ReactNativeRequireFunction; /** * Console polyfill @@ -9312,7 +9317,7 @@ declare global { ignoredYellowBox: string[]; } - const console: Console; + var console: Console; /** * Navigator object for accessing location API diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index df678c4ed9..f2b0b968fb 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -31,6 +31,8 @@ // Fellipe Chagas // Deniss Borisovs // Kenneth Skovhus +// Aaron Rosen +// Haseeb Majid // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -623,7 +625,7 @@ export interface NavigationEventSubscription { } export interface NavigationEventsProps extends ViewProps { - navigation?: NavigationNavigator; + navigation?: NavigationScreenProp; onWillFocus?: NavigationEventCallback; onDidFocus?: NavigationEventCallback; onWillBlur?: NavigationEventCallback; @@ -921,6 +923,7 @@ export interface DrawerItemsProps { inactiveLabelStyle?: StyleProp; iconContainerStyle?: StyleProp; drawerPosition: 'left' | 'right'; + screenProps?: any; } export interface DrawerScene { route: NavigationRoute; @@ -1367,3 +1370,5 @@ export interface SafeAreaViewProps extends ViewProps { } export const SafeAreaView: React.ComponentClass; + +export const NavigationContext: React.Context>; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d30714fadb..777a8fa9f3 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -42,6 +42,7 @@ import { HeaderBackButton, Header, NavigationContainer, + NavigationContext, NavigationParams, NavigationPopAction, NavigationPopToTopAction, @@ -681,3 +682,14 @@ const ViewWithNavigationEvents = ( onDidBlur={console.log} /> ); + +// Test NavigationContext +const componentWithNavigationContext = ( + + { + navigationContext => ( + + ) + } + +); diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index dffcbf29f8..bf11a9fa30 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -53,24 +53,24 @@ export interface PropTypes { role: 'combobox'; 'aria-autocomplete': 'list'; 'aria-expanded': boolean; - 'aria-activedescendant': string | null; + 'aria-activedescendant': string | undefined; disabled: boolean; onKeyDown: React.KeyboardEventHandler; - onBlur: () => void; + onBlur: React.FocusEventHandler; value: string | undefined; onChange: (ev: { target: { value: string }}) => void; } & InputProps; getSuggestionItemProps: (suggestion: Suggestion, options?: SuggestionProps) => { key: number; - id: string | null; + id: string | undefined; role: 'option'; - onMouseEnter: () => void; - onMouseLeave: () => void; + onMouseEnter: React.MouseEventHandler; + onMouseLeave: React.MouseEventHandler; onMouseDown: React.MouseEventHandler; - onMouseUp: () => void; - onTouchStart: () => void; - onTouchEnd: () => void; - onClick: (event?: Event) => void; + onMouseUp: React.MouseEventHandler; + onTouchStart: React.TouchEventHandler; + onTouchEnd: React.TouchEventHandler; + onClick: React.MouseEventHandler; } & SuggestionProps; }>) => React.ReactNode; } diff --git a/types/react-places-autocomplete/react-places-autocomplete-tests.tsx b/types/react-places-autocomplete/react-places-autocomplete-tests.tsx index 7d72ac4397..3da7a4e81c 100644 --- a/types/react-places-autocomplete/react-places-autocomplete-tests.tsx +++ b/types/react-places-autocomplete/react-places-autocomplete-tests.tsx @@ -31,18 +31,30 @@ class Test extends React.Component { return (
    - {({getInputProps, getSuggestionItemProps, suggestions}) => ( - <> - -
    - {suggestions.map(suggestion => ( -
    - {suggestion.description} -
    - ))} -
    - - )} + {({getInputProps, suggestions, getSuggestionItemProps, loading}) => { + const inputProps = getInputProps({ + required: true, + className: loading ? 'is-pending' : '' + }); + return ( + <> + +
    + {suggestions.map(suggestion => { + const divProps = getSuggestionItemProps(suggestion, { + className: suggestion.active ? 'active' : '' + }); + return ( +
    + {suggestion.description} +
    + ); + })} +
    + + ); + } + }
    ); diff --git a/types/react-relay/test/react-relay-tests.tsx b/types/react-relay/test/react-relay-tests.tsx index f19d2a818c..14461ab9e5 100644 --- a/types/react-relay/test/react-relay-tests.tsx +++ b/types/react-relay/test/react-relay-tests.tsx @@ -1,7 +1,7 @@ // tslint:disable:interface-over-type-literal import * as React from "react"; -import { Environment, Network, RecordSource, Store, ConnectionHandler, FragmentReference } from "relay-runtime"; +import { Environment, Network, RecordSource, Store, ConnectionHandler } from "relay-runtime"; import { graphql, diff --git a/types/react-resizable/index.d.ts b/types/react-resizable/index.d.ts new file mode 100644 index 0000000000..5684c1f55d --- /dev/null +++ b/types/react-resizable/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for react-resizable 1.7 +// Project: https://github.com/STRML/react-resizable +// Definitions by: Harry Brrundage +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +export type Axis = "both" | "x" | "y" | "none"; + +export interface ResizableState { + resizing: boolean; + width: number; + height: number; + slackW: number; + slackH: number; +} + +export interface DragCallbackData { + node: HTMLElement; + x: number; + y: number; + deltaX: number; + deltaY: number; + lastX: number; + lastY: number; +} + +export interface ResizeCallbackData { + node: HTMLElement; + size: { width: number; height: number }; +} + +export interface ResizableProps { + className?: string; + width: number; + height: number; + handleSize?: [number, number]; + lockAspectRatio?: boolean; + axis?: Axis; + minConstraints?: [number, number]; + maxConstraints?: [number, number]; + onResizeStop?: (e: React.SyntheticEvent, data: ResizeCallbackData) => any; + onResizeStart?: (e: React.SyntheticEvent, data: ResizeCallbackData) => any; + onResize?: (e: React.SyntheticEvent, data: ResizeCallbackData) => any; + draggableOpts?: any; +} + +export class Resizable extends React.Component< + ResizableProps, + ResizableState +> {} + +export interface ResizableBoxState { + height: number; + width: number; +} + +export type ResizableBoxProps = ResizableProps; + +export class ResizableBox extends React.Component< + ResizableBoxProps, + ResizableBoxState +> {} diff --git a/types/react-resizable/react-resizable-tests.tsx b/types/react-resizable/react-resizable-tests.tsx new file mode 100644 index 0000000000..1ecbd7574d --- /dev/null +++ b/types/react-resizable/react-resizable-tests.tsx @@ -0,0 +1,49 @@ +import * as React from "react"; +import { Resizable, ResizableBox, ResizeCallbackData } from "react-resizable"; + +const resizeCallback = ( + event: React.SyntheticEvent, + data: ResizeCallbackData +) => { + console.log(data.size.height); + console.log(data.node); +}; + +class TestResizableComponent extends React.Component { + render() { + return ( + +
    {this.props.children}
    +
    + ); + } +} + +class TestResizableBoxComponent extends React.Component { + render() { + return ( + +
    {this.props.children}
    +
    + ); + } +} diff --git a/types/react-resizable/tsconfig.json b/types/react-resizable/tsconfig.json new file mode 100644 index 0000000000..d1125b7758 --- /dev/null +++ b/types/react-resizable/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "jsx": "react", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-resizable-tests.tsx"] +} diff --git a/types/react-resizable/tslint.json b/types/react-resizable/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-resizable/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-resize-detector/index.d.ts b/types/react-resize-detector/index.d.ts index 68f0382dba..25e06d7bb8 100755 --- a/types/react-resize-detector/index.d.ts +++ b/types/react-resize-detector/index.d.ts @@ -29,7 +29,7 @@ interface ReactResizeDetectorProps extends React.Props { declare class ReactResizeDetector extends React.PureComponent { } -export declare function withResizeDetector( +export function withResizeDetector( WrappedComponent: React.ReactNode, props?: ReactResizeDetectorProps ): React.Component; diff --git a/types/react-select/lib/components/Option.d.ts b/types/react-select/lib/components/Option.d.ts index 1075e6d069..d7d20ec325 100644 --- a/types/react-select/lib/components/Option.d.ts +++ b/types/react-select/lib/components/Option.d.ts @@ -4,9 +4,9 @@ import { colors, spacing } from '../theme'; import { CommonProps, PropsWithStyles, InnerRef } from '../types'; interface State { - /** Wether the option is disabled. */ + /** Whether the option is disabled. */ isDisabled: boolean; - /** Wether the option is focused. */ + /** Whether the option is focused. */ isFocused: boolean; /** Whether the option is selected. */ isSelected: boolean; diff --git a/types/react/index.d.ts b/types/react/index.d.ts index bc9c4ce342..2a046f91b8 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -422,7 +422,7 @@ declare namespace React { // always pass children as variadic arguments to `createElement`. // In the future, if we can define its call signature conditionally // on the existence of `children` in `P`, then we should remove this. - readonly props: Readonly<{ children?: ReactNode }> & Readonly

    ; + readonly props: Readonly>; state: Readonly; /** * @deprecated @@ -468,7 +468,7 @@ declare namespace React { type FC

    = FunctionComponent

    ; interface FunctionComponent

    { - (props: P & { children?: ReactNode }, context?: any): ReactElement | null; + (props: PropsWithChildren

    , context?: any): ReactElement | null; propTypes?: WeakValidationMap

    ; contextTypes?: ValidationMap; defaultProps?: Partial

    ; @@ -476,7 +476,7 @@ declare namespace React { } interface RefForwardingComponent { - (props: P & { children?: ReactNode }, ref: Ref): ReactElement | null; + (props: PropsWithChildren

    , ref: Ref): ReactElement | null; propTypes?: WeakValidationMap

    ; contextTypes?: ValidationMap; defaultProps?: Partial

    ; @@ -722,6 +722,8 @@ declare namespace React { : P : P; + type PropsWithChildren

    = P & { children?: ReactNode }; + /** * NOTE: prefer ComponentPropsWithRef, if the ref is forwarded, * or ComponentPropsWithoutRef when refs are not supported. @@ -747,7 +749,7 @@ declare namespace React { function memo

    ( Component: SFC

    , - propsAreEqual?: (prevProps: Readonly

    , nextProps: Readonly

    ) => boolean + propsAreEqual?: (prevProps: Readonly>, nextProps: Readonly>) => boolean ): NamedExoticComponent

    ; function memo>( Component: T, @@ -807,6 +809,14 @@ declare namespace React { * @see https://reactjs.org/docs/hooks-reference.html#usestate */ function useState(initialState: S | (() => S)): [S, Dispatch>]; + // convenience overload when first argument is ommitted + /** + * Returns a stateful value, and a function to update it. + * + * @version 16.8.0 + * @see https://reactjs.org/docs/hooks-reference.html#usestate + */ + function useState(): [S | undefined, Dispatch>]; /** * An alternative to `useState`. * @@ -894,6 +904,20 @@ declare namespace React { */ // TODO (TypeScript 3.0): function useRef(initialValue: T|null): RefObject; + // convenience overload for potentially undefined initialValue / call with 0 arguments + // has a default to stop it from defaulting to {} instead + /** + * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument + * (`initialValue`). The returned object will persist for the full lifetime of the component. + * + * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable + * value around similar to how you’d use instance fields in classes. + * + * @version 16.8.0 + * @see https://reactjs.org/docs/hooks-reference.html#useref + */ + // TODO (TypeScript 3.0): + function useRef(): MutableRefObject; /** * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations. * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside @@ -958,7 +982,8 @@ declare namespace React { * @version 16.8.0 * @see https://reactjs.org/docs/hooks-reference.html#usememo */ - function useMemo(factory: () => T, deps: DependencyList): T; + // allow undefined, but don't make it optional as that is very likely a mistake + function useMemo(factory: () => T, deps: DependencyList | undefined): T; /** * `useDebugValue` can be used to display a label for custom hooks in React DevTools. * diff --git a/types/react/test/hooks.tsx b/types/react/test/hooks.tsx index 26ff634e89..70ea9a0ce7 100644 --- a/types/react/test/hooks.tsx +++ b/types/react/test/hooks.tsx @@ -100,9 +100,46 @@ function useEveryHook(ref: React.Ref<{ id: number }>|undefined): () => boolean { // inline object, to (manually) check if autocomplete works React.useReducer(reducer, { age: 42, name: 'The Answer' }); - // make sure this is not going to the |null overload - // $ExpectType MutableRefObject - const didLayout = React.useRef(false); + // test useRef and its convenience overloads + // $ExpectType MutableRefObject + React.useRef(0); + + // these are not very useful (can't assign anything else to .current) + // but it's the only safe way to resolve them + // $ExpectType MutableRefObject + React.useRef(null); + // $ExpectType MutableRefObject + React.useRef(undefined); + + // |null convenience overload + // it should _not_ be mutable if the generic argument doesn't include null + // $ExpectType RefObject + React.useRef(null); + // but it should be mutable if it does (i.e. is not the convenience overload) + // $ExpectType MutableRefObject + React.useRef(null); + + // |undefined convenience overload + // with no contextual type or generic argument it should default to undefined only (not {} or unknown!) + // $ExpectType MutableRefObject + React.useRef(); + // $ExpectType MutableRefObject + React.useRef(); + // don't just accept a potential undefined if there is a generic argument + // $ExpectError + React.useRef(undefined); + // make sure once again there's no |undefined if the initial value doesn't either + // $ExpectType MutableRefObject + React.useRef(1); + // and also that it is not getting erased if the parameter is wider + // $ExpectType MutableRefObject + React.useRef(1); + + // should be contextually typed + const a: React.MutableRefObject = React.useRef(undefined); + const b: React.MutableRefObject = React.useRef(); + const c: React.MutableRefObject = React.useRef(null); + const d: React.RefObject = React.useRef(null); const id = React.useMemo(() => Math.random(), []); React.useImperativeHandle(ref, () => ({ id }), [id]); @@ -110,6 +147,10 @@ function useEveryHook(ref: React.Ref<{ id: number }>|undefined): () => boolean { // $ExpectError React.useImperativeMethods(ref, () => ({}), [id]); + // make sure again this is not going to the |null convenience overload + // $ExpectType MutableRefObject + const didLayout = React.useRef(false); + React.useLayoutEffect(() => { setState(1); setState(prevState => prevState - 1); @@ -140,6 +181,29 @@ function useEveryHook(ref: React.Ref<{ id: number }>|undefined): () => boolean { React.useDebugValue(id, value => value.toFixed()); React.useDebugValue(id); + // allow passing an explicit undefined + React.useMemo(() => {}, undefined); + // but don't allow it to be missing + // $ExpectError + React.useMemo(() => {}); + + // useState convenience overload + // default to undefined only (not that useful, but type-safe -- no {} or unknown!) + // $ExpectType undefined + React.useState()[0]; + // $ExpectType number | undefined + React.useState()[0]; + // default overload + // $ExpectType number + React.useState(0)[0]; + // $ExpectType undefined + React.useState(undefined)[0]; + // make sure the generic argument does reject actual potentially undefined inputs + // $ExpectError + React.useState(undefined)[0]; + + // useReducer convenience overload + return React.useCallback(() => didLayout.current, []); } diff --git a/types/react/test/index.ts b/types/react/test/index.ts index d4fee49d30..7f8b13a437 100644 --- a/types/react/test/index.ts +++ b/types/react/test/index.ts @@ -803,3 +803,9 @@ const sfc: React.SFC = Memoized2; // this $ExpectError is failing on TypeScript@next // // $ExpectError Property '$$typeof' is missing in type // const specialSfc2: React.SpecialSFC = props => null; + +const propsWithChildren: React.PropsWithChildren = { + hello: "world", + foo: 42, + children: functionComponent, +}; diff --git a/types/rebass/index.d.ts b/types/rebass/index.d.ts index af656e8621..7682bbc68c 100644 --- a/types/rebass/index.d.ts +++ b/types/rebass/index.d.ts @@ -4,99 +4,111 @@ // ryee-dev // jamesmckenzie // sara f-p +// angusfretwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import * as React from "react"; +import * as StyledComponents from "styled-components"; +import * as StyledSystem from "styled-system"; -export interface BaseProps extends React.ClassAttributes { - className?: string; - as?: any; +export {}; + +type Omit = Pick>; + +export interface BaseProps extends React.Props { + as?: React.ReactType; + css?: StyledComponents.CSSObject; } -export interface SpaceProps extends BaseProps { - m?: number | string | ReadonlyArray; - mt?: number | string | ReadonlyArray; - mr?: number | string | ReadonlyArray; - mb?: number | string | ReadonlyArray; - ml?: number | string | ReadonlyArray; - mx?: number | string | ReadonlyArray; - my?: number | string | ReadonlyArray; - p?: number | string | ReadonlyArray; - pt?: number | string | ReadonlyArray; - pr?: number | string | ReadonlyArray; - pb?: number | string | ReadonlyArray; - pl?: number | string | ReadonlyArray; - px?: number | string | ReadonlyArray; - py?: number | string | ReadonlyArray; -} +interface BoxKnownProps + extends BaseProps, + StyledSystem.SpaceProps, + StyledSystem.WidthProps, + StyledSystem.FontSizeProps, + StyledSystem.ColorProps, + StyledSystem.FlexProps, + StyledSystem.OrderProps, + StyledSystem.AlignSelfProps {} +export interface BoxProps + extends BoxKnownProps, + Omit, keyof BoxKnownProps> {} +export const Box: React.FunctionComponent; -export interface BoxProps extends SpaceProps { - className?: string; - width?: number | string | ReadonlyArray; - fontSize?: number | ReadonlyArray; - css?: object; - color?: string; - bg?: string; -} -// tslint:disable-next-line:strict-export-declare-modifiers -type BoxClass = React.FunctionComponent; -export const Box: BoxClass; - -export interface ButtonProps extends BoxProps { - fontWeight?: string; - border?: number | string; - borderColor?: string; - borderRadius?: number | string; - variant?: string; -} +interface ButtonKnownProps + extends BoxKnownProps, + StyledSystem.FontWeightProps, + StyledSystem.BorderProps, + StyledSystem.BordersProps, + StyledSystem.BorderColorProps, + StyledSystem.BorderRadiusProps, + StyledSystem.ButtonStyleProps {} +export interface ButtonProps + extends ButtonKnownProps, + Omit, keyof ButtonKnownProps> {} export const Button: React.FunctionComponent; -export interface CardProps extends BoxProps { - border?: number | string; - borderColor?: string; - borderRadius?: number | string; - boxShadow?: string; - backgroundImage?: string; - backgroundSize?: string; - backgroundPosition?: string; - backgroundRepeat?: string; - opacity?: number; - variant?: string; +interface CardKnownProps + extends BoxKnownProps, + StyledSystem.BorderProps, + StyledSystem.BordersProps, + StyledSystem.BorderColorProps, + StyledSystem.BorderRadiusProps, + StyledSystem.BoxShadowProps, + StyledSystem.BackgroundImageProps, + StyledSystem.BackgroundSizeProps, + StyledSystem.BackgroundPositionProps, + StyledSystem.BackgroundRepeatProps, + StyledSystem.OpacityProps { + variant?: StyledSystem.ResponsiveValue; } +export interface CardProps + extends CardKnownProps, + Omit, keyof CardKnownProps> {} export const Card: React.FunctionComponent; -export interface FlexProps extends BoxProps { - alignItems?: string; - justifyContent?: string; - flexDirection?: string; - flexWrap?: string; -} +interface FlexKnownProps + extends BoxKnownProps, + StyledSystem.FlexWrapProps, + StyledSystem.FlexDirectionProps, + StyledSystem.AlignItemsProps, + StyledSystem.JustifyContentProps {} +export interface FlexProps + extends FlexKnownProps, + Omit, keyof FlexKnownProps> {} export const Flex: React.FunctionComponent; -export interface ImageProps extends BoxProps { - height?: number | string; - borderRadius?: number | string; - src?: string; - alt?: string; -} +interface ImageKnownProps + extends BoxKnownProps, + StyledSystem.HeightProps, + StyledSystem.BorderRadiusProps {} +export interface ImageProps + extends ImageKnownProps, + Omit, keyof ImageKnownProps> {} export const Image: React.FunctionComponent; -export interface LinkProps extends BoxProps { - href?: string; -} +// tslint:disable-next-line no-empty-interface +interface LinkKnownProps extends BoxKnownProps {} +export interface LinkProps + extends LinkKnownProps, + Omit, keyof LinkKnownProps> {} export const Link: React.FunctionComponent; -export interface TextProps extends BoxProps { - fontSize?: number | ReadonlyArray; - fontWeight?: string; - color?: string; - fontFamily?: string; - textAlign?: string; - lineHeight?: number | string; - letterSpacing?: number | string; -} +interface TextKnownProps + extends BoxKnownProps, + StyledSystem.FontFamilyProps, + StyledSystem.FontWeightProps, + StyledSystem.TextAlignProps, + StyledSystem.LineHeightProps, + StyledSystem.LetterSpacingProps {} +export interface TextProps + extends TextKnownProps, + Omit, keyof TextKnownProps> {} export const Text: React.FunctionComponent; -export type HeadingProps = TextProps; +// tslint:disable-next-line no-empty-interface +interface HeadingKnownProps extends TextKnownProps {} +export interface HeadingProps + extends HeadingKnownProps, + Omit, keyof HeadingKnownProps> {} export const Heading: React.FunctionComponent; diff --git a/types/rebass/rebass-tests.tsx b/types/rebass/rebass-tests.tsx index 53735775ff..87df64f323 100644 --- a/types/rebass/rebass-tests.tsx +++ b/types/rebass/rebass-tests.tsx @@ -1,13 +1,26 @@ -import * as React from 'react'; -import { Box, Flex, Text, Heading, Button, Link, Image, Card } from 'rebass'; +import * as React from "react"; +import styled from "styled-components"; +import { Box, Flex, Text, Heading, Button, Link, Image, Card } from "rebass"; + +const CustomComponent: React.FunctionComponent = ({ children }) => { + return

    {children}
    ; +}; + +const ExtendedBox = styled(Box)` + color: red; +`; + +ExtendedBox.defaultProps = { + p: 3 +}; () => ( - + Hi, I'm a heading. - + Hi, I'm text. - Link + + Link + + + CustomComponent + + ExtendedBox ); diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 963f68600c..44f97c933b 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -30,7 +30,7 @@ export type TooltipFormatter = (value: string | number | Array, entry: TooltipPayload, index: number) => React.ReactNode; export type ItemSorter = (a: T, b: T) => number; export type ContentRenderer

    = (props: P) => React.ReactNode; -export type DataKey = string | number | ((dataObject: any) => number | [number, number] | null); +export type DataKey = string | number | ((dataObject: any) => string | number | [number, number] | null); export type IconType = 'plainline' | 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'plainline'; export type LegendType = IconType | 'none'; @@ -201,6 +201,7 @@ export interface BarProps extends EventAttributes, Partial { } + label={(props: {name: string}) => } dataKey="value" activeIndex={this.state.activeIndex} activeShape={renderActiveShape} @@ -204,7 +204,7 @@ class Component extends React.Component<{}, ComponentState> { - + diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index 540e1128dd..c2a0b22d73 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -46,7 +46,7 @@ declare module 'recompose' { export interface InferableComponentEnhancerWithProps {

    ( component: Component

    - ): React.ComponentType & TNeedsProps> + ): React.ComponentClass & TNeedsProps> } // Injects props and removes them from the prop requirements. @@ -283,7 +283,7 @@ declare module 'recompose' { // setStatic: https://github.com/acdlite/recompose/blob/master/docs/API.md#setStatic export function setStatic( key: string, value: any - ): (component: T) => T; + ): >(component: T) => T; // setPropTypes: https://github.com/acdlite/recompose/blob/master/docs/API.md#setPropTypes export function setPropTypes

    ( @@ -293,7 +293,7 @@ declare module 'recompose' { // setDisplayName: https://github.com/acdlite/recompose/blob/master/docs/API.md#setDisplayName export function setDisplayName( displayName: string - ): (component: T) => T; + ): >(component: T) => T; // Utilities: https://github.com/acdlite/recompose/blob/master/docs/API.md#utilities diff --git a/types/reduce-reducers/index.d.ts b/types/reduce-reducers/index.d.ts index 9f787df032..89f98aa2b3 100644 --- a/types/reduce-reducers/index.d.ts +++ b/types/reduce-reducers/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for reduce-reducers 0.2 +// Type definitions for reduce-reducers 0.3 // Project: https://github.com/redux-utilities/reduce-reducers // Definitions by: Huy Nguyen // Dalius Dobravolskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { Reducer } from 'redux'; export default function reduceReducer(r0: Reducer, s: S | null): Reducer; diff --git a/types/reduce-reducers/package.json b/types/reduce-reducers/package.json index 6d68bf2f9b..7f5b19d45b 100644 --- a/types/reduce-reducers/package.json +++ b/types/reduce-reducers/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^4.0.0" } } diff --git a/types/reduce-reducers/reduce-reducers-tests.ts b/types/reduce-reducers/reduce-reducers-tests.ts index f4fdd8fff3..6d14449814 100644 --- a/types/reduce-reducers/reduce-reducers-tests.ts +++ b/types/reduce-reducers/reduce-reducers-tests.ts @@ -8,8 +8,8 @@ interface TestStore { a: number; b: string; } -const firstReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const secondReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a; +const firstReducer: Reducer = (store, action) => ({a: 0, b: ''}); +const secondReducer: Reducer = (store, action) => ({a: 0, b: ''}); const finalReducer: (state: TestStore, action: Action) => TestStore = reduceReducers(firstReducer, secondReducer); const finalReducerWithState: (state: TestStore, action: Action) => TestStore = reduceReducers(firstReducer, secondReducer, null); @@ -23,14 +23,14 @@ const finalReducerWithInitialState: (state: TestStore, action: Action) => TestSt secondReducer, initialState); -const reducer02: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer03: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer04: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer05: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer06: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer07: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer08: (state: TestStore, action: Action) => TestStore = (a, b) => a; -const reducer09: (state: TestStore, action: Action) => TestStore = (a, b) => a; +const reducer02: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer03: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer04: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer05: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer06: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer07: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer08: Reducer = (store, action) => ({a: 0, b: ''}); +const reducer09: Reducer = (store, action) => ({a: 0, b: ''}); const finalReducerWithInitialState02: (state: TestStore, action: Action) => TestStore = reduceReducers( firstReducer, diff --git a/types/redux-form/lib/Field.d.ts b/types/redux-form/lib/Field.d.ts index 87a8947717..194a322408 100644 --- a/types/redux-form/lib/Field.d.ts +++ b/types/redux-form/lib/Field.d.ts @@ -61,7 +61,7 @@ export type GenericFieldHTMLAttributes = SelectHTMLAttributes | TextareaHTMLAttributes; -export class Field

    extends Component & P> { +export class Field

    extends Component

    { dirty: boolean; name: string; pristine: boolean; diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index 56d782eda7..8ad71bbc42 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -290,6 +290,12 @@ const Test = reduxForm({ component="select" /> + + any): void; } diff --git a/types/relay-runtime/index.d.ts b/types/relay-runtime/index.d.ts index 12dbf31152..d5ce247a49 100644 --- a/types/relay-runtime/index.d.ts +++ b/types/relay-runtime/index.d.ts @@ -42,47 +42,14 @@ export type RelayContainer = any; // ~~~~~~~~~~~~~~~~~~~~~ // File: https://github.com/facebook/relay/blob/fe0e70f10bbcba1fff89911313ea69f24569464b/packages/relay-runtime/util/RelayConcreteNode.js -export interface ConcreteFragment { - kind: string; - name: string; - type: string; - metadata: {[key: string]: any} | null; - argumentDefinitions: any[]; - selections: any[]; -} -export interface ConcreteRequest { - kind: string; - operationKind: string; - name: string; - id: string | null; - text: string | null; - metadata: {[key: string]: any}; - fragment: ConcreteFragment; - operation: any; -} -export interface ConcreteBatchRequest { - kind: string; - operationKind: string; - name: string; - metadata: {[key: string]: any}; - fragment: ConcreteFragment; - requests: Array<{ - name: string; - id: string | null; - text: string | null; - argumentDependencies: any[] | null; - operation: any; - }>; -} +export type ConcreteFragment = any; +export type ConcreteRequest = any; +export type ConcreteBatchRequest = any; export function getRequest(taggedNode: GraphQLTaggedNode): ConcreteRequest; export type RequestNode = ConcreteRequest | ConcreteBatchRequest; -// Using `enum` here to create a distinct type and `const` to ensure it doesn’t leave any generated code. -// tslint:disable-next-line:no-const-enum -export const enum FragmentReference {} - export interface OperationBase { variables: object; response: object; diff --git a/types/rmc-drawer/package.json b/types/rmc-drawer/package.json new file mode 100644 index 0000000000..f06689a6b9 --- /dev/null +++ b/types/rmc-drawer/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "moment": "^2.19.4" + } +} diff --git a/types/sarif/index.d.ts b/types/sarif/index.d.ts index cc5a9899b5..56bcf3e8da 100644 --- a/types/sarif/index.d.ts +++ b/types/sarif/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.4 /** - * Static Analysis Results Format (SARIF) Version 2.0.0-csd.2.beta-2019-01-09 JSON Schema: a standard format for the + * Static Analysis Results Format (SARIF) Version 2.0.0-csd.2.beta-2019-01-24 JSON Schema: a standard format for the * output of static analysis tools. */ export interface Log { @@ -32,23 +32,174 @@ export interface Log { export namespace Log { type version = - "2.0.0-csd.2.beta.2019-01-09"; + "2.0.0-csd.2.beta.2019-01-24"; } /** - * A file relevant to a tool invocation or to a result. + * A single artifact. In some cases, this artifact might be nested within another artifact. + */ +export interface Artifact { + /** + * The contents of the artifact. + */ + contents?: ArtifactContent; + + /** + * Specifies the encoding for an artifact object that refers to a text file. + */ + encoding?: string; + + /** + * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of + * the artifact produced by the specified hash function. + */ + hashes?: { [key: string]: string }; + + /** + * The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See + * "Date/time properties" in the SARIF spec for the required format. + */ + lastModifiedTimeUtc?: string; + + /** + * The length of the artifact in bytes. + */ + length?: number; + + /** + * The location of the artifact. + */ + location?: ArtifactLocation; + + /** + * The MIME type (RFC 2045) of the artifact. + */ + mimeType?: string; + + /** + * The offset in bytes of the artifact within its containing artifact. + */ + offset?: number; + + /** + * Identifies the index of the immediate parent of the artifact, if this artifact is nested. + */ + parentIndex?: number; + + /** + * The role or roles played by the artifact in the analysis. + */ + roles?: Artifact.roles[]; + + /** + * Specifies the source language for any artifact object that refers to a text file that contains source code. + */ + sourceLanguage?: string; + + /** + * Key/value pairs that provide additional information about the artifact. + */ + properties?: PropertyBag; +} + +export namespace Artifact { + type roles = + "analysisTarget" | + "toolComponent" | + "attachment" | + "responseFile" | + "resultFile" | + "standardStream" | + "traceFile" | + "unmodifiedFile" | + "modifiedFile" | + "addedFile" | + "deletedFile" | + "renamedFile" | + "uncontrolledFile"; +} + +/** + * A change to a single artifact. + */ +export interface ArtifactChange { + /** + * The location of the artifact to change. + */ + artifactLocation: ArtifactLocation; + + /** + * An array of replacement objects, each of which represents the replacement of a single region in a single + * artifact specified by 'artifactLocation'. + */ + replacements: Replacement[]; + + /** + * Key/value pairs that provide additional information about the change. + */ + properties?: PropertyBag; +} + +/** + * Represents the contents of an artifact. + */ +export interface ArtifactContent { + /** + * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. + */ + binary?: string; + + /** + * UTF-8-encoded content from a text artifact. + */ + text?: string; + + /** + * Key/value pairs that provide additional information about the artifact content. + */ + properties?: PropertyBag; +} + +/** + * Specifies the location of an artifact. + */ +export interface ArtifactLocation { + /** + * The index within the run artifacts array of the artifact object associated with the artifact location. + */ + index?: number; + + /** + * A string containing a valid relative or absolute URI. + */ + uri: string; + + /** + * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property + * is interpreted. + */ + uriBaseId?: string; + + /** + * Key/value pairs that provide additional information about the artifact location. + */ + properties?: PropertyBag; +} + +/** + * An artifact relevant to a tool invocation or to a result. */ export interface Attachment { + /** + * The location of the attachment. + */ + artifactLocation: ArtifactLocation; + /** * A message describing the role played by the attachment. */ description?: Message; - /** - * The location of the attachment. - */ - fileLocation: FileLocation; - /** * An array of rectangles specifying areas of interest within the image. */ @@ -75,8 +226,8 @@ export interface CodeFlow { message?: Message; /** - * An array of one or more unique threadFlow objects, each of which describes the progress of a program through - * a thread of execution. + * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a + * thread of execution. */ threadFlows: ThreadFlow[]; @@ -94,7 +245,7 @@ export interface Conversion { /** * The locations of the analysis tool's per-run log files. */ - analysisToolLogFiles?: FileLocation[]; + analysisToolLogFiles?: ArtifactLocation[]; /** * An invocation object that describes the invocation of the converter. @@ -182,8 +333,8 @@ export interface Exception { innerExceptions?: Exception[]; /** - * A string that identifies the kind of exception, for example, the fully qualified type name of an object that - * was thrown, or the symbolic name of a signal. + * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was + * thrown, or the symbolic name of a signal. */ kind?: string; @@ -210,7 +361,7 @@ export interface ExternalPropertyFile { /** * The location of the external property file. */ - fileLocation?: FileLocation; + artifactLocation?: ArtifactLocation; /** * A stable, unique identifer for the external property file in the form of a GUID. @@ -232,15 +383,20 @@ export interface ExternalPropertyFile { * References to external property files that should be inlined with the content of a root log file. */ export interface ExternalPropertyFiles { + /** + * An array of external property files containing run.artifacts arrays to be merged with the root log file. + */ + artifacts?: ExternalPropertyFile[]; + /** * An external property file containing a run.conversion object to be merged with the root log file. */ conversion?: ExternalPropertyFile; /** - * An array of external property files containing run.files arrays to be merged with the root log file. + * An external property file containing a run.properties object to be merged with the root log file. */ - files?: ExternalPropertyFile[]; + externalizedProperties?: ExternalPropertyFile; /** * An external property file containing a run.graphs object to be merged with the root log file. @@ -257,187 +413,32 @@ export interface ExternalPropertyFiles { */ logicalLocations?: ExternalPropertyFile[]; - /** - * An external property file containing a run.resources object to be merged with the root log file. - */ - resources?: ExternalPropertyFile; - /** * An array of external property files containing run.results arrays to be merged with the root log file. */ results?: ExternalPropertyFile[]; /** - * An external property file containing a run.properties object to be merged with the root log file. + * An external property file containing a run.tool object to be merged with the root log file. */ - properties?: ExternalPropertyFile; + tool?: ExternalPropertyFile; } /** - * A single file. In some cases, this file might be nested within another file. - */ -export interface File { - /** - * The contents of the file. - */ - contents?: FileContent; - - /** - * Specifies the encoding for a file object that refers to a text file. - */ - encoding?: string; - - /** - * The location of the file. - */ - fileLocation?: FileLocation; - - /** - * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value - * of the file produced by the specified hash function. - */ - hashes?: { [key: string]: string }; - - /** - * The Coordinated Universal Time (UTC) date and time at which the file was most recently modified. See - * "Date/time properties" in the SARIF spec for the required format. - */ - lastModifiedTimeUtc?: string; - - /** - * The length of the file in bytes. - */ - length?: number; - - /** - * The MIME type (RFC 2045) of the file. - */ - mimeType?: string; - - /** - * The offset in bytes of the file within its containing file. - */ - offset?: number; - - /** - * Identifies the index of the immediate parent of the file, if this file is nested. - */ - parentIndex?: number; - - /** - * The role or roles played by the file in the analysis. - */ - roles?: File.roles[]; - - /** - * Specifies the source language for any file object that refers to a text file that contains source code. - */ - sourceLanguage?: string; - - /** - * Key/value pairs that provide additional information about the file. - */ - properties?: PropertyBag; -} - -export namespace File { - type roles = - "analysisTarget" | - "attachment" | - "responseFile" | - "resultFile" | - "standardStream" | - "traceFile" | - "unmodifiedFile" | - "modifiedFile" | - "addedFile" | - "deletedFile" | - "renamedFile" | - "uncontrolledFile"; -} - -/** - * A change to a single file. - */ -export interface FileChange { - /** - * The location of the file to change. - */ - fileLocation: FileLocation; - - /** - * An array of replacement objects, each of which represents the replacement of a single region in a single file - * specified by 'fileLocation'. - */ - replacements: Replacement[]; - - /** - * Key/value pairs that provide additional information about the file change. - */ - properties?: PropertyBag; -} - -/** - * Represents content from an external file. - */ -export interface FileContent { - /** - * MIME Base64-encoded content from a binary file, or from a text file in its original encoding. - */ - binary?: string; - - /** - * UTF-8-encoded content from a text file. - */ - text?: string; - - /** - * Key/value pairs that provide additional information about the external file. - */ - properties?: PropertyBag; -} - -/** - * Specifies the location of a file. - */ -export interface FileLocation { - /** - * The index within the run files array of the file object associated with the file location. - */ - fileIndex?: number; - - /** - * A string containing a valid relative or absolute URI. - */ - uri: string; - - /** - * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" - * property is interpreted. - */ - uriBaseId?: string; - - /** - * Key/value pairs that provide additional information about the file location. - */ - properties?: PropertyBag; -} - -/** - * A proposed fix for the problem represented by a result object. A fix specifies a set of file to modify. For each - * file, it specifies a set of bytes to remove, and provides a set of new bytes to replace them. + * A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For + * each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them. */ export interface Fix { + /** + * One or more artifact changes that comprise a fix for a result. + */ + changes: ArtifactChange[]; + /** * A message that describes the proposed fix, enabling viewers to present the proposed change to an end user. */ description?: Message; - /** - * One or more file changes that comprise a fix for a result. - */ - fileChanges: FileChange[]; - /** * Key/value pairs that provide additional information about the fix. */ @@ -445,8 +446,8 @@ export interface Fix { } /** - * A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a - * call graph). + * A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call + * graph). */ export interface Graph { /** @@ -521,7 +522,7 @@ export interface Invocation { arguments?: string[]; /** - * A set of files relevant to the invocation of the tool. + * A set of artifacts relevant to the invocation of the tool. */ attachments?: Attachment[]; @@ -549,7 +550,7 @@ export interface Invocation { /** * An absolute URI specifying the location of the analysis tool's executable. */ - executableLocation?: FileLocation; + executableLocation?: ArtifactLocation; /** * The process exit code. @@ -587,36 +588,40 @@ export interface Invocation { processStartFailureMessage?: string; /** - * The locations of any response files specified on the tool's command line. + * An array of reportingConfigurationOverride objects that describe runtime reporting behavior. */ - responseFiles?: FileLocation[]; + reportingConfigurationOverrides?: ReportingConfigurationOverride[]; /** - * The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in - * the SARIF spec for the required format. + * The locations of any response files specified on the tool's command line. + */ + responseFiles?: ArtifactLocation[]; + + /** + * The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in the + * SARIF spec for the required format. */ startTimeUtc?: string; /** * A file containing the standard error stream from the process that was invoked. */ - stderr?: FileLocation; + stderr?: ArtifactLocation; /** * A file containing the standard input stream to the process that was invoked. */ - stdin?: FileLocation; + stdin?: ArtifactLocation; /** * A file containing the standard output stream from the process that was invoked. */ - stdout?: FileLocation; + stdout?: ArtifactLocation; /** - * A file containing the interleaved standard output and standard error stream from the process that was - * invoked. + * A file containing the interleaved standard output and standard error stream from the process that was invoked. */ - stdoutStderr?: FileLocation; + stdoutStderr?: ArtifactLocation; /** * A value indicating whether the tool's execution completed successfully. @@ -631,7 +636,7 @@ export interface Invocation { /** * The working directory for the analysis tool run. */ - workingDirectory?: FileLocation; + workingDirectory?: ArtifactLocation; /** * Key/value pairs that provide additional information about the invocation. @@ -649,9 +654,9 @@ export interface Location { annotations?: Region[]; /** - * The human-readable fully qualified name of the logical location. If run.logicalLocations is present, this - * value matches a property name within that object, from which further information about the logical location - * can be obtained. + * The human-readable fully qualified name of the logical location. If run.logicalLocations is present, this value + * matches a property name within that object, from which further information about the logical location can be + * obtained. */ fullyQualifiedLogicalName?: string; @@ -666,7 +671,7 @@ export interface Location { message?: Message; /** - * Identifies the file and region. + * Identifies the artifact and region. */ physicalLocation?: PhysicalLocation; @@ -681,8 +686,8 @@ export interface Location { */ export interface LogicalLocation { /** - * The machine-readable name for the logical location, such as a mangled function name provided by a C++ - * compiler that encodes calling convention, return type and other details along with the function name. + * The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler + * that encodes calling convention, return type and other details along with the function name. */ decoratedName?: string; @@ -693,8 +698,8 @@ export interface LogicalLocation { /** * The type of construct this logical location component refers to. Should be one of 'function', 'member', - * 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', or 'variable', if any of those - * accurately describe the construct. + * 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', or 'variable', if any of those accurately + * describe the construct. */ kind?: string; @@ -726,20 +731,15 @@ export interface Message { arguments?: string[]; /** - * The resource id for a plain text message string. + * A Markdown message string. + */ + markdown?: string; + + /** + * The resource id for a plain text or Markdown message string. */ messageId?: string; - /** - * The resource id for a rich text message string. - */ - richMessageId?: string; - - /** - * A rich text message string. - */ - richText?: string; - /** * A plain text message string. */ @@ -751,6 +751,26 @@ export interface Message { properties?: PropertyBag; } +/** + * A message string or message format string rendered in multiple formats. + */ +export interface MultiformatMessageString { + /** + * A Markdown message string or format string. + */ + markdown?: string; + + /** + * A plain text message string or format string. + */ + text?: string; + + /** + * Key/value pairs that provide additional information about the message. + */ + properties?: PropertyBag; +} + /** * Represents a node in a graph. */ @@ -807,7 +827,7 @@ export interface Notification { message: Message; /** - * The file and region relevant to this notification. + * The artifact and region relevant to this notification. */ physicalLocation?: PhysicalLocation; @@ -839,34 +859,35 @@ export interface Notification { export namespace Notification { type level = + "none" | "note" | "warning" | "error"; } /** - * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range - * of bytes or characters within that artifact. + * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of + * bytes or characters within that artifact. */ export interface PhysicalLocation { /** - * Specifies a portion of the file that encloses the region. Allows a viewer to display additional context + * The location of the artifact. + */ + artifactLocation: ArtifactLocation; + + /** + * Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context * around the region. */ contextRegion?: Region; - /** - * The location of the file. - */ - fileLocation: FileLocation; - /** * Value that distinguishes this physical location from all other physical locations in this run object. */ id?: number; /** - * Specifies a portion of the file. + * Specifies a portion of the artifact. */ region?: Region; @@ -927,7 +948,7 @@ export interface Rectangle { } /** - * A region within a file where a result was detected. + * A region within an artifact where a result was detected. */ export interface Region { /** @@ -936,7 +957,7 @@ export interface Region { byteLength?: number; /** - * The zero-based offset from the beginning of the file of the first byte in the region. + * The zero-based offset from the beginning of the artifact of the first byte in the region. */ byteOffset?: number; @@ -946,7 +967,7 @@ export interface Region { charLength?: number; /** - * The zero-based offset from the beginning of the file of the first character in the region. + * The zero-based offset from the beginning of the artifact of the first character in the region. */ charOffset?: number; @@ -966,12 +987,12 @@ export interface Region { message?: Message; /** - * The portion of the file contents within the specified region. + * The portion of the artifact contents within the specified region. */ - snippet?: FileContent; + snippet?: ArtifactContent; /** - * Specifies the source language, if any, of the portion of the file specified by the region object. + * Specifies the source language, if any, of the portion of the artifact specified by the region object. */ sourceLanguage?: string; @@ -992,18 +1013,18 @@ export interface Region { } /** - * The replacement of a single region of a file. + * The replacement of a single region of an artifact. */ export interface Replacement { /** - * The region of the file to delete. + * The region of the artifact to delete. */ deletedRegion: Region; /** * The content to insert at the location specified by the 'deletedRegion' property. */ - insertedContent?: FileContent; + insertedContent?: ArtifactContent; /** * Key/value pairs that provide additional information about the replacement. @@ -1012,21 +1033,133 @@ export interface Replacement { } /** - * Container for items that require localization. + * Information about a tool report that can be configured at runtime. */ -export interface Resources { +export interface ReportingConfiguration { /** - * A dictionary, each of whose keys is a resource identifier and each of whose values is a localized string. + * Specifies whether the report may be produced during the scan. */ - messageStrings?: { [key: string]: string }; + enabled?: boolean; /** - * An array of rule objects relevant to the run. + * Specifies the failure level for the report. */ - rules?: Rule[]; + level?: ReportingConfiguration.level; /** - * Key/value pairs that provide additional information about the resources. + * Contains configuration information specific to a report. + */ + parameters?: PropertyBag; + + /** + * Specifies the relative priority of the report. Used for analysis output only. + */ + rank?: number; + + /** + * Key/value pairs that provide additional information about the reporting configuration. + */ + properties?: PropertyBag; +} + +export namespace ReportingConfiguration { + type level = + "none" | + "note" | + "warning" | + "error"; +} + +/** + * Information about how a specific tool report was reconfigured at runtime. + */ +export interface ReportingConfigurationOverride { + /** + * Specifies how the report was configured during the scan. + */ + configuration?: ReportingConfiguration; + + /** + * The index within the run.tool.extensions array of the toolComponent object which describes the plug-in or tool + * extension that produced the report. + */ + extensionIndex?: number; + + /** + * The index within the toolComponent.notificationDescriptors array of the reportingDescriptor associated with this + * override. + */ + notificationIndex?: number; + + /** + * The index within the toolComponent.ruleDescriptors array of the reportingDescriptor associated with this + * override. + */ + ruleIndex?: number; + + /** + * Key/value pairs that provide additional information about the reporting configuration. + */ + properties?: PropertyBag; +} + +/** + * Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime + * reporting. + */ +export interface ReportingDescriptor { + /** + * Default reporting configuration information. + */ + defaultConfiguration?: ReportingConfiguration; + + /** + * An array of stable, opaque identifiers by which this report was known in some previous version of the analysis + * tool. + */ + deprecatedIds?: string[]; + + /** + * A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any + * problem indicated by the result. + */ + fullDescription?: Message; + + /** + * Provides the primary documentation for the report, useful when there is no online documentation. + */ + help?: Message; + + /** + * A URI where the primary documentation for the report can be found. + */ + helpUri?: string; + + /** + * A stable, opaque identifier for the report. + */ + id?: string; + + /** + * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds + * message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can + * be used to construct a message in combination with an arbitrary number of additional string arguments. + */ + messageStrings?: { [key: string]: MultiformatMessageString }; + + /** + * A report identifier that is understandable to an end user. + */ + name?: Message; + + /** + * A concise description of the report. Should be a single sentence that is understandable when visible space is + * limited to a single line of text. + */ + shortDescription?: Message; + + /** + * Key/value pairs that provide additional information about the report. */ properties?: PropertyBag; } @@ -1036,13 +1169,13 @@ export interface Resources { */ export interface Result { /** - * Identifies the file that the analysis tool was instructed to scan. This need not be the same as the file + * Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact * where the result actually occurred. */ - analysisTarget?: FileLocation; + analysisTarget?: ArtifactLocation; /** - * A set of files relevant to the result. + * A set of artifacts relevant to the result. */ attachments?: Attachment[]; @@ -1073,8 +1206,7 @@ export interface Result { fixes?: Fix[]; /** - * A dictionary, each of whose keys is the id of a graph and each of whose values is a 'graph' object with that - * id. + * A dictionary, each of whose keys is the id of a graph and each of whose values is a 'graph' object with that id. */ graphs?: { [key: string]: Graph }; @@ -1093,6 +1225,11 @@ export interface Result { */ instanceGuid?: string; + /** + * A value that categorizes results by evaluation state. + */ + kind?: Result.kind; + /** * A value specifying the severity level of the result. */ @@ -1105,8 +1242,8 @@ export interface Result { locations?: Location[]; /** - * A message that describes the result. The first sentence of the message only will be displayed when visible - * space is limited. + * A message that describes the result. The first sentence of the message only will be displayed when visible space + * is limited. */ message: Message; @@ -1135,6 +1272,12 @@ export interface Result { */ relatedLocations?: Location[]; + /** + * The index within the run.tool.extensions array of the tool component object which describes the plug-in or tool + * extension that produced the result. + */ + ruleExtensionIndex?: number; + /** * The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be * used to retrieve rule metadata from the rules dictionary, if it exists. @@ -1168,13 +1311,19 @@ export interface Result { } export namespace Result { - type level = + type kind = + "none" | "notApplicable" | "pass" | + "fail" | + "review" | + "open"; + + type level = + "none" | "note" | "warning" | - "error" | - "open"; + "error"; type suppressionStates = "suppressedInSource" | @@ -1182,7 +1331,8 @@ export namespace Result { type baselineState = "new" | - "existing" | + "unchanged" | + "updated" | "absent"; } @@ -1191,14 +1341,13 @@ export namespace Result { */ export interface ResultProvenance { /** - * An array of physicalLocation objects which specify the portions of an analysis tool's output that a - * converter transformed into the result. + * An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter + * transformed into the result. */ conversionSources?: PhysicalLocation[]; /** - * A GUID-valued string equal to the id.instanceGuid property of the run in which the result was first - * detected. + * A GUID-valued string equal to the id.instanceGuid property of the run in which the result was first detected. */ firstDetectionRunInstanceGuid?: string; @@ -1233,111 +1382,7 @@ export interface ResultProvenance { } /** - * Describes an analysis rule. - */ -export interface Rule { - /** - * Information about the rule that can be configured at runtime. - */ - configuration?: RuleConfiguration; - - /** - * An array of stable, opaque identifiers by which this rule was known in some previous version of the analysis - * tool. - */ - deprecatedIds?: string[]; - - /** - * A description of the rule. Should, as far as possible, provide details sufficient to enable resolution of any - * problem indicated by the result. - */ - fullDescription?: Message; - - /** - * Provides the primary documentation for the rule, useful when there is no online documentation. - */ - help?: Message; - - /** - * A URI where the primary documentation for the rule can be found. - */ - helpUri?: string; - - /** - * A stable, opaque identifier for the rule. - */ - id?: string; - - /** - * A set of name/value pairs with arbitrary names. The value within each name/value pair consists of plain text - * interspersed with placeholders, which can be used to construct a message in combination with an arbitrary - * number of additional string arguments. - */ - messageStrings?: { [key: string]: string }; - - /** - * A rule identifier that is understandable to an end user. - */ - name?: Message; - - /** - * A set of name/value pairs with arbitrary names. The value within each name/value pair consists of rich text - * interspersed with placeholders, which can be used to construct a message in combination with an arbitrary - * number of additional string arguments. - */ - richMessageStrings?: { [key: string]: string }; - - /** - * A concise description of the rule. Should be a single sentence that is understandable when visible space is - * limited to a single line of text. - */ - shortDescription?: Message; - - /** - * Key/value pairs that provide additional information about the rule. - */ - properties?: PropertyBag; -} - -/** - * Information about a rule that can be configured at runtime. - */ -export interface RuleConfiguration { - /** - * Specifies the default severity level for results generated by this rule. - */ - defaultLevel?: RuleConfiguration.defaultLevel; - - /** - * Specifies the default priority or importance for results generated by this rule. - */ - defaultRank?: number; - - /** - * Specifies whether the rule will be evaluated during the scan. - */ - enabled?: boolean; - - /** - * Contains configuration information specific to this rule. - */ - parameters?: PropertyBag; - - /** - * Key/value pairs that provide additional information about the rule configuration. - */ - properties?: PropertyBag; -} - -export namespace RuleConfiguration { - type defaultLevel = - "note" | - "warning" | - "error"; -} - -/** - * Describes a single run of an analysis tool, and contains the output of that run. + * Describes a single run of an analysis tool, and contains the reported output of that run. */ export interface Run { /** @@ -1345,6 +1390,11 @@ export interface Run { */ aggregateIds?: RunAutomationDetails[]; + /** + * An array of artifact objects relevant to the run. + */ + artifacts?: Artifact[]; + /** * The 'instanceGuid' property of a previous SARIF 'run' that comprises the baseline that was used to compute * result 'baselineState' properties for the run. @@ -1357,18 +1407,18 @@ export interface Run { columnKind?: Run.columnKind; /** - * A conversion object that describes how a converter transformed an analysis tool's native output format into + * A conversion object that describes how a converter transformed an analysis tool's native reporting format into * the SARIF format. */ conversion?: Conversion; /** - * Specifies the default encoding for any file object that refers to a text file. + * Specifies the default encoding for any artifact object that refers to a text file. */ defaultFileEncoding?: string; /** - * Specifies the default source language for any file object that refers to a text file that contains source + * Specifies the default source language for any artifact object that refers to a text file that contains source * code. */ defaultSourceLanguage?: string; @@ -1379,13 +1429,7 @@ export interface Run { externalPropertyFiles?: ExternalPropertyFiles; /** - * An array of file objects relevant to the run. - */ - files?: File[]; - - /** - * A dictionary, each of whose keys is the id of a graph and each of whose values is a 'graph' object with that - * id. + * A dictionary, each of whose keys is the id of a graph and each of whose values is a 'graph' object with that id. */ graphs?: { [key: string]: Graph }; @@ -1405,47 +1449,41 @@ export interface Run { logicalLocations?: LogicalLocation[]; /** - * An ordered list of character sequences that were treated as line breaks when computing region information - * for the run. + * The MIME type of all Markdown text message properties in the run. Default: "text/markdown;variant=GFM" + */ + markdownMessageMimeType?: string; + + /** + * An ordered list of character sequences that were treated as line breaks when computing region information for + * the run. */ newlineSequences?: string[]; /** - * The file location specified by each uriBaseId symbol on the machine where the tool originally ran. + * The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. */ - originalUriBaseIds?: { [key: string]: FileLocation }; + originalUriBaseIds?: { [key: string]: ArtifactLocation }; /** * The string used to replace sensitive information in a redaction-aware property. */ redactionToken?: string; - /** - * Items that can be localized, such as message strings and rule metadata. - */ - resources?: Resources; - /** * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting * rules metadata. It must be present (but may be empty) if a log file represents an actual scan. */ results?: Result[]; - /** - * The MIME type of all rich text message properties in the run. Default: "text/markdown;variant=GFM" - */ - richMessageMimeType?: string; - /** * Information about the tool or tool pipeline that generated the results in this run. A run can only contain - * results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as - * long as context around the tool run (tool command-line arguments and the like) is identical for all - * aggregated files. + * results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long + * as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files. */ tool: Tool; /** - * Specifies the revision in version control of the files that were scanned. + * Specifies the revision in version control of the artifacts that were scanned. */ versionControlProvenance?: VersionControlDetails[]; @@ -1595,15 +1633,17 @@ export interface ThreadFlowLocation { executionTimeUtc?: string; /** - * Specifies the importance of this location in understanding the code flow in which it occurs. The order from - * most to least important is "essential", "important", "unimportant". Default: "important". + * Specifies the importance of this location in understanding the code flow in which it occurs. The order from most + * to least important is "essential", "important", "unimportant". Default: "important". */ importance?: ThreadFlowLocation.importance; /** - * A string describing the type of this location. + * A set of distinct strings that categorize the thread flow location. Well-known kinds include acquire, release, + * enter, exit, call, return, branch, implicit, false, true, caution, danger, unknown, unreachable, taint, + * function, handler, lock, memory, resource, and scope. */ - kind?: string; + kinds?: string[]; /** * The code location. @@ -1627,8 +1667,8 @@ export interface ThreadFlowLocation { /** * A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents - * the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary - * might hold the current assumed values of a set of global variables. + * the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might + * hold the current assumed values of a set of global variables. */ state?: { [key: string]: string }; @@ -1650,20 +1690,14 @@ export namespace ThreadFlowLocation { */ export interface Tool { /** - * The binary version of the tool's primary executable file expressed as four non-negative integers separated - * by a period (for operating systems that express file versions in this way). + * The analysis tool that was run. */ - dottedQuadFileVersion?: string; + driver: ToolComponent; /** - * The absolute URI from which the tool can be downloaded. + * Tool extensions that contributed to or reconfigured the analysis tool that was run. */ - downloadUri?: string; - - /** - * The name of the tool along with its version and any other useful identifying information, such as its locale. - */ - fullName?: string; + extensions?: ToolComponent[]; /** * The tool language (expressed as an ISO 649 two-letter lowercase culture code) and region (expressed as an ISO @@ -1672,28 +1706,73 @@ export interface Tool { language?: string; /** - * The name of the tool. + * Key/value pairs that provide additional information about the tool. + */ + properties?: PropertyBag; +} + +/** + * A component, such as a plug-in or the default driver, of the analysis tool that was run. + */ +export interface ToolComponent { + /** + * The index within the run artifacts array of the artifact object associated with the component. + */ + artifactIndex?: number; + + /** + * The binary version of the component's primary executable file expressed as four non-negative integers separated + * by a period (for operating systems that express file versions in this way). + */ + dottedQuadFileVersion?: string; + + /** + * The absolute URI from which the component can be downloaded. + */ + downloadUri?: string; + + /** + * The name of the component along with its version and any other useful identifying information, such as its + * locale. + */ + fullName?: string; + + /** + * A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString + * object, which holds message strings in plain text and (optionally) Markdown format. The strings can include + * placeholders, which can be used to construct a message in combination with an arbitrary number of additional + * string arguments. + */ + globalMessageStrings?: { [key: string]: MultiformatMessageString }; + + /** + * The name of the component. */ name: string; /** - * A version that uniquely identifies the SARIF logging component that generated this file, if it is versioned - * separately from the tool. + * An array of reportDescriptor objects relevant to the notifications related to the configuration and runtime + * execution of the component. */ - sarifLoggerVersion?: string; + notificationDescriptors?: ReportingDescriptor[]; /** - * The tool version in the format specified by Semantic Versioning 2.0. + * An array of reportDescriptor objects relevant to the analysis performed by the component. + */ + ruleDescriptors?: ReportingDescriptor[]; + + /** + * The component version in the format specified by Semantic Versioning 2.0. */ semanticVersion?: string; /** - * The tool version, in whatever format the tool natively provides. + * The component version, in whatever format the component natively provides. */ version?: string; /** - * Key/value pairs that provide additional information about the tool. + * Key/value pairs that provide additional information about the component. */ properties?: PropertyBag; } @@ -1703,8 +1782,8 @@ export interface Tool { */ export interface VersionControlDetails { /** - * A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state - * of the repository at that time. + * A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of + * the repository at that time. */ asOfTimeUtc?: string; @@ -1717,7 +1796,7 @@ export interface VersionControlDetails { * The location in the local file system to which the root of the repository was mapped at the time of the * analysis. */ - mappedTo?: FileLocation; + mappedTo?: ArtifactLocation; /** * The absolute URI of the repository. diff --git a/types/sarif/sarif-tests.ts b/types/sarif/sarif-tests.ts index 45b5bf922d..35d522b86b 100644 --- a/types/sarif/sarif-tests.ts +++ b/types/sarif/sarif-tests.ts @@ -4,8 +4,10 @@ const input = `{ "runs": [ { "tool": { - "name": "CodeScanner", - "semanticVersion": "2.1.0" + "driver": { + "name": "CodeScanner", + "semanticVersion": "2.1.0" + }, }, "results": [ ] @@ -13,6 +15,6 @@ const input = `{ ] }`; const log = JSON.parse("") as sarif.Log; -if (log.runs[0].tool.name !== "CodeScanner") { +if (log.runs[0].tool.driver.name !== "CodeScanner") { throw new Error("error: Tool name does not match"); } diff --git a/types/sass-webpack-plugin/index.d.ts b/types/sass-webpack-plugin/index.d.ts index df589ca034..1299429790 100644 --- a/types/sass-webpack-plugin/index.d.ts +++ b/types/sass-webpack-plugin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jalkoby/sass-webpack-plugin // Definitions by: AEPKILL // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.7 import { Options } from 'node-sass'; import { Plugin } from 'webpack'; diff --git a/types/seamless-immutable/index.d.ts b/types/seamless-immutable/index.d.ts index 1990dff0ab..1206034846 100644 --- a/types/seamless-immutable/index.d.ts +++ b/types/seamless-immutable/index.d.ts @@ -80,7 +80,7 @@ declare namespace SeamlessImmutable { propertyPath: [ K, L, M, N ], updaterFunction: (value: T[K][L][M][N], ...additionalParameters: any[]) => any, ...additionalArguments: any[]): Immutable; updateIn( propertyPath: [ K, L, M, N, O ], updaterFunction: (value: T[K][L][M][N][O], ...additionalParameters: any[]) => any, ...additionalArguments: any[]): Immutable; - updateIn(propertyPath: string[], updaterFunction: (value: TValue, ...additionalParameters: any[]) => any, ...additionalArguments: any[]): Immutable; + updateIn(propertyPath: string[], updaterFunction: (value: TValue, ...additionalParameters: any[]) => any, ...additionalArguments: any[]): Immutable; without(property: K): Immutable; without(...properties: K[]): Immutable; diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 8fb0c16503..35b790c0f9 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1379,7 +1379,11 @@ declare namespace sequelize { * Should the join model have timestamps */ timestamps?: boolean; - + + /** + * Belongs-To-Many creates a unique key when primary key is not present on through model. This unique key name can be overridden using uniqueKey option. + */ + uniqueKey?: string; } /** @@ -3286,6 +3290,11 @@ declare namespace sequelize { * if true, it will also eager load the relations of the child models, recursively. */ nested?: boolean; + + /** + * If true, runs a separate query to fetch the associated instances, only supported for hasMany associations + */ + separate?: boolean; } /** @@ -6510,6 +6519,16 @@ declare namespace sequelize { */ logging?: Function; + /** + * Specify the parent transaction so that this transaction is nested or a save point within the parent + */ + transaction?: Transaction; + + /** + * Sets the constraints to be deferred or immediately checked. + */ + deferrable?: Deferrable[keyof Deferrable]; + } // diff --git a/types/serverless/classes/PluginManager.d.ts b/types/serverless/classes/PluginManager.d.ts index 95e01f721a..76f3479c84 100644 --- a/types/serverless/classes/PluginManager.d.ts +++ b/types/serverless/classes/PluginManager.d.ts @@ -14,6 +14,7 @@ declare class PluginManager { loadServicePlugins(servicePlugins: {}): void; loadCommand(pluginName: string, details: {}, key: string): {}; loadCommands(pluginInstance: Plugin): void; + spawn(commandsArray: string | string[], options?: any): Promise; cliOptions: {}; cliCommands: {}; diff --git a/types/serverless/classes/Service.d.ts b/types/serverless/classes/Service.d.ts index 2f05f3b7c0..040a45f825 100644 --- a/types/serverless/classes/Service.d.ts +++ b/types/serverless/classes/Service.d.ts @@ -15,6 +15,11 @@ declare class Service { }; name: string; + stage: string; + region: string; + runtime?: string; + timeout?: number; + versionFunctions: boolean; }; constructor(serverless: Serverless, data: {}); diff --git a/types/serverless/index.d.ts b/types/serverless/index.d.ts index 01f9d7a73e..d720ec2382 100644 --- a/types/serverless/index.d.ts +++ b/types/serverless/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for serverless 1.18 // Project: https://github.com/serverless/serverless#readme // Definitions by: Hassan Khan +// Jonathan M. Wilbur // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import Service = require("./classes/Service"); @@ -12,6 +13,9 @@ import AwsProvider = require("./plugins/aws/provider/awsProvider"); declare namespace Serverless { interface Options { + function?: string; + watch?: boolean; + extraServicePath?: string; stage: string | null; region: string | null; noDeploy?: boolean; @@ -23,11 +27,24 @@ declare namespace Serverless { interface FunctionDefinition { name: string; + package: Package; + runtime?: string; + handler: string; + timeout?: number; + memorySize?: number; + environment?: { [ name: string ]: string }; } interface Event { eventName: string; } + + interface Package { + include: string[]; + exclude: string[]; + artifact?: string; + individually?: boolean; + } } declare class Serverless { diff --git a/types/sha/index.d.ts b/types/sha/index.d.ts index 954036341b..5bde64b12b 100644 --- a/types/sha/index.d.ts +++ b/types/sha/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for sha 2.0 +// Type definitions for sha 3.0 // Project: https://github.com/ForbesLindesay/sha // Definitions by: Oscar Busk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/shipit-utils/index.d.ts b/types/shipit-utils/index.d.ts index 64a62f2d61..6a8582bfad 100644 --- a/types/shipit-utils/index.d.ts +++ b/types/shipit-utils/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import shipit = require("shipit"); +import shipit = require("shipit-cli"); export type GruntOrShipit = typeof shipit | {}; export type EmptyCallback = () => void; diff --git a/types/shipit-utils/shipit-utils-tests.ts b/types/shipit-utils/shipit-utils-tests.ts index 36da5f0073..96bbe2bbdb 100644 --- a/types/shipit-utils/shipit-utils-tests.ts +++ b/types/shipit-utils/shipit-utils-tests.ts @@ -1,4 +1,4 @@ -import shipit = require("shipit"); +import shipit = require("shipit-cli"); import utils = require("shipit-utils"); const originalShipit = utils.getShipit(shipit); diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index 7295119c66..d05495078c 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -1618,10 +1618,14 @@ declare namespace Sinon { * * @template TType Type being stubbed. * @param constructor Object or class to stub. + * @param overrides An optional map overriding created stubs * @returns A stubbed version of the constructor. * @remarks The given constructor function is not invoked. See also the stub API. */ - createStubInstance(constructor: StubbableType): SinonStubbedInstance; + createStubInstance( + constructor: StubbableType, + overrides?: { [K in keyof TType]?: any } + ): SinonStubbedInstance; } interface SinonApi { diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index aebe96ae25..9e76b20bbe 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -87,6 +87,9 @@ function testSandbox() { const privateFooFoo: sinon.SinonStub = privateFooStubbedInstance.foo; const clsBar: number = stubInstance.bar; const privateFooBar: number = privateFooStubbedInstance.bar; + sb.createStubInstance(cls, { + bar: 1 + }); } function testFakeServer() { diff --git a/types/sinon/ts3.1/index.d.ts b/types/sinon/ts3.1/index.d.ts index 7123e75d49..a27355e835 100644 --- a/types/sinon/ts3.1/index.d.ts +++ b/types/sinon/ts3.1/index.d.ts @@ -1707,11 +1707,14 @@ declare namespace Sinon { * * @template TType Type being stubbed. * @param constructor Object or class to stub. + * @param overrides An optional map overriding created stubs * @returns A stubbed version of the constructor. * @remarks The given constructor function is not invoked. See also the stub API. */ createStubInstance( - constructor: StubbableType + constructor: StubbableType, + overrides?: { [K in keyof TType]?: + SinonStubbedMember | TType[K] extends (...args: any[]) => infer R ? R : TType[K] } ): SinonStubbedInstance; } diff --git a/types/sinon/ts3.1/sinon-tests.ts b/types/sinon/ts3.1/sinon-tests.ts index 2db25348ae..a123f560fb 100644 --- a/types/sinon/ts3.1/sinon-tests.ts +++ b/types/sinon/ts3.1/sinon-tests.ts @@ -67,7 +67,7 @@ function testSandbox() { sb.replaceSetter(replaceMe, 'setter', (v) => { }); const cls = class { - foo(arg1: string, arg2: number) { return 1; } + foo(arg1: string, arg2: number): number { return 1; } bar: number; }; const PrivateFoo = class { @@ -87,6 +87,10 @@ function testSandbox() { const privateFooFoo: sinon.SinonStub = privateFooStubbedInstance.foo; const clsBar: number = stubInstance.bar; const privateFooBar: number = privateFooStubbedInstance.bar; + sb.createStubInstance(cls, { + foo: (arg1: string, arg2: number) => 2, + bar: 1 + }); } function testFakeServer() { diff --git a/types/solidity-parser-antlr/index.d.ts b/types/solidity-parser-antlr/index.d.ts index 7b92aefb22..7547fd282e 100644 --- a/types/solidity-parser-antlr/index.d.ts +++ b/types/solidity-parser-antlr/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/federicobond/solidity-parser-antlr // Definitions by: Leonid Logvinov // Alex Browne +// Xiao Liang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -13,114 +14,208 @@ export interface Location { start: LineColumn; end: LineColumn; } + +// Note: This should be consistent with the definition of type ASTNode +export type ASTNodeTypeString = 'SourceUnit' +| 'PragmaDirective' +| 'PragmaName' +| 'PragmaValue' +| 'Version' +| 'VersionOperator' +| 'VersionConstraint' +| 'ImportDeclaration' +| 'ImportDirective' +| 'ContractDefinition' +| 'InheritanceSpecifier' +| 'ContractPart' +| 'StateVariableDeclaration' +| 'UsingForDeclaration' +| 'StructDefinition' +| 'ModifierDefinition' +| 'ModifierInvocation' +| 'FunctionDefinition' +| 'ReturnParameters' +| 'ModifierList' +| 'EventDefinition' +| 'EnumValue' +| 'EnumDefinition' +| 'ParameterList' +| 'Parameter' +| 'EventParameterList' +| 'EventParameter' +| 'FunctionTypeParameterList' +| 'FunctionTypeParameter' +| 'VariableDeclaration' +| 'TypeName' +| 'UserDefinedTypeName' +| 'Mapping' +| 'FunctionTypeName' +| 'StorageLocation' +| 'StateMutability' +| 'Block' +| 'Statement' +| 'ExpressionStatement' +| 'IfStatement' +| 'WhileStatement' +| 'SimpleStatement' +| 'ForStatement' +| 'InlineAssemblyStatement' +| 'DoWhileStatement' +| 'ContinueStatement' +| 'BreakStatement' +| 'ReturnStatement' +| 'ThrowStatement' +| 'VariableDeclarationStatement' +| 'IdentifierList' +| 'ElementaryTypeName' +| 'Expression' +| 'PrimaryExpression' +| 'ExpressionList' +| 'NameValueList' +| 'NameValue' +| 'FunctionCallArguments' +| 'AssemblyBlock' +| 'AssemblyItem' +| 'AssemblyExpression' +| 'AssemblyCall' +| 'AssemblyLocalDefinition' +| 'AssemblyAssignment' +| 'AssemblyIdentifierOrList' +| 'AssemblyIdentifierList' +| 'AssemblyStackAssignment' +| 'LabelDefinition' +| 'AssemblySwitch' +| 'AssemblyCase' +| 'AssemblyFunctionDefinition' +| 'AssemblyFunctionReturns' +| 'AssemblyFor' +| 'AssemblyIf' +| 'AssemblyLiteral' +| 'SubAssembly' +| 'TupleExpression' +| 'ElementaryTypeNameExpression' +| 'NumberLiteral' +| 'Identifier' +| 'BinaryOperation' +| 'Conditional'; + export interface BaseASTNode { - type: string; + type: ASTNodeTypeString; range?: [number, number]; loc?: Location; } export interface SourceUnit extends BaseASTNode { + type: 'SourceUnit'; children: ASTNode[]; // TODO: Can be more precise } // tslint:disable-line:no-empty-interface -export interface PragmaDirective extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface PragmaName extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface PragmaValue extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Version extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface VersionOperator extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface VersionConstraint extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ImportDeclaration extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ImportDirective extends BaseASTNode {} // tslint:disable-line:no-empty-interface +export interface PragmaDirective extends BaseASTNode { type: 'PragmaDirective'; } +export interface PragmaName extends BaseASTNode { type: 'PragmaName'; } +export interface PragmaValue extends BaseASTNode { type: 'PragmaValue'; } +export interface Version extends BaseASTNode { type: 'Version'; } +export interface VersionOperator extends BaseASTNode { type: 'VersionOperator'; } +export interface VersionConstraint extends BaseASTNode { type: 'VersionConstraint'; } +export interface ImportDeclaration extends BaseASTNode { type: 'ImportDeclaration'; } +export interface ImportDirective extends BaseASTNode { type: 'ImportDirective'; } export interface ContractDefinition extends BaseASTNode { + type: 'ContractDefinition'; name: string; subNodes: ASTNode[]; // TODO: Can be more precise } -export interface InheritanceSpecifier extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ContractPart extends BaseASTNode {} // tslint:disable-line:no-empty-interface +export interface InheritanceSpecifier extends BaseASTNode { type: 'InheritanceSpecifier'; } +export interface ContractPart extends BaseASTNode { type: 'ContractPart'; } export interface StateVariableDeclaration extends BaseASTNode { + type: 'StateVariableDeclaration'; variables: VariableDeclaration[]; } -export interface UsingForDeclaration extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface StructDefinition extends BaseASTNode {} // tslint:disable-line:no-empty-interface +export interface UsingForDeclaration extends BaseASTNode { type: 'UsingForDeclaration'; } +export interface StructDefinition extends BaseASTNode { type: 'StructDefinition'; } export interface ModifierDefinition extends BaseASTNode { + type: 'ModifierDefinition'; name: string; } export interface ModifierInvocation extends BaseASTNode { + type: 'ModifierInvocation'; name: string; } export interface FunctionDefinition extends BaseASTNode { + type: 'FunctionDefinition'; name: string; parameters: ParameterList; body: Block | null; } -export interface ReturnParameters extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ModifierList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface EventDefinition extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface EnumValue extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface EnumDefinition extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ParameterList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Parameter extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface EventParameterList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface EventParameter extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface FunctionTypeParameterList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface FunctionTypeParameter extends BaseASTNode {} // tslint:disable-line:no-empty-interface +export interface ReturnParameters extends BaseASTNode { type: 'ReturnParameters'; } +export interface ModifierList extends BaseASTNode { type: 'ModifierList'; } +export interface EventDefinition extends BaseASTNode { type: 'EventDefinition'; } +export interface EnumValue extends BaseASTNode { type: 'EnumValue'; } +export interface EnumDefinition extends BaseASTNode { type: 'EnumDefinition'; } +export interface ParameterList extends BaseASTNode { type: 'ParameterList'; } +export interface Parameter extends BaseASTNode { type: 'Parameter'; } +export interface EventParameterList extends BaseASTNode { type: 'EventParameterList'; } +export interface EventParameter extends BaseASTNode { type: 'EventParameter'; } +export interface FunctionTypeParameterList extends BaseASTNode { type: 'FunctionTypeParameterList'; } +export interface FunctionTypeParameter extends BaseASTNode { type: 'FunctionTypeParameter'; } export interface VariableDeclaration extends BaseASTNode { + type: 'VariableDeclaration'; visibility: "public" | "private"; isStateVar: boolean; } -export interface TypeName extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface UserDefinedTypeName extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Mapping extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface FunctionTypeName extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface StorageLocation extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface StateMutability extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Block extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Statement extends BaseASTNode {} // tslint:disable-line:no-empty-interface +export interface TypeName extends BaseASTNode { type: 'TypeName'; } +export interface UserDefinedTypeName extends BaseASTNode { type: 'UserDefinedTypeName'; } +export interface Mapping extends BaseASTNode { type: 'Mapping'; } +export interface FunctionTypeName extends BaseASTNode { type: 'FunctionTypeName'; } +export interface StorageLocation extends BaseASTNode { type: 'StorageLocation'; } +export interface StateMutability extends BaseASTNode { type: 'StateMutability'; } +export interface Block extends BaseASTNode { type: 'Block'; } +export interface Statement extends BaseASTNode { type: 'Statement'; } export interface ExpressionStatement extends BaseASTNode { + type: 'ExpressionStatement'; expression: ASTNode; } export interface IfStatement extends BaseASTNode { + type: 'IfStatement'; trueBody: ASTNode; falseBody: ASTNode; } -export interface WhileStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface SimpleStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ForStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface InlineAssemblyStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface DoWhileStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ContinueStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface BreakStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ReturnStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ThrowStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface VariableDeclarationStatement extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface IdentifierList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ElementaryTypeName extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Expression extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface PrimaryExpression extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ExpressionList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface NameValueList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface NameValue extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface FunctionCallArguments extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyBlock extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyItem extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyExpression extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyCall extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyLocalDefinition extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyAssignment extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyIdentifierOrList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyIdentifierList extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyStackAssignment extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface LabelDefinition extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblySwitch extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyCase extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyFunctionDefinition extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyFunctionReturns extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyFor extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyIf extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface AssemblyLiteral extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface SubAssembly extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface TupleExpression extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface ElementaryTypeNameExpression extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface NumberLiteral extends BaseASTNode {} // tslint:disable-line:no-empty-interface -export interface Identifier extends BaseASTNode {} // tslint:disable-line:no-empty-interface +export interface WhileStatement extends BaseASTNode { type: 'WhileStatement'; } +export interface SimpleStatement extends BaseASTNode { type: 'SimpleStatement'; } +export interface ForStatement extends BaseASTNode { type: 'ForStatement'; } +export interface InlineAssemblyStatement extends BaseASTNode { type: 'InlineAssemblyStatement'; } +export interface DoWhileStatement extends BaseASTNode { type: 'DoWhileStatement'; } +export interface ContinueStatement extends BaseASTNode { type: 'ContinueStatement'; } +export interface BreakStatement extends BaseASTNode { type: 'BreakStatement'; } +export interface ReturnStatement extends BaseASTNode { type: 'ReturnStatement'; } +export interface ThrowStatement extends BaseASTNode { type: 'ThrowStatement'; } +export interface VariableDeclarationStatement extends BaseASTNode { type: 'VariableDeclarationStatement'; } +export interface IdentifierList extends BaseASTNode { type: 'IdentifierList'; } +export interface ElementaryTypeName extends BaseASTNode { type: 'ElementaryTypeName'; } +export interface Expression extends BaseASTNode { type: 'Expression'; } +export interface PrimaryExpression extends BaseASTNode { type: 'PrimaryExpression'; } +export interface ExpressionList extends BaseASTNode { type: 'ExpressionList'; } +export interface NameValueList extends BaseASTNode { type: 'NameValueList'; } +export interface NameValue extends BaseASTNode { type: 'NameValue'; } +export interface FunctionCallArguments extends BaseASTNode { type: 'FunctionCallArguments'; } +export interface AssemblyBlock extends BaseASTNode { type: 'AssemblyBlock'; } +export interface AssemblyItem extends BaseASTNode { type: 'AssemblyItem'; } +export interface AssemblyExpression extends BaseASTNode { type: 'AssemblyExpression'; } +export interface AssemblyCall extends BaseASTNode { type: 'AssemblyCall'; } +export interface AssemblyLocalDefinition extends BaseASTNode { type: 'AssemblyLocalDefinition'; } +export interface AssemblyAssignment extends BaseASTNode { type: 'AssemblyAssignment'; } +export interface AssemblyIdentifierOrList extends BaseASTNode { type: 'AssemblyIdentifierOrList'; } +export interface AssemblyIdentifierList extends BaseASTNode { type: 'AssemblyIdentifierList'; } +export interface AssemblyStackAssignment extends BaseASTNode { type: 'AssemblyStackAssignment'; } +export interface LabelDefinition extends BaseASTNode { type: 'LabelDefinition'; } +export interface AssemblySwitch extends BaseASTNode { type: 'AssemblySwitch'; } +export interface AssemblyCase extends BaseASTNode { type: 'AssemblyCase'; } +export interface AssemblyFunctionDefinition extends BaseASTNode { type: 'AssemblyFunctionDefinition'; } +export interface AssemblyFunctionReturns extends BaseASTNode { type: 'AssemblyFunctionReturns'; } +export interface AssemblyFor extends BaseASTNode { type: 'AssemblyFor'; } +export interface AssemblyIf extends BaseASTNode { type: 'AssemblyIf'; } +export interface AssemblyLiteral extends BaseASTNode { type: 'AssemblyLiteral'; } +export interface SubAssembly extends BaseASTNode { type: 'SubAssembly'; } +export interface TupleExpression extends BaseASTNode { type: 'TupleExpression'; } +export interface ElementaryTypeNameExpression extends BaseASTNode { type: 'ElementaryTypeNameExpression'; } +export interface NumberLiteral extends BaseASTNode { type: 'NumberLiteral'; } +export interface Identifier extends BaseASTNode { type: 'Identifier'; } export type BinOp = | "+" | "-" @@ -153,11 +248,13 @@ export type BinOp = | "/=" | "%="; export interface BinaryOperation extends BaseASTNode { + type: 'BinaryOperation'; left: ASTNode; right: ASTNode; operator: BinOp; } export interface Conditional extends BaseASTNode { + type: 'Conditional'; trueExpression: ASTNode; falseExpression: ASTNode; } diff --git a/types/ssh2/index.d.ts b/types/ssh2/index.d.ts index cf88fff5f1..8e03805817 100644 --- a/types/ssh2/index.d.ts +++ b/types/ssh2/index.d.ts @@ -729,6 +729,8 @@ export interface ServerConfig { /** Explicit overrides for the default transport layer algorithms used for the connection. */ algorithms?: Algorithms; /** A message that is sent to clients immediately upon connection, before handshaking begins. */ + greeting?: string + /** A message that is sent to clients once, right before authentication begins. */ banner?: string; /** A custom server software name/version identifier. */ ident?: string; diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index 9e5089d443..6adc628c31 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for @storybook/addon-info 3.4 +// Type definitions for @storybook/addon-info 4.1 // Project: https://github.com/storybooks/storybook, https://github.com/storybooks/storybook/tree/master/addons/info // Definitions by: Mark Kornblum // Mattias Wikstrom +// Kevin Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -22,11 +23,22 @@ export interface Options { propTables?: React.ComponentType[] | false; propTablesExclude?: React.ComponentType[]; styles?: object; + components?: { [key: string]: React.ComponentType }; marksyConf?: object; maxPropsIntoLine?: number; maxPropObjectKeys?: number; maxPropArrayLength?: number; maxPropStringLength?: number; + TableComponent?: React.ComponentType<{ + propDefinitions: Array<{ + property: string; + propType: object | string; // TODO: info about what this object is... + required: boolean; + description: string; + defaultValue: any; + }> + }>; + excludedPropTypes?: string[]; } // TODO: it would be better to use type inference for the parameters diff --git a/types/storybook__addon-info/storybook__addon-info-tests.tsx b/types/storybook__addon-info/storybook__addon-info-tests.tsx index 505780bf7e..0e581c822d 100644 --- a/types/storybook__addon-info/storybook__addon-info-tests.tsx +++ b/types/storybook__addon-info/storybook__addon-info-tests.tsx @@ -6,6 +6,38 @@ import { setDefaults, withInfo } from '@storybook/addon-info'; const { Component } = React; +const TableComponent = ({ propDefinitions }: { propDefinitions: Array<{ + property: string; + propType: { [key: string]: any} | string; + required: boolean; + description: string; + defaultValue: any; +}> }) => ( + + + + + + + + + + + + {propDefinitions.map(row => ( + + + + + + + ))} + +
    propertypropTyperequireddefaultdescription
    {row.property}{row.required ? 'yes' : '-'} + {row.defaultValue === undefined ? '-' : row.defaultValue} + {row.description}
    +); + addDecorator(withInfo); setDefaults({ @@ -31,11 +63,14 @@ storiesOf('Component', module) header: true, source: true, styles: {}, + components: {}, marksyConf: {}, maxPropObjectKeys: 1, maxPropArrayLength: 2, maxPropsIntoLine: 3, maxPropStringLength: 4, + TableComponent, + excludedPropTypes: [], })(() => Click the "?" mark at top-right to view the info. ) diff --git a/types/storybook__addon-storyshots/index.d.ts b/types/storybook__addon-storyshots/index.d.ts index bc265f125c..546386ce40 100644 --- a/types/storybook__addon-storyshots/index.d.ts +++ b/types/storybook__addon-storyshots/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/storybooks/storybook/tree/master/addons/storyshots, https://github.com/storybooks/storybook/tree/master/addons/storyshorts/storyshots-core // Definitions by: Bradley Ayers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 +// TypeScript Version: 3.1 import * as React from 'react'; import { StoryObject } from '@storybook/react'; diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 2b46cbb3af..41e591c839 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -16,6 +16,7 @@ // Simon Schick // Slava Yultyyev // Corey Psoinos +// Saransh Kataria // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -3383,6 +3384,12 @@ declare namespace Stripe { * May only be set if type=service. */ statement_descriptor?: string; + + /** + * A label that represents units of this product, such as seat(s), in Stripe and on customers’ receipts and invoices. + * Only available on products of type=service. + */ + unit_label?: string; } interface IProductUpdateOptions extends IDataOptionsWithMetadata { diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index a7dea63e06..c89b50c86d 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -5,6 +5,7 @@ // Adam Lavin // Jessica Franco // Jason Killian +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 @@ -45,9 +46,9 @@ export type StyledProps

    = ThemedStyledProps>; // Wrap in an outer-level conditional type to allow distribution over props that are unions type Defaultize = P extends any ? string extends keyof P ? P : - & Pick> - & Partial>> - & Partial>> + & PickU> + & Partial>> + & Partial>> : never; type ReactDefaultizedProps = C extends { defaultProps: infer D; } @@ -64,13 +65,13 @@ export type StyledComponentProps< // The props that are made optional by .attrs A extends keyof any > = WithOptionalTheme< - Omit< + OmitU< ReactDefaultizedProps< C, React.ComponentPropsWithRef > & O, A - > & Partial & O, A>>, + > & Partial & O, A>>, T > & WithChildrenIfReactComponentClass; @@ -345,8 +346,10 @@ export type ThemedCssFunction = BaseThemedCssFunction< >; // Helper type operators -type Omit = Pick>; -type WithOptionalTheme

    = Omit & { +// Pick that distributes over union types +export type PickU = T extends any ? {[P in K]: T[P]} : never; +export type OmitU = T extends any ? PickU> : never; +type WithOptionalTheme

    = OmitU & { theme?: T; }; type AnyIfEmpty = keyof T extends never ? any : T; diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index a37c33f315..067cdc7d89 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -1030,3 +1030,32 @@ const WrapperFunc = (props: WrapperProps) =>

    ; const StyledWrapperFunc = styled(WrapperFunc)``; // No `children` in props, so this should generate an error const wrapperFunc = Text; // $ExpectError + +function unionTest() { + interface Book { + kind: 'book'; + author: string; + } + + interface Magazine { + kind: 'magazine'; + issue: number; + } + + type SomethingToRead = (Book | Magazine); + + const Readable: React.FunctionComponent = props => { + if (props.kind === 'magazine') { + return
    magazine #{props.issue}
    ; + } + + return
    magazine #{props.author}
    ; + }; + + const StyledReadable = styled(Readable)` + font-size: ${props => props.kind === 'book' ? 16 : 14} + `; + + ; + ; // $ExpectError +} diff --git a/types/swagger-node-runner/index.d.ts b/types/swagger-node-runner/index.d.ts index 3e8016a73f..02421cbe08 100644 --- a/types/swagger-node-runner/index.d.ts +++ b/types/swagger-node-runner/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for swagger-node-runner 0.5 +// Type definitions for swagger-node-runner 0.6 // Project: https://github.com/theganyo/swagger-node-runner // Definitions by: Michael Mrowetz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -36,6 +36,7 @@ import { Spec } from "swagger-schema-official"; import { EventEmitter } from "events"; import * as Hapi from "hapi"; import * as Restify from "restify"; +import { OutgoingHttpHeaders } from "http"; /** * Config object for SwaggerNodeRunner @@ -117,12 +118,18 @@ export type SwaggerToolsMiddleware = (req: any, res: any, next: any) => any; /** * @param callback - Error is returned if request is unauthorized. - * The Error may include "message", "state", and "code" fields to be conveyed to the client in the response body and a + * The Error may include "message", and "code" fields to be conveyed to the client in the response body and a * "headers" field containing an object representing headers to be set on the response to the client. * In addition, if the Error has a statusCode field, the response statusCode will be set to match - * otherwise, the statusCode will be set to 403. */ -export type SwaggerToolsSecurityHandler = (request: any, securityDefinition: any, scopes: any, callback: (err: Error) => void) => void; +export interface SwaggerToolsSecurityHandlerCallbackError { + code?: string; + headers?: OutgoingHttpHeaders; + message?: string; + statusCode?: number; +} +export type SwaggerToolsSecurityHandler = (request: any, securityDefinition: any, scopes: any, callback: (err?: Error | SwaggerToolsSecurityHandlerCallbackError, result?: any) => void) => void; /** * The keys match SecurityDefinition names and the associated values are functions that accept the following parameters: diff --git a/types/swagger-node-runner/swagger-node-runner-tests.ts b/types/swagger-node-runner/swagger-node-runner-tests.ts index 1deae28f23..bccbac5d94 100644 --- a/types/swagger-node-runner/swagger-node-runner-tests.ts +++ b/types/swagger-node-runner/swagger-node-runner-tests.ts @@ -84,7 +84,7 @@ SwaggerNodeRunner.create(config, (err, runner) => { app.listen(port); }); -const swaggerSecurityHandlerCb = (err: Error) => { +const swaggerSecurityHandlerCb = (err?: Error) => { // do nothing }; @@ -98,7 +98,34 @@ const configComplex: SwaggerNodeRunner.Config = { swaggerSecurityHandlers: { // did not manage to research the typings of first 3 arguments someHandlerName: ({}, {}, {}, swaggerSecurityHandlerCb) => { - // do nothing + swaggerSecurityHandlerCb(new Error('foo')); + } + }, + validateResponse: true +}; + +const handlerWithoutError: SwaggerNodeRunner.Config = { + appRoot: __dirname, + swaggerSecurityHandlers: { + // did not manage to research the typings of first 3 arguments + someHandlerName: ({}, {}, {}, swaggerSecurityHandlerCb) => { + swaggerSecurityHandlerCb(); + } + }, + validateResponse: true +}; + +const handlerWithHeaders: SwaggerNodeRunner.Config = { + appRoot: __dirname, + swaggerSecurityHandlers: { + // did not manage to research the typings of first 3 arguments + someHandlerName: ({}, {}, {}, swaggerSecurityHandlerCb) => { + swaggerSecurityHandlerCb({ + headers: { + foo: 'bar', + baz: 2, + some: ['a', 'b'], + }}); } }, validateResponse: true diff --git a/types/swagger-schema-official/index.d.ts b/types/swagger-schema-official/index.d.ts index 09d31cc8e7..11cfd05520 100644 --- a/types/swagger-schema-official/index.d.ts +++ b/types/swagger-schema-official/index.d.ts @@ -47,24 +47,29 @@ export interface BaseParameter { } export interface BodyParameter extends BaseParameter { + in: 'body'; schema?: Schema; } export interface QueryParameter extends BaseParameter, BaseSchema { + in: 'query'; type: string; allowEmptyValue?: boolean; } export interface PathParameter extends BaseParameter, BaseSchema { + in: 'path'; type: string; required: boolean; } export interface HeaderParameter extends BaseParameter, BaseSchema { + in: 'header'; type: string; } export interface FormDataParameter extends BaseParameter, BaseSchema { + in: 'formData'; type: string; collectionFormat?: string; allowEmptyValue?: boolean; diff --git a/types/swagger-schema-official/swagger-schema-official-tests.ts b/types/swagger-schema-official/swagger-schema-official-tests.ts index 4fb3e55f07..4d46e4aa86 100644 --- a/types/swagger-schema-official/swagger-schema-official-tests.ts +++ b/types/swagger-schema-official/swagger-schema-official-tests.ts @@ -1373,7 +1373,6 @@ const reference_support: swagger.Spec = { { "in": "body", "name": "bodyParameter", - "type": "string", "description": "The body parameter" } ], diff --git a/types/tern/lib/tern/index.d.ts b/types/tern/lib/tern/index.d.ts index 0e48925914..7ecb4ac73e 100644 --- a/types/tern/lib/tern/index.d.ts +++ b/types/tern/lib/tern/index.d.ts @@ -164,17 +164,20 @@ export interface BaseQuery { docFormat?: "full"; } +export interface BaseQueryWithFile extends BaseQuery { + /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ + file: string; +} + export interface Position { ch: number; line: number; } /** Asks the server for a set of completions at the given point. */ -export interface CompletionsQuery extends BaseQuery { +export interface CompletionsQuery extends BaseQueryWithFile { /** Asks the server for a set of completions at the given point. */ type: "completions"; - /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ - file: string; /** Specify the location to complete at. */ end: number | Position; /** Whether to include the types of the completions in the result data. Default `false` */ @@ -233,11 +236,9 @@ export interface CompletionsQueryResult { } /** Query the type of something. */ -export interface TypeQuery extends BaseQuery { +export interface TypeQuery extends BaseQueryWithFile { /** Query the type of something. */ type: "type"; - /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ - file: string; /** Specify the location of the expression. */ end: number | Position; /** Specify the location of the expression. */ @@ -282,7 +283,7 @@ export interface TypeQueryResult { * type is not an object or function (other types don’t store their definition site), * it will fail to return useful information. */ -export interface DefinitionQuery extends BaseQuery { +export interface DefinitionQuery extends BaseQueryWithFile { /** * Asks for the definition of something. This will try, for a variable or property, * to return the point at which it was defined. If that fails, or the chosen @@ -292,8 +293,6 @@ export interface DefinitionQuery extends BaseQuery { * it will fail to return useful information. */ type: "definition"; - /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ - file: string; /** Specify the location of the expression. */ end: number | Position; /** Specify the location of the expression. */ @@ -320,11 +319,9 @@ export interface DefinitionQueryResult { } /** Get the documentation string and URL for a given expression, if any. */ -export interface DocumentationQuery extends BaseQuery { +export interface DocumentationQuery extends BaseQueryWithFile { /** Get the documentation string and URL for a given expression, if any. */ type: "documentation"; - /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ - file: string; /** Specify the location of the expression. */ end: number | Position; /** Specify the location of the expression. */ @@ -341,11 +338,9 @@ export interface DocumentationQueryResult { } /** Used to find all references to a given variable or property. */ -export interface RefsQuery extends BaseQuery { +export interface RefsQuery extends BaseQueryWithFile { /** Used to find all references to a given variable or property. */ type: "refs"; - /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ - file: string; /** Specify the location of the expression. */ end: number | Position; /** Specify the location of the expression. */ @@ -365,11 +360,9 @@ export interface RefsQueryResult { } /** Rename a variable in a scope-aware way. */ -export interface RenameQuery extends BaseQuery { +export interface RenameQuery extends BaseQueryWithFile { /** Rename a variable in a scope-aware way. */ type: "rename"; - /** may hold either a filename, or a string in the form "#N", where N should be an integer referring to one of the files included in the request */ - file: string; /** Specify the location of the variable. */ end: number | Position; /** Specify the location of the variable. */ @@ -467,7 +460,7 @@ export function registerPlugin(name: string, init: (server: Server, options?: Co export interface Desc { run(Server: Server, query: QueryRegistry[T]["query"], file?: File): QueryRegistry[T]["result"]; - takesfile?: boolean; + takesFile?: boolean; } /** diff --git a/types/terser-webpack-plugin/package.json b/types/terser-webpack-plugin/package.json new file mode 100644 index 0000000000..fa05b4d87e --- /dev/null +++ b/types/terser-webpack-plugin/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "terser": "^3.16.1" + } +} diff --git a/types/terser/index.d.ts b/types/terser/index.d.ts deleted file mode 100644 index bea1f3470e..0000000000 --- a/types/terser/index.d.ts +++ /dev/null @@ -1,648 +0,0 @@ -// Type definitions for terser 3.8 -// Project: https://github.com/terser-js/terser, https://github.com/fabiosantoscode/terser -// Definitions by: JordiAnderl -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 - -import * as MOZ_SourceMap from "source-map"; - -export interface Tokenizer { - /** - * The type of this token. - * "comment1" and "comment2" are for single-line, respectively multi-line comments. - */ - type: "num" | "string" | "regexp" | "operator" | "punc" | "atom" | "name" | "keyword" | "comment1" | "comment2"; - - /** - * The name of the file where this token originated from. Useful when compressing multiple files at once to generate the proper source map. - */ - file: string; - - /** - * The "value" of the token. - * That's additional information and depends on the token type: "num", "string" and "regexp" tokens you get their literal value. - * - For "operator" you get the operator. - * - For "punc" it's the punctuation sign (parens, comma, semicolon etc). - * - For "atom", "name" and "keyword" it's the name of the identifier - * - For comments it's the body of the comment (excluding the initial "//" and "/*". - */ - value: string; - - /** - * The line number of this token in the original code. - * 1-based index. - */ - line: number; - - /** - * The column number of this token in the original code. - * 0-based index. - */ - col: number; - - /** - * Short for "newline before", it's a boolean that tells us whether there was a newline before this node in the original source. It helps for automatic semicolon insertion. - * For multi-line comments in particular this will be set to true if there either was a newline before this comment, or * * if this comment contains a newline. - */ - nlb: boolean; - - /** - * This doesn't apply for comment tokens, but for all other token types it will be an array of comment tokens that were found before. - */ - comments_before: string[]; -} - -export class AST_Node { - // The first token of this node - start: AST_Node; - - // The last token of this node - end: AST_Node; - - value?: string | number; - file?: string; - property?: string; - key?: string; - - transform(tt: TreeTransformer): AST_Toplevel; - - walk(walker: TreeWalker): void; -} - -export class AST_Toplevel extends AST_Node { - // Terser contains a scope analyzer which figures out variable/function definitions, references etc. - // You need to call it manually before compression or mangling. - // The figure_out_scope method is defined only on the AST_Toplevel node. - figure_out_scope(): void; - - // Get names that are optimized for GZip compression (names will be generated using the most frequent characters first) - compute_char_frequency(): void; - - mangle_names(): void; - - print(stream: OutputStream): void; - - print_to_string(options?: BeautifierOptions): string; -} - -export interface MinifyOptions { - spidermonkey?: boolean; - outSourceMap?: string; - sourceRoot?: string; - inSourceMap?: string; - fromString?: boolean; - warnings?: boolean; - mangle?: boolean | MangleOptions; - output?: OutputOptions; - compress?: boolean | CompressOptions; - nameCache?: {}; -} - -export interface MinifyOutput { - code: string; - map: string; - warnings?: string[]; - error?: string; - ast?: boolean | AST_Toplevel; -} - -export function minify(files: {}, options?: MinifyOptions): MinifyOutput; - -export interface ParseOptions { - // Default is false - strict?: boolean; - - // Input file name, default is null - filename?: string; - - // Default is null - toplevel?: AST_Toplevel; -} -export interface CompressOptions { - /** Replace `arguments[index]` with function parameter name whenever possible. */ - arguments?: boolean; - /** Various optimizations for boolean context, for example `!!a ? b : c → a ? b : c` */ - booleans?: boolean; - /** Collapse single-use non-constant variables, side effects permitting. */ - collapse_vars?: boolean; - /** Apply certain optimizations to binary nodes, e.g. `!(a <= b) → a > b,` attempts to negate binary nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc */ - comparisons?: boolean; - /** Apply optimizations for `if-s` and conditional expressions. */ - conditionals?: boolean; - /** Remove unreachable code */ - dead_code?: boolean; - /** - * Pass `true` to discard calls to console.* functions. - * If you wish to drop a specific function call such as `console.info` and/or retain side effects from function - * arguments after dropping the function call then use `pure_funcs` instead. - */ - drop_console?: boolean; - /** Remove `debugger;` statements */ - drop_debugger?: boolean; - /** Attempt to evaluate constant expressions */ - evaluate?: boolean; - /** Pass `true` to preserve completion values from terminal statements without `return`, e.g. in bookmarklets. */ - expression?: boolean; - global_defs?: object; - /** hoist function declarations */ - hoist_funs?: boolean; - /** - * Hoist properties from constant object and array literals into regular variables subject to a set of constraints. - * For example: `var o={p:1, q:2}; f(o.p, o.q);` is converted to `f(1, 2);`. Note: `hoist_props` works best with mangle enabled, - * the compress option passes set to 2 or higher, and the compress option toplevel enabled. - */ - hoist_props?: boolean; - /** Hoist var declarations (this is `false` by default because it seems to increase the size of the output in general) */ - hoist_vars?: boolean; - /** Optimizations for if/return and if/continue */ - if_return?: boolean; - /** - * Inline calls to function with simple/return statement - * - false -- same as `Disabled` - * - `Disabled` -- disabled inlining - * - `SimpleFunctions` -- inline simple functions - * - `WithArguments` -- inline functions with arguments - * - `WithArgumentsAndVariables` -- inline functions with arguments and variables - * - true -- same as `WithArgumentsAndVariables` - */ - inline?: boolean | InlineFunctions; - /** join consecutive `var` statements */ - join_vars?: boolean; - /** Prevents the compressor from discarding unused function arguments. You need this for code which relies on `Function.length` */ - keep_fargs?: boolean; - /** Pass true to prevent the compressor from discarding function names. Useful for code relying on `Function.prototype.name`. */ - keep_fnames?: boolean; - /** Pass true to prevent Infinity from being compressed into `1/0`, which may cause performance issues on `Chrome` */ - keep_infinity?: boolean; - /** Optimizations for `do`, `while` and `for` loops when we can statically determine the condition. */ - loops?: boolean; - /** negate `Immediately-Called Function Expressions` where the return value is discarded, to avoid the parens that the code generator would insert. */ - negate_iife?: boolean; - /** The maximum number of times to run compress. In some cases more than one pass leads to further compressed code. Keep in mind more passes will take more time. */ - passes?: number; - /** Rewrite property access using the dot notation, for example `foo["bar"]` to `foo.bar` */ - properties?: boolean; - /** - * An array of names and UglifyJS will assume that those functions do not produce side effects. - * DANGER: will not check if the name is redefined in scope. - * An example case here, for instance `var q = Math.floor(a/b)`. - * If variable q is not used elsewhere, UglifyJS will drop it, but will still keep the `Math.floor(a/b)`, - * not knowing what it does. You can pass `pure_funcs: [ 'Math.floor' ]` to let it know that this function - * won't produce any side effect, in which case the whole statement would get discarded. The current - * implementation adds some overhead (compression will be slower). - */ - pure_funcs?: string[]; - pure_getters?: boolean | 'strict'; - /** - * Allows single-use functions to be inlined as function expressions when permissible allowing further optimization. - * Enabled by default. Option depends on reduce_vars being enabled. Some code runs faster in the Chrome V8 engine if - * this option is disabled. Does not negatively impact other major browsers. - */ - reduce_funcs?: boolean; - /** Improve optimization on variables assigned with and used as constant values. */ - reduce_vars?: boolean; - sequences?: boolean; - /** Pass false to disable potentially dropping functions marked as "pure". */ - side_effects?: boolean; - /** De-duplicate and remove unreachable `switch` branches. */ - switches?: boolean; - /** Drop unreferenced functions ("funcs") and/or variables ("vars") in the top level scope (false by default, true to drop both unreferenced functions and variables) */ - toplevel?: boolean; - /** Prevent specific toplevel functions and variables from unused removal (can be array, comma-separated, RegExp or function. Implies toplevel) */ - top_retain?: boolean; - typeofs?: boolean; - unsafe?: boolean; - /** Compress expressions like a `<= b` assuming none of the operands can be (coerced to) `NaN`. */ - unsafe_comps?: boolean; - /** Compress and mangle `Function(args, code)` when both args and code are string literals. */ - unsafe_Function?: boolean; - /** Optimize numerical expressions like `2 * x * 3` into `6 * x`, which may give imprecise floating point results. */ - unsafe_math?: boolean; - /** Optimize expressions like `Array.prototype.slice.call(a)` into `[].slice.call(a)` */ - unsafe_proto?: boolean; - /** Enable substitutions of variables with `RegExp` values the same way as if they are constants. */ - unsafe_regexp?: boolean; - unsafe_undefined?: boolean; - unused?: boolean; - /** display warnings when dropping unreachable code or unused declarations etc. */ - warnings?: boolean; -} - -export enum InlineFunctions { - Disabled = 0, - SimpleFunctions = 1, - WithArguments = 2, - WithArgumentsAndVariables = 3 -} - -export interface MangleOptions { - /** Pass true to mangle names visible in scopes where `eval` or with are used. */ - eval?: boolean; - /** Pass true to not mangle function names. Useful for code relying on `Function.prototype.name`. */ - keep_fnames?: boolean; - /** Pass an array of identifiers that should be excluded from mangling. Example: `["foo", "bar"]`. */ - reserved?: string[]; - /** Pass true to mangle names declared in the top level scope. */ - toplevel?: boolean; - properties?: boolean | ManglePropertiesOptions; -} - -export interface ManglePropertiesOptions { - /** Use true to allow the mangling of builtin DOM properties. Not recommended to override this setting. */ - builtins?: boolean; - /** Mangle names with the original name still present. Pass an empty string "" to enable, or a non-empty string to set the debug suffix. */ - debug?: boolean; - /** Only mangle unquoted property names */ - keep_quoted?: boolean; - /** Pass a RegExp literal to only mangle property names matching the regular expression. */ - regex?: RegExp; - /** Do not mangle property names listed in the reserved array */ - reserved?: string[]; -} - -export interface OutputOptions { - ascii_only?: boolean; - beautify?: boolean; - braces?: boolean; - comments?: boolean | 'all' | 'some' | RegExp; - indent_level?: number; - indent_start?: boolean; - inline_script?: boolean; - keep_quoted_props?: boolean; - max_line_len?: boolean | number; - preamble?: string; - preserve_line?: boolean; - quote_keys?: boolean; - quote_style?: OutputQuoteStyle; - semicolons?: boolean; - shebang?: boolean; - webkit?: boolean; - width?: number; - wrap_iife?: boolean; -} - -export enum OutputQuoteStyle { - PreferDouble = 0, - AlwaysSingle = 1, - AlwaysDouble = 2, - AlwaysOriginal = 3 -} - -/** - * The parser creates a custom abstract syntax tree given a piece of JavaScript code. - * Perhaps you should read about the AST first. - */ -export function parse(code: string, options?: ParseOptions): AST_Toplevel; - -export interface BeautifierOptions { - /** - * Start indentation on every line (only when `beautify`) - */ - indent_start?: number; - - /** - * Indentation level (only when `beautify`) - */ - indent_level?: number; - - /** - * Quote all keys in {} literals? - */ - quote_keys?: boolean; - - /** - * Add a space after colon signs? - */ - space_colon?: boolean; - - /** - * Output ASCII-safe? (encodes Unicode characters as ASCII) - */ - ascii_only?: boolean; - - /** - * Escape " void): void; - - // This is used to output blocks in curly brackets. - // It'll print an open bracket at current point, then call newline() and with the next indentation level it calls your func. - // Lastly, it'll print an indented closing bracket. As usual, if beautification is off you'll just get {x} where x is whatever func outputs. - with_block(func: () => void): void; - - // Adds parens around the output that your function prints. - with_parens(func: () => void): void; - - // Adds square brackets around the output that your function prints. - with_square(func: () => void): void; - - // If options.source_map is set, this will generate a source mapping between the given token (which should be an AST_Token-like {}) and the current line/col. - // The name is optional; in most cases it will be inferred from the token. - add_mapping(token: AST_Node, name?: string): void; - - // Returns the option with the given name. - option(name: string): any; - - // Returns the current line in the output (1-based). - line(): number; - - // Returns the current column in the output (zero-based). - col(): number; - - // Push the given node into an internal stack. This is used to keep track of current node's parent(s). - push_node(node: AST_Node): void; - - // Pops the top of the stack and returns it. - pop_node(): AST_Node; - - // Returns that internal stack. - stack(): any; - - // Returns the n-th parent node (where zero means the direct parent). - parent(n: number): AST_Node; -} - -/** - * The code generator is a recursive process of getting back source code from an AST returned by the parser. - * Every AST node has a “print” method that takes an OutputStream and dumps the code from that node into it. - * The stream {} supports a lot of options that control the output. - * You can specify whether you'd like to get human-readable (indented) output, the indentation level, whether you'd like to quote all properties in {} literals etc. - */ -export function OutputStream(options?: BeautifierOptions): OutputStream; - -export interface SourceMapOptions { - /** - * The compressed file name - */ - file?: string; - - /** - * The root URL to the original sources - */ - root?: string; - - /** - * The input source map. - * Useful when you compress code that was generated from some other source (possibly other programming language). - * If you have an input source map, pass it in this argument and Terser will generate a mapping that maps back - * to the original source (as opposed to the compiled code that you are compressing). - */ - orig?: {} | JSON; -} - -export interface SourceMap { - add(source: string, gen_line: number, gen_col: number, orig_line: number, orig_col: number, name?: string): void; - get(): MOZ_SourceMap.SourceMapGenerator; - toString(): string; -} - -/** - * The output stream keeps track of the current line/column in the output and can trivially generate a source mapping to the original code via Mozilla's source-map library. - * To use this functionality, you must load this library (it's automatically require-d by Terser in the NodeJS version, but in a browser you must load it yourself) - * and make it available via the global MOZ_SourceMap variable. - */ -export function SourceMap(options?: SourceMapOptions): SourceMap; - -export interface CompressorOptions { - // Join consecutive statemets with the “comma operator” - sequences?: boolean; - - // Optimize property access: a["foo"] → a.foo - properties?: boolean; - - // Discard unreachable code - dead_code?: boolean; - - // Discard “debugger” statements - drop_debugger?: boolean; - - // Some unsafe optimizations (see below) - unsafe?: boolean; - - // Optimize if-s and conditional expressions - conditionals?: boolean; - - // Optimize comparisons - comparisons?: boolean; - - // Evaluate constant expressions - evaluate?: boolean; - - // Optimize boolean expressions - booleans?: boolean; - - // Optimize loops - loops?: boolean; - - // Drop unused variables/functions - unused?: boolean; - - // Hoist function declarations - hoist_funs?: boolean; - - // Hoist variable declarations - hoist_vars?: boolean; - - // Optimize if-s followed by return/continue - if_return?: boolean; - - // Join var declarations - join_vars?: boolean; - - // Try to cascade `right` into `left` in sequences - cascade?: boolean; - - // Drop side-effect-free statements - side_effects?: boolean; - - // Warn about potentially dangerous optimizations/code - warnings?: boolean; - - // Global definitions - global_defs?: {}; -} - -/** - * The compressor is a tree transformer which reduces the code size by applying various optimizations on the AST - */ -export function Compressor(options?: CompressorOptions): AST_Toplevel; - -// TODO: - -/** - * Terser provides a TreeWalker {} and every node has a walk method that given a walker will apply your visitor to each node in the tree. - * Your visitor can return a non-falsy value in order to prevent descending the current node. - */ -export class TreeWalker { - constructor(visitor: visitor); - parent: () => AST_Scope; - stack: AST_Scope[]; -} - -export type visitor = (node: AST_Node, descend: () => void) => boolean | void; - -// TODO: - -/** - * The tree transformer is a special case of a tree walker. - * In fact it even inherits from TreeWalker and you can use the same methods, but initialization and visitor protocol are a bit different. - */ -export class TreeTransformer extends TreeWalker { - constructor(visitor: visitor, after: visitor); -} - -// TODO: http://lisperator.net/uglifyjs/ast - -export class AST_PropAccess extends AST_Node { -} - -export class AST_ObjectKeyVal extends AST_Node { -} - -export class AST_Scope extends AST_Node { - find_variable(name: string): AST_SymbolDeclaration; -} - -export class AST_Symbol extends AST_Node { - scope?: AST_Scope; - name: string; - thedef: unknown; -} - -export class AST_SymbolDeclaration extends AST_Symbol { - orig: AST_SymbolDeclaration[]; - references: AST_SymbolRef[]; - global: boolean; - undeclared: boolean; - constant: boolean; - mangledName?: string; - mangled_name?: string; -} - -export class AST_SymbolRef extends AST_Symbol { -} - -export class AST_Call extends AST_Node { - expression: { name?: string, property?: string }; - args: AST_Node[]; -} -export class AST_String extends AST_Node { - value: string; -} -export class AST_Lambda extends AST_Node { - name?: string; -} -export class AST_SymbolMethod extends AST_Node { - name?: string; -} -export class AST_ConciseMethod extends AST_Node { -} -export class AST_SymbolVar extends AST_Node { - name?: string; -} diff --git a/types/terser/terser-tests.ts b/types/terser/terser-tests.ts deleted file mode 100644 index 49b9190070..0000000000 --- a/types/terser/terser-tests.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// - -import { OutputQuoteStyle, minify } from 'terser'; - -let code: any; - -code = { - "file1.js": "function add(first, second) { return first + second; }", - "file2.js": "console.log(add(1 + 2, 3 + 4));" -}; - -minify(code); - -code = "function add(first, second) { return first + second; }"; -minify(code); - -minify(code); - -const output = minify(code, { - warnings: true, - mangle: { - properties: { - regex: /reg/ - } - }, - compress: { - arguments: true - } -}); - -if (output.warnings) { - output.warnings.filter(x => x === 'Dropping unused variable'); -} diff --git a/types/theo/index.d.ts b/types/theo/index.d.ts index ffc5dceaf7..dc67721b95 100644 --- a/types/theo/index.d.ts +++ b/types/theo/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for theo 8.1 +// Type definitions for Theo 8.1 // Project: https://github.com/salesforce-ux/theo // Definitions by: Pete Petrash // Niko Laitinen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.2 +// TypeScript Version: 2.3 import { Collection, Map, List, OrderedMap } from "immutable"; @@ -35,21 +35,16 @@ export type Format = | "android.xml" | "aura.tokens"; -export function convert(options: ConvertOptions): Promise; -export function convertSync(options: ConvertOptions): string; -export function registerFormat( - name: string, - format: FormatResultFn | string -): void; -export function registerTransform( - name: string, - valueTransforms: string[] -): void; -export function registerValueTransform( - name: string, - predicate: (prop: Prop) => boolean, - transform: (prop: Prop) => string | number -): void; +export type Transform = "raw" | "ios" | "android" | "web"; + +export type ValueTransform = + | "color/rgb" + | "color/hex" + | "color/hex8rgba" + | "color/hex8argb" + | "percentage/float" + | "relative/pixel" + | "relative/pixelValue"; export type Prop = Map; export type Props = List; @@ -78,8 +73,8 @@ export interface ConvertOptions { resolveMetaAliases?: boolean; } -export interface TransformOptions { - type?: string; +export interface TransformOptions { + type?: Transform | T; file: string; data?: string; } @@ -91,3 +86,19 @@ export interface FormatOptions { transformPropName?: (name: string) => string ) => void; } + +export function convert(options: ConvertOptions): Promise; +export function convertSync(options: ConvertOptions): string; +export function registerFormat( + name: Format | T, + format: FormatResultFn | string +): void; +export function registerTransform< + T extends string = never, + V extends string = never +>(name: Transform | T, valueTransforms: ValueTransform[] | V[]): void; +export function registerValueTransform( + name: ValueTransform | T, + predicate: (prop: Prop) => boolean, + transform: (prop: Prop) => string | number +): void; diff --git a/types/theo/theo-tests.ts b/types/theo/theo-tests.ts index ceaaf9649c..c854fc0dc3 100644 --- a/types/theo/theo-tests.ts +++ b/types/theo/theo-tests.ts @@ -11,8 +11,30 @@ theo.convert({ } }); +theo.convertSync({ + transform: { + type: "raw", + file: "file", + data: "data" + }, + format: { + type: "custom-properties.css" + } +}); + +// Register a provided transform with a provided value transform +theo.registerTransform("web", ["color/hex"]); + +// Register a provided transform with custom value transform theo.registerTransform("web", ["relative/pixelValue"]); +// Register a custom transform with custom value transform +theo.registerTransform("custom", ["relative/pixelValue"]); + +// Register a custom transform with provided value transform +theo.registerTransform("custom", ["color/rgb"]); + +// Register custom formatting function for a provided format theo.registerFormat( "cssmodules.css", `{{#each props as |prop|}} @@ -20,6 +42,7 @@ theo.registerFormat( {{/each}}` ); +// Register a custom value transform theo.registerValueTransform( "relative/pixelValue", prop => prop.get("category") === "sizing", @@ -28,3 +51,13 @@ theo.registerValueTransform( return parseFloat(value.replace(/rem/g, "")) * 16; } ); + +// Override a custom value transform +theo.registerValueTransform( + "relative/pixel", + prop => prop.get("category") === "sizing", + prop => { + const value = prop.get("value").toString(); + return `${parseFloat(value.replace(/rem/g, "")) * 16}px`; + } +); diff --git a/types/theo/tslint.json b/types/theo/tslint.json index 3db14f85ea..71ee04c4e1 100644 --- a/types/theo/tslint.json +++ b/types/theo/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false + } +} diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 08b64250c8..f929ef2383 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -17,7 +17,6 @@ // Daniel Hritzkiv , // Apurva Ojas , // Tiger Oakes , -// Seth Kingsley , // Ethan Kay , // Methuselah96 // Dilip Ramirez @@ -25,6 +24,7 @@ // Zhang Hao // Konstantin Lukaschenko // Daniel Yim +// Philippe Suter // Definitions: https://github.com//DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 7d871cae58..e7291b9402 100755 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -5273,13 +5273,23 @@ export class Line extends Object3D { geometry: Geometry | BufferGeometry; material: Material | Material[]; - type: "Line"; + type: "Line" | "LineLoop" | "LineSegments"; isLine: true; computeLineDistances(): this; raycast(raycaster: Raycaster, intersects: Intersection[]): void; } +export class LineLoop extends Line { + constructor( + geometry?: Geometry | BufferGeometry, + material?: Material | Material[] + ); + + type: "LineLoop"; + isLineLoop: true; +} + /** * @deprecated */ @@ -5295,6 +5305,9 @@ export class LineSegments extends Line { material?: Material | Material[], mode?: number ); + + type: "LineSegments"; + isLineSegments: true; } export class Mesh extends Object3D { diff --git a/types/tinycon/index.d.ts b/types/tinycon/index.d.ts index 3f385603cc..03d1ce4dc8 100644 --- a/types/tinycon/index.d.ts +++ b/types/tinycon/index.d.ts @@ -1,9 +1,10 @@ // Type definitions for tinycon 0.6 // Project: https://github.com/tommoor/tinycon // Definitions by: Daniel Waxweiler +// Julian Hundeloh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function setBubble(count: number): void; +export function setBubble(count: number | string | null): void; export function setOptions(options: TinyconOptions): void; @@ -11,7 +12,7 @@ export interface TinyconOptions { abbreviate?: boolean; background?: string; color?: string; - fallback?: boolean; + fallback?: boolean | 'force'; font?: string; height?: number; width?: number; diff --git a/types/tinycon/tinycon-tests.ts b/types/tinycon/tinycon-tests.ts index b4bcc304ac..fb898630e7 100644 --- a/types/tinycon/tinycon-tests.ts +++ b/types/tinycon/tinycon-tests.ts @@ -10,4 +10,16 @@ Tinycon.setOptions({ width: 7 }); +Tinycon.setOptions({ + abbreviate: false, + background: '#549A2F', + color: '#ffffff', + fallback: 'force', + font: '10px arial', + height: 9, + width: 7 +}); + Tinycon.setBubble(7); + +Tinycon.setBubble(null); diff --git a/types/toastr/index.d.ts b/types/toastr/index.d.ts index 8d5d163f7b..847cb2e7fc 100644 --- a/types/toastr/index.d.ts +++ b/types/toastr/index.d.ts @@ -320,10 +320,19 @@ interface Toastr { (toast: JQuery, clearOptions: {force: boolean}): void; }; /** - * Removes all toasts (without animation) + * Removes toasts (without animation) */ remove: { + /** + * Removes all toasts (without animation) + */ (): void; + /** + * Removes specific toast (without animation) + * + * @param toast Toast to remove + */ + (toast: JQuery): void; }; /** * Create an error toast diff --git a/types/tokenizr/index.d.ts b/types/tokenizr/index.d.ts new file mode 100644 index 0000000000..1b1615e1b8 --- /dev/null +++ b/types/tokenizr/index.d.ts @@ -0,0 +1,268 @@ +// Type definitions for tokenizr 1.5 +// Project: https://github.com/rse/tokenizr +// Definitions by: Nicholas Sorokin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Tokenizr { + constructor(); + + /** + * Configure a tokenization after-rule callback + */ + after(action: Action): this; + + /** + * Execute multiple alternative callbacks + */ + alternatives(...alternatives: Array<(this: this) => any>): any; + + /** + * Configure a tokenization before-rule callback + */ + before(action: Action): this; + + /** + * Open tokenization transaction + */ + begin(): this; + + /** + * Close (successfully) tokenization transaction + */ + commit(): this; + + /** + * Consume the current token (by expecting it to be a particular symbol) + */ + consume(type: string, value: any): Token; + + /** + * Configure debug operation + */ + debug(enableDebug: boolean): this; + + /** + * Determine depth of still open tokenization transaction + */ + depth(): number; + + /** + * Create an error message for the current position + */ + error(message?: string): ParsingError; + + /** + * Configure a tokenization finish callback + */ + finish(action: (this: ActionContext, ctx: ActionContext) => void): this; + + /** + * Provide (new) input string to tokenize + */ + input(input: string): this; + + /** + * Peek at the next token or token at particular offset + */ + peek(offset?: number): Token; + + /** + * Pop state + */ + pop(): string; + + /** + * Push state + */ + push(state: string): this; + + /** + * Reset the internal state + */ + reset(): this; + + /** + * Close (unsuccessfully) tokenization transaction + */ + rollback(): this; + + /** + * Configure a tokenization rule + */ + rule(pattern: RegExp, action: RuleAction, name?: string): this; + rule( + state: string, + pattern: RegExp, + action: RuleAction, + name: string + ): this; + + /** + * Skip one or more tokens + */ + skip(len?: number): this; + + /** + * Get/set state + */ + state(): string; + /** + * Replaces the current state + */ + state(state: string): this; + + /** + * Set a tag + */ + tag(tag: string): this; + + /** + * Check whether tag is set + */ + tagged(tag: string): boolean; + + /** + * Determine and return next token + */ + token(): Token | null; + + /** + * Determine and return all tokens + */ + tokens(): Token[]; + + /** + * Unset a tag + */ + untag(tag: string): this; + + static readonly ParsingError: typeof ParsingError; + static readonly ActionContext: typeof ActionContext; + static readonly Token: typeof Token; +} + +type Action = ( + this: ActionContext, + ctx: ActionContext, + found: RegExpExecArray, + rule: { + state: string; + pattern: RegExp; + action: RuleAction; + name: string; + } +) => void; + +type RuleAction = ( + this: ActionContext, + ctx: ActionContext, + found: RegExpExecArray +) => void; + +declare class ActionContext { + constructor(e: any); + + /** + * Accept current matching as a new token + */ + accept(type: string, value?: any): this; + + /** + * Store and retrieve user data attached to context + */ + data(key: string, value?: any): any; + + /** + * Mark current matching to be ignored + */ + ignore(): this; + + /** + * Retrieve information of current matching + */ + info(): { line: number; column: number; pos: number; len: number }; + + /** + * Pop state + */ + pop(): string; + + /** + * Push state + */ + push(state: string): this; + + /** + * Rark current matching to be rejected + */ + reject(): this; + + /** + * Mark current matching to be repeated from scratch + */ + repeat(): this; + + /** + * Get/set state + */ + state(): string; + /** + * Replaces the current state + */ + state(state: string): this; + + /** + * Immediately stop tokenization + */ + stop(): this; + + /** + * Set a tag + */ + tag(tag: string): this; + + /** + * Check whether tag is set + */ + tagged(tag: string): boolean; + + /** + * Unset a tag + */ + untag(tag: string): this; +} + +declare class ParsingError extends Error { + constructor( + message: string, + pos: number, + line: number, + column: number, + input: string + ); + + /** + * Render a useful string representation + */ + toString(): string; +} + +declare class Token { + constructor( + type: string, + value: any, + text: string, + pos?: number, + line?: number, + column?: number + ); + + isA(type: string, value?: any): boolean; + + /** + * Render a useful string representation + */ + toString(): string; +} + +export = Tokenizr; diff --git a/types/tokenizr/tokenizr-tests.ts b/types/tokenizr/tokenizr-tests.ts new file mode 100644 index 0000000000..a633a14a75 --- /dev/null +++ b/types/tokenizr/tokenizr-tests.ts @@ -0,0 +1,42 @@ +import Tokenizr = require('tokenizr'); + +const lexer = new Tokenizr(); + +lexer.rule(/[a-zA-Z_][a-zA-Z0-9_]*/, (ctx, match) => { + ctx.accept('id'); +}); + +lexer.rule(/[+-]?[0-9]+/, (ctx, match) => { + ctx.accept('number', parseInt(match[0], 10)); +}); + +lexer.rule(/"((?:\\"|[^\r\n])*)"/, (ctx, match) => { + ctx.accept('string', match[1].replace(/\\"/g, '"')); +}); + +lexer.rule(/\/\/[^\r\n]*\r?\n/, (ctx, match) => { + ctx.ignore(); +}); + +lexer.rule(/[ \t\r\n]+/, (ctx, match) => { + ctx.ignore(); +}); + +lexer.rule(/./, (ctx, match) => { + ctx.accept('char'); +}); + +const cfg = `foo { + baz = 1 // sample comment + bar { + quux = 42 + hello = "hello \"world\"!" + } + quux = 7 +}`; + +lexer.input(cfg); +lexer.debug(true); +lexer.tokens().forEach(token => { + // ... +}); diff --git a/types/tokenizr/tsconfig.json b/types/tokenizr/tsconfig.json new file mode 100644 index 0000000000..7b24906172 --- /dev/null +++ b/types/tokenizr/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "tokenizr-tests.ts"] +} diff --git a/types/tokenizr/tslint.json b/types/tokenizr/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/tokenizr/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/transducers-js/transducers-js-tests.ts b/types/transducers-js/transducers-js-tests.ts index 3e69ae06ed..f0f5facf41 100644 --- a/types/transducers-js/transducers-js-tests.ts +++ b/types/transducers-js/transducers-js-tests.ts @@ -161,12 +161,12 @@ function advancedIntoExample() { const string: string = into("", t.map((s: string) => s + s), ["a", "b"]); const object1: { [key: string]: number } = into( {}, - t.map((s: string) => [s, s.length]), + t.map((s: string) => [s, s.length] as [string, number]), ["a", "b"], ); const object2: { [key: string]: boolean } = into( {}, - t.map((kv: [string, number]) => [kv[0], true]), + t.map((kv: [string, number]) => [kv[0], true] as [string, boolean]), { a: 1, b: 2 } ); } diff --git a/types/utif/index.d.ts b/types/utif/index.d.ts index 569dfd949c..2ac2ff6242 100644 --- a/types/utif/index.d.ts +++ b/types/utif/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for utif 2.0 +// Type definitions for utif 3.0 // Project: https://github.com/photopea/UTIF.js // Definitions by: Jan Pesa // Naveen Kumar Sangi +// Massimiliano Caniparoli // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import 'node'; @@ -17,10 +18,10 @@ export type TiffTag = string[] | number[]; */ // tslint:disable-next-line:interface-name export interface IFD { - [property: string]: TiffTag | number | Uint8Array; - data: Uint8Array; - width: number; - height: number; + [property: string]: TiffTag | number | Uint8Array; + data: Uint8Array; + width: number; + height: number; } /** @@ -31,13 +32,13 @@ export interface IFD { export function decode(buffer: Buffer | ArrayBuffer): IFD[]; /** - * Loops through each IFD. If there is an image inside it, it is decoded and three new properties are added to the IFD: width, height and data. + * If there is an image inside the IFD, it is decoded and three new properties are added to the IFD: width, height and data. * Note: TIFF files may have various number of channels and various color depth. The interpretation of data depends on many tags (see the TIFF 6 specification). * * @param buffer A Buffer or ArrayBuffer containing TIFF or EXIF data - * @param ifds An array of image file directories parsed via UTIF.decode() + * @param ifd The element of the output of UTIF.decode() */ -export function decodeImages(buffer: Buffer | ArrayBuffer, ifds: IFD[]): void; +export function decodeImage(buffer: Buffer | ArrayBuffer, ifd: IFD): void; /** * Returns Uint8Array of the image in RGBA format, 8 bits per channel (ready to use in context2d.putImageData() etc.) diff --git a/types/utif/utif-tests.ts b/types/utif/utif-tests.ts index 66455e2f4a..4f30237ed9 100644 --- a/types/utif/utif-tests.ts +++ b/types/utif/utif-tests.ts @@ -10,6 +10,6 @@ UTIF.encodeImage(rgba, 8, 8); // $ExpectType ArrayBuffer UTIF.encode(IFDs); // $ExpectType void -UTIF.decodeImages(new ArrayBuffer(64), IFDs); +UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]); // $ExpectType void UTIF.replaceIMG(); diff --git a/types/vexflow/index.d.ts b/types/vexflow/index.d.ts index c25ac00958..2840f35872 100644 --- a/types/vexflow/index.d.ts +++ b/types/vexflow/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for VexFlow v1.2.85 +// Type definitions for VexFlow v1.2.88 // Project: http://vexflow.com // Definitions by: Roman Quiring // Sebastian Haas // Basti Hoffmann // Simon Schmid +// Benjamin Giesinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped //inconsistent namespace: this is a helper funtion from tables.js and should not pollute the global namespace! @@ -54,8 +55,8 @@ declare namespace Vex { beginPath() : IRenderContext; moveTo(x : number, y : number) : IRenderContext; lineTo(x : number, y : number) : IRenderContext; - bezierCurveToTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : IRenderContext; - quadraticCurveToTo(x1 : number, y1 : number, x2 : number, y2 : number) : IRenderContext; + bezierCurveTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : IRenderContext; + quadraticCurveTo(x1 : number, y1 : number, x2 : number, y2 : number) : IRenderContext; arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, antiClockwise : boolean) : IRenderContext; glow() : IRenderContext; fill() : IRenderContext; @@ -103,6 +104,7 @@ declare namespace Vex { const STAVE_LINE_THICKNESS : number; const TIME4_4 : {num_beats : number, beat_value : number, resolution : number}; const unicode : {[name : string] : string}; //inconsistent API: this should be private and have a wrapper function like the other tables + const DEFAULT_NOTATION_FONT_SCALE: number; function clefProperties(clef : string) : {line_shift : number}; function keyProperties(key : string, clef : string, params : {octave_shift? : number}) : {key : string, octave : number, line : number, int_value : number, accidental : string, code : number, stroke : number, shift_right : number, displaced : boolean}; function integerToNote(integer : number) : string; @@ -211,8 +213,9 @@ declare namespace Vex { drawRepeatBar(stave : Stave, x : number, begin : boolean) : void; } - class Beam { + class Beam { constructor(notes : StemmableNote[], auto_stem? : boolean); + setStyle(style : {shadowColor? : string, shadowBlur? : string, fillStyle? : string, strokeStyle? : string}) : Beam; setContext(context : IRenderContext) : Beam; getNotes() : StemmableNote[]; getBeamCount() : number; @@ -275,8 +278,8 @@ declare namespace Vex { beginPath() : CanvasContext; moveTo(x : number, y : number) : CanvasContext; lineTo(x : number, y : number) : CanvasContext; - bezierCurveToTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : CanvasContext; - quadraticCurveToTo(x1 : number, y1 : number, x2 : number, y2 : number) : CanvasContext; + bezierCurveTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : CanvasContext; + quadraticCurveTo(x1 : number, y1 : number, x2 : number, y2 : number) : CanvasContext; arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, antiClockwise : boolean) : CanvasContext; glow() : CanvasContext; fill() : CanvasContext; @@ -438,8 +441,9 @@ declare namespace Vex { } class FretHandFinger extends Modifier { - constructor(number : number); + constructor(number : number|string); static format(nums : FretHandFinger[], state : {left_shift : number, right_shift : number, text_line : number}) : void; + finger: number|string; getNote() : Note; setNote(note : Note) : FretHandFinger; getIndex() : number; @@ -488,11 +492,16 @@ declare namespace Vex { class GraceNote extends StaveNote { constructor(note_struct : {slash? : boolean, type? : string, dots? : number, duration : string, clef? : string, keys : string[], octave_shift? : number, auto_stem? : boolean, stem_direction? : number}); + static LEDGER_LINE_OFFSET : number; getStemExtension() : number; getCategory() : string; draw() : void; } + namespace GraceNote { + const SCALE : number; + } + class GraceNoteGroup extends Modifier { //TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed setWidth(width : number) : Modifier; @@ -621,7 +630,8 @@ declare namespace Vex { getTickMultiplier() : Fraction; applyTickMultiplier(numerator : number, denominator : number) : void; setDuration(duration : Fraction) : void; - + preFormatted : boolean; + constructor(note_struct : {type? : string, dots? : number, duration : string}); getPlayNote() : any; setPlayNote(note : any) : Note; @@ -757,8 +767,8 @@ declare namespace Vex { beginPath() : RaphaelContext; moveTo(x : number, y : number) : RaphaelContext; lineTo(x : number, y : number) : RaphaelContext; - bezierCurveToTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : RaphaelContext; - quadraticCurveToTo(x1 : number, y1 : number, x : number, y : number) : RaphaelContext; //inconsistent name: x, y -> x2, y2 + bezierCurveTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : RaphaelContext; + quadraticCurveTo(x1 : number, y1 : number, x : number, y : number) : RaphaelContext; //inconsistent name: x, y -> x2, y2 arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, antiClockwise : boolean) : RaphaelContext; glow() : {width : number, fill : boolean, opacity : number, offsetx : number, offsety : number, color : string}; //inconsistent type : Object -> RaphaelContext fill() : RaphaelContext; @@ -805,6 +815,7 @@ declare namespace Vex { class Stave { constructor(x : number, y : number, width : number, options? : {vertical_bar_width? : number, glyph_spacing_px? : number, num_lines? : number, fill_style? : string, spacing_between_lines_px? : number, space_above_staff_ln? : number, space_below_staff_ln? : number, top_text_position? : number}); + options: {vertical_bar_width? : number, glyph_spacing_px? : number, num_lines? : number, fill_style? : string, left_bar? : boolean, right_bar? : boolean, spacing_between_lines_px? : number, space_above_staff_ln? : number, space_below_staff_ln? : number, top_text_position? : number}; resetLines() : void; setNoteStartX(x : number) : Stave; getNoteStartX() : number; @@ -827,7 +838,7 @@ declare namespace Vex { setRepetitionTypeRight(type : Repetition.type, y : number) : Stave; setVoltaType(type : Volta.type, number_t : number, y : number) : Stave; setSection(section : string, y : number) : Stave; - setTempo(tempo : {name? : string, duration : string, dots : number, bpm : number}, y : number) : Stave; + setTempo(tempo : {name? : string, duration : string, dots : boolean, bpm : number}, y : number) : Stave; setText(text : string, position : Modifier.Position, options? : {shift_x? : number, shift_y? : number, justification? : TextNote.Justification}) : Stave; getHeight() : number; getSpacingBetweenLines() : number; @@ -858,10 +869,15 @@ declare namespace Vex { getConfigForLines() : {visible : boolean}[]; setConfigForLine(line_number : number, line_config : {visible : boolean}) : Stave; setConfigForLines(lines_configuration : {visible : boolean}[]) : Stave; + getModifiers(position? : number, category? : string) : StaveModifier[]; } class StaveConnector { constructor(top_stave : Stave, bottom_stave : Stave); + top_stave : Stave; + bottom_stave : Stave; + thickness : number; + x_shift : number; setContext(ctx : IRenderContext) : StaveConnector; setType(type : StaveConnector.type) : StaveConnector; setText(text : string, text_options? : {shift_x? : number, shift_y? : number}) : StaveConnector; @@ -918,6 +934,9 @@ declare namespace Vex { addToStaveEnd(stave : Stave, firstGlyph : boolean) : StaveModifier; addModifier() : void; addEndModifier() : void; + getPosition() : number; + getWidth() : number; + getPadding(index: number) : number; } namespace StaveModifier { @@ -929,10 +948,13 @@ declare namespace Vex { //TODO remove the following lines once TypeScript allows subclass overrides with type changes and/or inconsistencies mentioned below are fixed buildStem() : StemmableNote; setStave(stave : Stave) : Note; - addModifier(modifier : Modifier, index? : number) : Note; + //TODO: vexflow actualy managed to have Note use modifier, index and stavenote index,modifier. To use the function in + // Typescript we need to allow both. The name is the correct type :( + addModifier(index : any, modifier? : any) : Note; getModifierStartXY() : {x : number, y : number}; getDots() : number; - + x_shift: number; + constructor(note_struct : {type? : string, dots? : number, duration : string, clef? : string, keys : string[], octave_shift? : number, auto_stem? : boolean, stem_direction? : number}); static DEBUG : boolean; static format(notes : StaveNote[] , state : {left_shift : number, right_shift : number, text_line : number}) : boolean; @@ -959,11 +981,11 @@ declare namespace Vex { getLineForRest() : number; getModifierStartXY(position : Modifier.Position, index : number) : {x : number, y : number}; setStyle(style : {shadowColor? : string, shadowBlur? : string, fillStyle? : string, strokeStyle? : string}) : void; // inconsistent type: void -> StaveNote + setStemStyle(style : {shadowColor? : string, shadowBlur? : string, fillStyle? : string, strokeStyle? : string}) : void; setKeyStyle(index : number, style : {shadowColor? : string, shadowBlur? : string, fillStyle? : string, strokeStyle? : string}) : StaveNote; setKeyLine(index : number, line : number) : StaveNote; getKeyLine(index : number) : number; addToModifierContext(mContext : ModifierContext) : StaveNote; - addModifier(index : number, modifier : Modifier) : StaveNote; addAccidental(index : number, accidental : Accidental) : StaveNote; addArticulation(index : number, articulation : Articulation) : StaveNote; addAnnotation(index : number, annotation : Annotation) : StaveNote; @@ -1084,6 +1106,9 @@ declare namespace Vex { constructor(note_struct : {type? : string, dots? : number, duration : string}); static DEBUG : boolean; + flag: Glyph; + getAttribute(attr : string) : any; + setFlagStyle(style_struct : {shadowColor? : string, shadowBlur? : string, fillStyle? : string, strokeStyle? : string}) : void; getStem() : Stem; setStem(stem : Stem) : StemmableNote; buildStem() : StemmableNote; @@ -1108,8 +1133,11 @@ declare namespace Vex { //TODO remove the following lines once TypeScript allows subclass overrides with type changes setNote(note : Note) : StringNumber; - constructor(number : number); + // actually this is not really consistent in the vexflow code "ctx.measureText(this.string_number).width" looks + // like it is a string. But from the use of it it might be a number ?! + constructor(number : number|string); static format(nums : StringNumber[], state : {left_shift : number, right_shift : number, text_line : number}) : boolean; + string_number : number|string; getNote() : Note; setNote(note : StemmableNote) : StringNumber; getIndex() : number; @@ -1130,7 +1158,7 @@ declare namespace Vex { } class Stroke extends Modifier { - constructor(type : Stroke.Type, options : {all_voices? : boolean}); + constructor(type : Stroke.Type, options? : {all_voices? : boolean}); static format(strokes : Stroke[], state : {left_shift : number, right_shift : number, text_line : number}) : boolean; getPosition() : Modifier.Position; addEndNote(note : Note) : Stroke; @@ -1138,14 +1166,18 @@ declare namespace Vex { } namespace Stroke { - const enum Type {BRUSH_DOWN = 1, BRUSH_UP, ROLL_DOWN, ROLL_UP, RASQUEDO_DOWN, RASQUEDO_UP} + const enum Type {BRUSH_DOWN = 1, BRUSH_UP, ROLL_DOWN, ROLL_UP, RASQUEDO_DOWN, RASQUEDO_UP, ARPEGGIO_DIRECTIONLESS} const CATEGORY : string; } class SVGContext implements IRenderContext { constructor(element : HTMLElement); + svg: SVGElement; + state: any; + attributes: any; + lineWidth: number; iePolyfill() : boolean; - setFont(family : string, size : number, weight? : number) : SVGContext; + setFont(family : string, size : number, weight? : number|string) : SVGContext; setRawFont(font : string) : SVGContext; setFillStyle(style : string) : SVGContext; setBackgroundFillStyle(style : string) : SVGContext; @@ -1165,8 +1197,8 @@ declare namespace Vex { beginPath() : SVGContext; moveTo(x : number, y : number) : SVGContext; lineTo(x : number, y : number) : SVGContext; - bezierCurveToTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : SVGContext; - quadraticCurveToTo(x1 : number, y1 : number, x : number, y : number) : SVGContext; //inconsistent: x, y -> x2, y2 + bezierCurveTo(x1 : number, y1 : number, x2 : number, y2 : number, x : number, y : number) : SVGContext; + quadraticCurveTo(x1 : number, y1 : number, x : number, y : number) : SVGContext; //inconsistent: x, y -> x2, y2 arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, antiClockwise : boolean) : SVGContext; closePath() : SVGContext; glow() : SVGContext; @@ -1236,6 +1268,9 @@ declare namespace Vex { class TextBracket { constructor(bracket_data : {start : Note, stop : Note, text? : string, superscript? : string, position? : TextBracket.Positions}); static DEBUG : boolean; + start : Note; + stop : Note; + position : TextBracket.Positions; applyStyle(context : IRenderContext) : TextBracket; setDashed(dashed : boolean, dash? : number[]) : TextBracket; setFont(font : {family : string, size : number, weight : string}) : TextBracket; @@ -1372,7 +1407,7 @@ declare namespace Vex { } class Tuplet { - constructor(notes : StaveNote[], options? : {num_notes? : number, beats_occupied? : number}); + constructor(notes : StaveNote[], options? : {location? : number, bracketed? : boolean, ratioed : boolean, num_notes? : number, notes_occupied? : number, y_offset? : number}); attach() : void; detach() : void; setContext(context : IRenderContext) : Tuplet; diff --git a/types/vue-chartkick/index.d.ts b/types/vue-chartkick/index.d.ts new file mode 100644 index 0000000000..79f70d084d --- /dev/null +++ b/types/vue-chartkick/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for vue-chartkick 0.5 +// Project: https://github.com/ankane/vue-chartkick#readme +// Definitions by: CNS Media +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { PluginObject } from "vue"; + +interface VueChartkickPlugin extends PluginObject<{ adapter: any }> { + version: string; + addAdapter: (library: any) => void; +} + +declare const VueChartkick: VueChartkickPlugin; +export default VueChartkick; diff --git a/types/vue-chartkick/package.json b/types/vue-chartkick/package.json new file mode 100644 index 0000000000..1c62b73c5c --- /dev/null +++ b/types/vue-chartkick/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "vue": ">=2.0.0" + } +} diff --git a/types/i18next-browser-languagedetector/tsconfig.json b/types/vue-chartkick/tsconfig.json similarity index 90% rename from types/i18next-browser-languagedetector/tsconfig.json rename to types/vue-chartkick/tsconfig.json index 32755315aa..2d517d3efd 100644 --- a/types/i18next-browser-languagedetector/tsconfig.json +++ b/types/vue-chartkick/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "i18next-browser-languagedetector-tests.ts" + "vue-chartkick-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/vue-chartkick/tslint.json b/types/vue-chartkick/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/vue-chartkick/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/vue-chartkick/vue-chartkick-tests.ts b/types/vue-chartkick/vue-chartkick-tests.ts new file mode 100644 index 0000000000..4f938eb54e --- /dev/null +++ b/types/vue-chartkick/vue-chartkick-tests.ts @@ -0,0 +1,5 @@ +import VueChartkick from 'vue-chartkick'; +import Vue from "vue"; +import * as Chart from "chart.js"; + +Vue.use(VueChartkick, {adapter: Chart}); diff --git a/types/wait-for-localhost/index.d.ts b/types/wait-for-localhost/index.d.ts index 080c8a800c..e0262e563a 100644 --- a/types/wait-for-localhost/index.d.ts +++ b/types/wait-for-localhost/index.d.ts @@ -1,8 +1,26 @@ -// Type definitions for wait-for-localhost 2.0 +// Type definitions for wait-for-localhost 3.0 // Project: https://github.com/sindresorhus/wait-for-localhost#readme // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = waitForLocalhost; -declare function waitForLocalhost(port?: number): Promise; +/** + * Wait for localhost to be ready. + */ +declare function waitForLocalhost(options?: waitForLocalhost.Options): Promise; + +declare namespace waitForLocalhost { + interface Options { + /** + * @default 80 + */ + port?: number; + + /** + * Use the `GET` HTTP-method instead of `HEAD` to check if the server is running. + * @default false + */ + useGet?: boolean; + } +} diff --git a/types/wait-for-localhost/wait-for-localhost-tests.ts b/types/wait-for-localhost/wait-for-localhost-tests.ts index 95d43efee2..a4f95b9622 100644 --- a/types/wait-for-localhost/wait-for-localhost-tests.ts +++ b/types/wait-for-localhost/wait-for-localhost-tests.ts @@ -1,5 +1,5 @@ import waitForLocalhost = require('wait-for-localhost'); -// $ExpectType Promise -waitForLocalhost(); -waitForLocalhost(8080); +waitForLocalhost(); // $ExpectType Promise +waitForLocalhost({ port: 8080 }); // $ExpectType Promise +waitForLocalhost({ useGet: true }); // $ExpectType Promise diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 1c423c428c..fe3dc638e1 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -610,6 +610,8 @@ declare namespace webpack { name?: boolean | string | ((...args: any[]) => any); /** Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks) */ cacheGroups?: false | string | ((...args: any[]) => any) | RegExp | { [key: string]: CacheGroupsOptions | false }; + /** Override the default name separator (~) when generating names automatically (name: true) */ + automaticNameDelimiter?: string; } interface RuntimeChunkOptions { /** The name or name factory for the runtime chunks. */ diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 8c06b3de10..e2a9c7a5fb 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -87,16 +87,14 @@ declare namespace wx { * @version 1.4.0 */ onProgressUpdate( - callback?: ( - res: { - /** 上传进度百分比 */ - progress: number; - /** 已经上传的数据长度,单位 Bytes */ - totalBytesSent: number; - /** 预期需要上传的数据总长度,单位 Bytes */ - totalBytesExpectedToSend: number; - } - ) => void + callback?: (res: { + /** 上传进度百分比 */ + progress: number; + /** 已经上传的数据长度,单位 Bytes */ + totalBytesSent: number; + /** 预期需要上传的数据总长度,单位 Bytes */ + totalBytesExpectedToSend: number; + }) => void ): void; /** * 中断下载任务 @@ -135,16 +133,14 @@ declare namespace wx { * @version 1.4.0 */ onProgressUpdate( - callback?: ( - res: { - /** 下载进度百分比 */ - progress: number; - /** 已经下载的数据长度,单位 Bytes */ - totalBytesWritten: number; - /** 预期需要下载的数据总长度,单位 Bytes */ - totalBytesExpectedToWrite: number; - } - ) => void + callback?: (res: { + /** 下载进度百分比 */ + progress: number; + /** 已经下载的数据长度,单位 Bytes */ + totalBytesWritten: number; + /** 预期需要下载的数据总长度,单位 Bytes */ + totalBytesExpectedToWrite: number; + }) => void ): void; /** * 中断下载任务 @@ -1147,12 +1143,7 @@ declare namespace wx { * @version 1.1.0 */ function onNetworkStatusChange( - callback: ( - res: { - isConnected: boolean; - networkType: networkType; - } - ) => void + callback: (res: { isConnected: boolean; networkType: networkType }) => void ): void; // 设备-----加速度计 interface AccelerometerData { @@ -1391,11 +1382,7 @@ declare namespace wx { * @version 1.1.0 */ function onBluetoothDeviceFound( - callback: ( - res: { - devices: BluetoothDevice[]; - } - ) => void + callback: (res: { devices: BluetoothDevice[] }) => void ): void; interface GetConnectedBluetoothDevicesOptions extends BaseOptions { services: string[]; @@ -1604,43 +1591,39 @@ declare namespace wx { * 监听低功耗蓝牙连接的错误事件,包括设备丢失,连接异常断开等等。 */ function onBLEConnectionStateChanged( - callback: ( - res: { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 连接目前的状态 - */ - connected: boolean; - } - ) => void + callback: (res: { + /** + * 蓝牙设备 id,参考 device 对象 + */ + deviceId: string; + /** + * 连接目前的状态 + */ + connected: boolean; + }) => void ): void; /** * 监听低功耗蓝牙设备的特征值变化。必须先启用notify接口才能接收到设备推送的notification。 */ function onBLECharacteristicValueChange( - callback: ( - res: { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 特征值所属服务 uuid - */ - serviceId: string; - /** - * 特征值 uuid - */ - characteristicId: string; - /** - * 特征值最新的值 - */ - value: ArrayBuffer; - } - ) => void + callback: (res: { + /** + * 蓝牙设备 id,参考 device 对象 + */ + deviceId: string; + /** + * 特征值所属服务 uuid + */ + serviceId: string; + /** + * 特征值 uuid + */ + characteristicId: string; + /** + * 特征值最新的值 + */ + value: ArrayBuffer; + }) => void ): void; // #region iBeacon interface StartBeaconDiscoveryOptions extends BaseOptions { @@ -3729,9 +3712,9 @@ declare namespace wx { type DefaultProps = object | Record; - type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (( - k: infer I, - ) => void) + type UnionToIntersection = (U extends any + ? (k: U) => void + : never) extends ((k: infer I) => void) ? I : never; @@ -3743,20 +3726,26 @@ declare namespace wx { __DO_NOT_USE_INTERNAL_FIELD_METHODS: Methods; } - type UnboxBehaviorData = T extends Behavior<{}, {}, {}> ? T['__DO_NOT_USE_INTERNAL_FIELD_DATA'] : {}; - type UnboxBehaviorProps = T extends Behavior<{}, {}, {}> ? T['__DO_NOT_USE_INTERNAL_FIELD_PROPS'] : {}; - type UnboxBehaviorMethods = T extends Behavior<{}, {}, {}> ? T['__DO_NOT_USE_INTERNAL_FIELD_METHODS'] : {}; + type UnboxBehaviorData = T extends Behavior<{}, {}, {}> + ? T["__DO_NOT_USE_INTERNAL_FIELD_DATA"] + : {}; + type UnboxBehaviorProps = T extends Behavior<{}, {}, {}> + ? T["__DO_NOT_USE_INTERNAL_FIELD_PROPS"] + : {}; + type UnboxBehaviorMethods = T extends Behavior<{}, {}, {}> + ? T["__DO_NOT_USE_INTERNAL_FIELD_METHODS"] + : {}; - type UnboxBehaviorsMethods< - Behaviors extends Array | string> + type UnboxBehaviorsMethods< + Behaviors extends Array | string> > = UnboxBehaviorMethods>>; - type UnboxBehaviorsData< - Behaviors extends Array | string> + type UnboxBehaviorsData< + Behaviors extends Array | string> > = UnboxBehaviorData>>; - type UnboxBehaviorsProps< - Behaviors extends Array | string> + type UnboxBehaviorsProps< + Behaviors extends Array | string> > = UnboxBehaviorProps>>; // CombinedInstance models the `this`, i.e. instance type for (user defined) component @@ -3765,7 +3754,7 @@ declare namespace wx { Data, Methods, Props, - Behaviors extends Array | string> + Behaviors extends Array | string> > = Methods & Instance & UnboxBehaviorsMethods; type Prop = (() => T) | { new (...args: any[]): T & object }; @@ -3791,6 +3780,13 @@ declare namespace wx { type PropsDefinition = ArrayPropsDefinition | RecordPropsDefinition; + /** + * https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/observer.html + */ + interface ObserversDefs { + [expression: string]: (this: V, ...fields: any[]) => any; + } + interface ComponentRelation { /** 目标组件的相对关系,可选的值为 parent 、 child 、 ancestor 、 descendant */ type: "parent" | "child" | "ancestor" | "descendant"; @@ -3808,7 +3804,7 @@ declare namespace wx { Data, Methods, Props, - Behaviors extends Array | string> + Behaviors extends Array | string> > = object & ComponentOptions & ThisType, Behaviors>>; @@ -3872,7 +3868,7 @@ declare namespace wx { Data = DefaultData, Methods = DefaultMethods, Props = PropsDefinition, - Behaviors extends Array | string> = [] + Behaviors extends Array | string> = [] > extends Partial { /** * 组件的对外属性,是属性名到属性设置的映射表 @@ -3886,6 +3882,12 @@ declare namespace wx { */ data?: Data; + /** + * 数据监听器可以用于监听和响应任何属性和数据字段的变化。从小程序基础库版本 2.6.1 开始支持 + * @since 2.6.1 + */ + observers?: ObserversDefs; + /** * 组件的方法,包括事件响应函数和任意的自定义方法 * 关于事件响应函数的使用 @@ -3925,7 +3927,7 @@ declare namespace wx { * 类似于mixins和traits的组件间代码复用机制 * 参见 [behaviors](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/custom-component/behaviors.html) */ - behaviors?: Behaviors; + behaviors?: Behaviors; /** * 组件生命周期声明对象,组件的生命周期:created、attached、ready、moved、detached将收归到lifetimes字段内进行声明, @@ -3965,7 +3967,11 @@ declare namespace wx { /** * Component实例方法 */ - interface Component | string> = []> { + interface Component< + D, + P, + B extends Array | string> = [] + > { /** * 组件的文件路径 */ @@ -3981,20 +3987,24 @@ declare namespace wx { /** * 组件数据,包括内部数据和属性值 */ - data: D & UnboxBehaviorsData & { - [key in keyof (P & UnboxBehaviorsProps)]: PropValueType< - (P & UnboxBehaviorsProps)[key] - > - }; + data: D & + UnboxBehaviorsData & + { + [key in keyof (P & UnboxBehaviorsProps)]: PropValueType< + (P & UnboxBehaviorsProps)[key] + > + }; /** * 组件数据,包括内部数据和属性值(与 data 一致) */ - properties: D & UnboxBehaviorsData & { - [key in keyof (P & UnboxBehaviorsProps)]: PropValueType< - (P & UnboxBehaviorsProps)[key] - > - }; + properties: D & + UnboxBehaviorsData & + { + [key in keyof (P & UnboxBehaviorsProps)]: PropValueType< + (P & UnboxBehaviorsProps)[key] + > + }; /** * 将数据从逻辑层发送到视图层,同时改变对应的 this.data 的值 * 1. 直接修改 this.data 而不调用 this.setData 是无法改变页面的状态的,还会造成数据不一致。 @@ -4397,7 +4407,12 @@ declare function App( declare function getApp(): wx.App; // #endregion // #region Compontent组件 -declare function Component | string> = []>( +declare function Component< + D, + M, + P, + B extends Array | string> = [] +>( options?: wx.ThisTypedComponentOptionsWithRecordProps< wx.Component, D, @@ -4414,7 +4429,12 @@ declare function Component | st * 每个组件可以引用多个 behavior * behavior 也可以引用其他 behavior */ -declare function Behavior | string> = []>( +declare function Behavior< + D, + M, + P, + B extends Array | string> = [] +>( options?: wx.ThisTypedComponentOptionsWithRecordProps< wx.Component, D, @@ -4422,7 +4442,11 @@ declare function Behavior | str P, B > -): wx.Behavior, P & wx.UnboxBehaviorsProps, M & wx.UnboxBehaviorsMethods>; +): wx.Behavior< + D & wx.UnboxBehaviorsData, + P & wx.UnboxBehaviorsProps, + M & wx.UnboxBehaviorsMethods +>; // #endregion // #region Page /** diff --git a/types/weixin-app/weixin-app-tests.ts b/types/weixin-app/weixin-app-tests.ts index fb717d0c31..a824028862 100644 --- a/types/weixin-app/weixin-app-tests.ts +++ b/types/weixin-app/weixin-app-tests.ts @@ -16,7 +16,7 @@ const parentBehavior = Behavior({ } }, data: { - myParentBehaviorData: "", + myParentBehaviorData: "" }, methods: { myParentBehaviorMethod(input: number) { @@ -26,31 +26,40 @@ const parentBehavior = Behavior({ }); function createBehaviorWithUnionTypes(n: number) { - const properties = n % 2 < 1 ? { - unionPropA: { - type: String, - }, - } : { - unionPropB: { - type: Number, - }, - }; + const properties = + n % 2 < 1 + ? { + unionPropA: { + type: String + } + } + : { + unionPropB: { + type: Number + } + }; - const data = n % 4 < 2 ? { - unionDataA: 'a', - } : { - unionDataB: 1, - }; + const data = + n % 4 < 2 + ? { + unionDataA: "a" + } + : { + unionDataB: 1 + }; - const methods = n % 8 < 4 ? { - unionMethodA(a: number) { - return n + 1; - }, - } : { - unionMethodB(a: string) { - return {value: a}; - }, - }; + const methods = + n % 8 < 4 + ? { + unionMethodA(a: number) { + return n + 1; + } + } + : { + unionMethodB(a: string) { + return { value: a }; + } + }; return Behavior({ properties, @@ -63,7 +72,7 @@ const behavior = Behavior({ behaviors: [ createBehaviorWithUnionTypes(1), parentBehavior, - "wx://form-field", + "wx://form-field" ], properties: { myBehaviorProperty: { @@ -168,7 +177,7 @@ Component({ console.log(this.unionMethodA(5)); } if (this.unionMethodB) { - console.log(this.unionMethodB('test').value); + console.log(this.unionMethodB("test").value); } console.log(this.data.unionDataA); console.log(this.data.unionDataB); @@ -568,3 +577,26 @@ App({ }); } }); + +Component({ + observers: { + "name, age": function nameAgeObserver(name: string, age: number) { + this.setData({ + nameStr: `Dear ${name}`, + ageStr: `${age}` + }); + } + }, + properties: { + name: { + type: String + }, + age: { + type: Number + } + }, + data: { + nameStr: "", + ageStr: "" + } +}); diff --git a/types/word-extractor/index.d.ts b/types/word-extractor/index.d.ts new file mode 100644 index 0000000000..c6e6289774 --- /dev/null +++ b/types/word-extractor/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for word-extractor 0.3 +// Project: https://github.com/morungos/node-word-extractor +// Definitions by: Rodrigo Saboya +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class WordExtractor { + extract(documentPath: string): Promise; +} + +export = WordExtractor; + +declare namespace WordExtractor { + class Document { + getBody(): string; + getFootnotes(): string; + getHeaders(): string; + getAnnotations(): string; + getEndNotes(): string; + } +} diff --git a/types/word-extractor/tsconfig.json b/types/word-extractor/tsconfig.json new file mode 100644 index 0000000000..436687e1ff --- /dev/null +++ b/types/word-extractor/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "word-extractor-tests.ts" + ] +} diff --git a/types/word-extractor/tslint.json b/types/word-extractor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/word-extractor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/word-extractor/word-extractor-tests.ts b/types/word-extractor/word-extractor-tests.ts new file mode 100644 index 0000000000..a177b9d5c5 --- /dev/null +++ b/types/word-extractor/word-extractor-tests.ts @@ -0,0 +1,13 @@ +import WordExtractor = require("word-extractor"); + +const extractor = new WordExtractor(); + +let temp: string; + +const doc = extractor.extract('/path/to/file.doc').then(document => { + temp = document.getBody(); + temp = document.getAnnotations(); + temp = document.getEndNotes(); + temp = document.getFootnotes(); + temp = document.getHeaders(); +}); diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index 6415ad7957..fe39171825 100644 --- a/types/yeoman-generator/index.d.ts +++ b/types/yeoman-generator/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for yeoman-generator 3.0 +// Type definitions for yeoman-generator 3.1 // Project: https://github.com/yeoman/generator, http://yeoman.io // Definitions by: Kentaro Okuno // Jay Anslow // Ika // Joshua Cherry +// Arthur Corenzan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -71,7 +72,7 @@ declare namespace Generator { writeJSON(filepath: string, contents: {}, replacer?: (key: string, value: any) => any, space?: number): void; extendJSON(filepath: string, contents: {}, replacer?: (key: string, value: any) => any, space?: number): void; delete(filepath: string, options?: {}): void; - copy(from: string, to: string, options?: {}): void; + copy(from: string, to: string, options?: {}, context?: {}, templateOptions?: {}): void; copyTpl(from: string, to: string, context: {}, templateOptions?: {}, copyOptions?: {}): void; move(from: string, to: string, options?: {}): void; exists(filepath: string): boolean; diff --git a/types/youtube-player/dist/FunctionStateMap.d.ts b/types/youtube-player/dist/FunctionStateMap.d.ts new file mode 100644 index 0000000000..5ee7b07081 --- /dev/null +++ b/types/youtube-player/dist/FunctionStateMap.d.ts @@ -0,0 +1,31 @@ +import PlayerStates from './constants/PlayerStates'; + +declare const FUNCTION_STATE_MAP: { + pauseVideo: { + acceptableStates: [ + PlayerStates.ENDED, + PlayerStates.PAUSED + ], + stateChangeRequired: false, + }, + playVideo: { + acceptableStates: [ + PlayerStates.ENDED, + PlayerStates.PLAYING + ], + stateChangeRequired: false, + }, + seekTo: { + acceptableStates: [ + PlayerStates.ENDED, + PlayerStates.PLAYING, + PlayerStates.PAUSED + ], + stateChangeRequired: true, + + // TRICKY: `seekTo` may not cause a state change if no buffering is required. + timeout: 3000, + }, +}; + +export default FUNCTION_STATE_MAP; diff --git a/types/youtube-player/dist/YouTubePlayer.d.ts b/types/youtube-player/dist/YouTubePlayer.d.ts new file mode 100644 index 0000000000..7716ca739c --- /dev/null +++ b/types/youtube-player/dist/YouTubePlayer.d.ts @@ -0,0 +1,12 @@ +import { EmitterType, YouTubePlayer } from './types'; + +export interface EventHandlerMapType { + [key: string]: (event: object) => void; +} + +declare const YouTubePlayerHelpers: { + proxyEvents(emitter: EmitterType): EventHandlerMapType, + promisifyPlayer(playerAPIReady: Promise, strictState?: boolean): YouTubePlayer, +}; + +export default YouTubePlayerHelpers; diff --git a/types/youtube-player/dist/constants/PlayerStates.d.ts b/types/youtube-player/dist/constants/PlayerStates.d.ts new file mode 100644 index 0000000000..a5beac4fa7 --- /dev/null +++ b/types/youtube-player/dist/constants/PlayerStates.d.ts @@ -0,0 +1,10 @@ +declare enum PlayerStates { + BUFFERING = 3, + ENDED = 0, + PAUSED = 2, + PLAYING = 1, + UNSTARTED = -1, + VIDEO_CUED = 5, +} + +export default PlayerStates; diff --git a/types/youtube-player/dist/eventNames.d.ts b/types/youtube-player/dist/eventNames.d.ts new file mode 100644 index 0000000000..a86d3b5625 --- /dev/null +++ b/types/youtube-player/dist/eventNames.d.ts @@ -0,0 +1,20 @@ +declare const EVENT_NAMES: [ + 'ready', + 'stateChange', + 'playbackQualityChange', + 'playbackRateChange', + 'error', + 'apiChange', + 'volumeChange' +]; + +export default EVENT_NAMES; + +export type EventType = + 'ready' | + 'stateChange' | + 'playbackQualityChange' | + 'playbackRateChange' | + 'error' | + 'apiChange' | + 'volumeChange'; diff --git a/types/youtube-player/dist/functionNames.d.ts b/types/youtube-player/dist/functionNames.d.ts new file mode 100644 index 0000000000..1e317d7391 --- /dev/null +++ b/types/youtube-player/dist/functionNames.d.ts @@ -0,0 +1,46 @@ +declare const FUNCTION_NAMES: [ + 'cueVideoById', + 'loadVideoById', + 'cueVideoByUrl', + 'loadVideoByUrl', + 'playVideo', + 'pauseVideo', + 'stopVideo', + 'getVideoLoadedFraction', + 'cuePlaylist', + 'loadPlaylist', + 'nextVideo', + 'previousVideo', + 'playVideoAt', + 'setShuffle', + 'setLoop', + 'getPlaylist', + 'getPlaylistIndex', + 'setOption', + 'mute', + 'unMute', + 'isMuted', + 'setVolume', + 'getVolume', + 'seekTo', + 'getPlayerState', + 'getPlaybackRate', + 'setPlaybackRate', + 'getAvailablePlaybackRates', + 'getPlaybackQuality', + 'setPlaybackQuality', + 'getAvailableQualityLevels', + 'getCurrentTime', + 'getDuration', + 'removeEventListener', + 'getVideoUrl', + 'getVideoEmbedCode', + 'getOptions', + 'getOption', + 'addEventListener', + 'destroy', + 'setSize', + 'getIframe' +]; + +export default FUNCTION_NAMES; diff --git a/types/youtube-player/dist/index.d.ts b/types/youtube-player/dist/index.d.ts new file mode 100644 index 0000000000..09f07ff9c8 --- /dev/null +++ b/types/youtube-player/dist/index.d.ts @@ -0,0 +1,9 @@ +import { Options, YouTubePlayer } from './types'; + +declare function PlayerFactory( + maybeElementId: YouTubePlayer | HTMLElement | string, + options?: Options, + strictState?: boolean, +): YouTubePlayer; + +export default PlayerFactory; diff --git a/types/youtube-player/dist/loadYouTubeIframeApi.d.ts b/types/youtube-player/dist/loadYouTubeIframeApi.d.ts new file mode 100644 index 0000000000..7faddafbb9 --- /dev/null +++ b/types/youtube-player/dist/loadYouTubeIframeApi.d.ts @@ -0,0 +1,4 @@ +import { EmitterType, IframeApiType } from './types'; + +declare function Loader(emitter: EmitterType): Promise; +export default Loader; diff --git a/types/youtube-player/dist/types.d.ts b/types/youtube-player/dist/types.d.ts new file mode 100644 index 0000000000..fa64feda04 --- /dev/null +++ b/types/youtube-player/dist/types.d.ts @@ -0,0 +1,142 @@ +import PlayerState from './constants/PlayerStates'; +import { EventType } from './eventNames'; + +export interface EmitterType { + trigger: (eventName: string, event: object) => void; +} + +export interface Options { + width?: number; + height?: number; + videoId?: string; + playerVars?: { + autoplay?: 0 | 1, + cc_lang_pref?: string, + cc_load_policy?: 1, + color?: 'red' | 'white', + controls?: 0 | 1, + disablekb?: 0 | 1, + enablejsapi?: 0 | 1, + end?: number, + fs?: 0 | 1, + hl?: string, + iv_load_policy?: 1 | 3, + list?: string, + listType?: 'playlist' | 'search' | 'user_uploads', + loop?: 0 | 1, + modestbranding?: 1, + origin?: string, + playlist: string, + playsinline?: 0 | 1, + rel?: 0 | 1, + start?: number, + widget_referrer?: string, + }; + events?: { + [eventType in EventType]: (event: CustomEvent) => void + }; +} + +export interface IframeApiType { + Player: {new(elementId: string, options: Options): YouTubePlayer}; +} + +/** + * @see https://developers.google.com/youtube/iframe_api_reference + */ +export interface YouTubePlayer { + addEventListener(event: string, listener: (event: CustomEvent) => void): void; + destroy(): void; + getAvailablePlaybackRates(): ReadonlyArray; + getAvailableQualityLevels(): ReadonlyArray; + getCurrentTime(): number; + getDuration(): number; + getIframe(): HTMLIFrameElement; + getOption(module: string, option: string): any; + getOptions(): string[]; + getOptions(module: string): object; + setOption(module: string, option: string, value: any): void; + setOptions(): void; + cuePlaylist( + playlist: string | ReadonlyArray, + index?: number, + startSeconds?: number, + suggestedQuality?: string, + ): void; + cuePlaylist(playlist: { + listType: string, + list?: string, + index?: number, + startSeconds?: number, + suggestedQuality?: string, + }): void; + loadPlaylist( + playlist: string | ReadonlyArray, + index?: number, + startSeconds?: number, + suggestedQuality?: string, + ): void; + loadPlaylist(playlist: { + listType: string, + list?: string, + index?: number, + startSeconds?: number, + suggestedQuality?: string, + }): void; + getPlaylist(): ReadonlyArray; + getPlaylistIndex(): number; + getPlaybackQuality(): string; + getPlaybackRate(): number; + getPlayerState(): PlayerState; + getVideoEmbedCode(): string; + getVideoLoadedFraction(): number; + getVideoUrl(): string; + getVolume(): number; + cueVideoById(videoId: string, startSeconds?: number, suggestedQuality?: string): void; + cueVideoById(video: { + videoId: string, + startSeconds?: number, + endSeconds?: number, + suggestedQuality?: string, + }): void; + cueVideoByUrl(mediaContentUrl: string, startSeconds?: number, suggestedQuality?: string): void; + cueVideoByUrl(video: { + mediaContentUrl: string, + startSeconds?: number, + endSeconds?: number, + suggestedQuality?: string, + }): void; + loadVideoByUrl(mediaContentUrl: string, startSeconds?: number, suggestedQuality?: string): void; + loadVideoByUrl(video: { + mediaContentUrl: string, + startSeconds?: number, + endSeconds?: number, + suggestedQuality?: string, + }): void; + loadVideoById(videoId: string, startSeconds?: number, suggestedQuality?: string): void; + loadVideoById(video: { + videoId: string, + startSeconds?: number, + endSeconds?: number, + suggestedQuality?: string, + }): void; + isMuted(): boolean; + mute(): void; + nextVideo(): void; + pauseVideo(): void; + playVideo(): void; + playVideoAt(index: number): void; + previousVideo(): void; + removeEventListener(event: string, listener: (event: CustomEvent) => void): void; + seekTo(seconds: number, allowSeekAhead: boolean): void; + setLoop(loopPlaylists: boolean): void; + setPlaybackQuality(suggestedQuality: string): void; + setPlaybackRate(suggestedRate: number): void; + setShuffle(shufflePlaylist: boolean): void; + setSize(width: number, height: number): object; + setVolume(volume: number): void; + stopVideo(): void; + unMute(): void; + on(eventType: 'stateChange', listener: (event: CustomEvent & {data: number}) => void): void; + on(eventType: EventType, listener: (event: CustomEvent) => void): void; +} diff --git a/types/youtube-player/index.d.ts b/types/youtube-player/index.d.ts new file mode 100644 index 0000000000..f34f8e3505 --- /dev/null +++ b/types/youtube-player/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for youtube-player 5.5 +// Project: https://github.com/gajus/youtube-player#readme +// Definitions by: Martin Jurča +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import PlayerFactory from './dist/index'; + +export default PlayerFactory; diff --git a/types/youtube-player/tsconfig.json b/types/youtube-player/tsconfig.json new file mode 100644 index 0000000000..1abbcc804c --- /dev/null +++ b/types/youtube-player/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dist/constants/PlayerStates.d.ts", + "dist/eventNames.d.ts", + "dist/functionNames.d.ts", + "dist/FunctionStateMap.d.ts", + "dist/index.d.ts", + "dist/loadYouTubeIframeApi.d.ts", + "dist/types.d.ts", + "dist/YouTubePlayer.d.ts", + "youtube-player-tests.ts" + ] +} diff --git a/types/youtube-player/tslint.json b/types/youtube-player/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/youtube-player/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/youtube-player/youtube-player-tests.ts b/types/youtube-player/youtube-player-tests.ts new file mode 100644 index 0000000000..cb60168cea --- /dev/null +++ b/types/youtube-player/youtube-player-tests.ts @@ -0,0 +1,81 @@ +import youTubePlayerFactory from 'youtube-player'; +import PlayerStates from 'youtube-player/dist/constants/PlayerStates'; +import { YouTubePlayer } from 'youtube-player/dist/types'; + +youTubePlayerFactory('foo'); +const player: YouTubePlayer = youTubePlayerFactory( + document.getElementById('bar')!, + { + width: 640, + height: 300, + videoId: 'aaaaaaaaaa', + playerVars: { + autoplay: 1, + cc_lang_pref: 'en_US', + cc_load_policy: 1, + color: 'white', + controls: 1, + disablekb: 0, + enablejsapi: 1, + end: 60, + fs: 0, + hl: 'fooBar', + iv_load_policy: 3, + list: 'bbbbbbbbbb', + listType: 'search', + loop: 0, + modestbranding: 1, + origin: 'https://definitelytyped.org/', + playlist: 'cccccccccc', + playsinline: 0, + rel: 1, + start: 3, + widget_referrer: 'nothing', + }, + events: { + ready: (event: CustomEvent): void => {}, + stateChange: (event: CustomEvent): void => { + console.log(player.getPlayerState() === PlayerStates.PLAYING); + }, + playbackQualityChange: (event: CustomEvent): void => {}, + playbackRateChange: (event: CustomEvent): void => {}, + error: (event: CustomEvent): void => {}, + apiChange: (event: CustomEvent): void => {}, + volumeChange: (event: CustomEvent): void => {}, + }, + }, + true, +); + +player.cueVideoById('xyzabc123'); +player.loadVideoById('doesNotExist'); +player.playVideo(); +player.pauseVideo(); +player.setSize(320, 200); +if (player.isMuted()) { + player.unMute(); +} else { + player.mute(); +} +player.setVolume(player.getVolume() / 2); + +player.on('stateChange', (event: CustomEvent & {data: number}) => { + switch (event.data) { + case PlayerStates.PLAYING: + console.log('playing'); + break; + case PlayerStates.PAUSED: + console.log('paused'); + break; + case PlayerStates.ENDED: + console.log('ended'); + break; + default: + break; + } +}); +player.on('error', (event: CustomEvent) => { + console.error('player error', event.detail); +}); + +player.destroy(); diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index dc73ae6bd9..7e03517143 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -70,7 +70,7 @@ export interface Schema { withMutation(fn: (current: this) => void): void; default(value: any): this; default(): T; - nullable(isNullable: boolean): this; + nullable(isNullable?: boolean): this; required(message?: TestOptionsMessage): this; notRequired(): this; typeError(message?: TestOptionsMessage): this; diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index c6717e95ad..fdead13b2b 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -148,6 +148,7 @@ mixed.default({ number: 5 }); mixed.default(() => ({ number: 5 })); mixed.default(); mixed.nullable(true); +mixed.nullable(); mixed.required(); mixed.required("Foo"); mixed.required(() => "Foo"); diff --git a/types/zipkin-context-cls/tsconfig.json b/types/zipkin-context-cls/tsconfig.json index 57430d50b2..af624fda93 100644 --- a/types/zipkin-context-cls/tsconfig.json +++ b/types/zipkin-context-cls/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -20,4 +21,4 @@ "index.d.ts", "zipkin-context-cls-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/zipkin-transport-http/tsconfig.json b/types/zipkin-transport-http/tsconfig.json index 7ed663b14b..be30a49dab 100644 --- a/types/zipkin-transport-http/tsconfig.json +++ b/types/zipkin-transport-http/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -20,4 +21,4 @@ "index.d.ts", "zipkin-transport-http-tests.ts" ] -} \ No newline at end of file +}