diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index 8e0e8b9fb6..aef7ecd7d6 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -1,10 +1,14 @@ import Agenda = require("agenda"); -import { Db, Server } from "mongodb"; +import { Db, Server, MongoClient } from "mongodb"; var mongoConnectionString = "mongodb://127.0.0.1/agenda"; (async () => { var agenda = new Agenda({ db: { address: mongoConnectionString } }); + var agenda = new Agenda({ + mongo: (await MongoClient.connect(mongoConnectionString)).db(), + db: { collection: 'agenda-jobs' }, + }); agenda.define<{ foo: Error }>('delete old users', (job, done) => { done(job.attrs.data.foo) diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index 206d40daf3..75246ecda3 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -203,17 +203,7 @@ declare namespace Agenda { /** * Specifies that Agenda should be initialized using and existing MongoDB connection. */ - mongo?: { - /** - * The MongoDB database connection to use. - */ - db: Db; - - /** - * The name of the collection to use. - */ - collection?: string; - } + mongo?: Db; /** * Specifies that Agenda should connect to MongoDB. @@ -221,8 +211,10 @@ declare namespace Agenda { db?: { /** * The connection URL. + * Required when using `db` option to connect. + * Not required when an existing connection is passed as `mongo` property. */ - address: string; + address?: string; /** * The name of the collection to use. @@ -231,6 +223,7 @@ declare namespace Agenda { /** * Connection options to pass to MongoDB. + * Not required when an existing connection is passed as `mongo` property. */ options?: any; } diff --git a/types/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts index 98315235ea..e049a2374d 100644 --- a/types/arangodb/arangodb-tests.ts +++ b/types/arangodb/arangodb-tests.ts @@ -99,10 +99,9 @@ console.log( const view = db._view("yolo")!; view.properties({ - locale: "C", - commit: { - consolidate: { - bytes: { segmentThreshold: 20 } - } + consolidationIntervalMsec: 123, + consolidationPolicy: { + type: "bytes", + segmentThreshold: 234 } }); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts index be738e6717..32ad04210b 100644 --- a/types/arangodb/index.d.ts +++ b/types/arangodb/index.d.ts @@ -848,10 +848,11 @@ declare namespace ArangoDB { ): ArangoSearchViewProperties; } - interface ArangoSearchViewConsolidate { - threshold: number; - segmentThreshold: number; - } + type ArangoSearchViewConsolidationType = + | "bytes" + | "bytes_accum" + | "count" + | "fill"; interface ArangoSearchViewCollectionLink { analyzers?: string[]; @@ -865,35 +866,26 @@ declare namespace ArangoDB { id: string; name: string; type: "arangosearch"; - commit: { - cleanupIntervalStep: number; - commitIntervalMsec: number; - consolidate: { - bytes?: ArangoSearchViewConsolidate; - bytes_accum?: ArangoSearchViewConsolidate; - count?: ArangoSearchViewConsolidate; - fill?: ArangoSearchViewConsolidate; - }; + + cleanupIntervalStep: number; + consolidationIntervalMsec: number; + consolidationPolicy: { + type: ArangoSearchViewConsolidationType; + segmentThreshold: number; + threshold: number; }; - locale: string; links: { [key: string]: ArangoSearchViewCollectionLink | undefined; }; } interface ArangoSearchViewPropertiesOptions { - locale?: string; - commit?: { - consolidate?: - | "none" - | { - count?: Partial; - bytes?: Partial; - bytes_accum?: Partial; - fill?: Partial; - }; - commitIntervalMsec?: number; - cleanupIntervalStep?: number; + cleanupIntervalStep?: number; + consolidationIntervalMsec?: number; + consolidationPolicy?: { + type?: ArangoSearchViewConsolidationType; + segmentThreshold?: number; + threshold?: number; }; links?: { [key: string]: ArangoSearchViewCollectionLink | undefined; diff --git a/types/bluebird-global/bluebird-global-tests.ts b/types/bluebird-global/bluebird-global-tests.ts index b6bbb915e2..3928ba46c9 100644 --- a/types/bluebird-global/bluebird-global-tests.ts +++ b/types/bluebird-global/bluebird-global-tests.ts @@ -44,3 +44,11 @@ function testPromiseRejection() { function testGithubTicket28081Regression() { Promise.resolve([3]).map((n: number) => true); } + +import Bluebird = require("bluebird"); + +function testTheWalkaroundForCastingGlobalPromiseToBluebirdPromise() { + const bluebirdString: Bluebird = Bluebird.resolve( + new Promise(() => 'Lorem ipsum') + ); +} diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index 7f38f981f1..fca3c1235e 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -10,6 +10,25 @@ * If you want to leverage the fact, that bluebird polyfills the global Promise in the browser, then * you need to tell TypeScript about this. The following declaration file does exactly that. * + * 1.1. Why you might not want to use `bluebird-global` instead of `bluebird`. + * + * Because of how these typings tell TypeScript about bluebird's Promise methods, it is not + * possible to cast global Promises to Bluebird promises in your code. In other words, you won't + * be able to do the following (even though it's possible at the runtime): + * + * let bluebirdPromise: Bluebird = new Promise(() => { return 'Lorem ipsum'; }); + * + * If you need to, you can walk-around this by constructing a new Bluebird promise over an instance + * of the global Promise, like so: + * + * let bluebirdPromise: Bluebird = Bluebird.resolve( + * new Promise(() => { return 'Lorem ipsum'; }) + * ); + * + * So the bottom line is: if you use these typings, then be mindful when you try to mix the global + * Promises with the Bluebird promises. You can avoid this problem by just settling on using either + * of them and not both of them at the same time. + * * 2. How to use it? * * It should just work, but there are a couple of points to be wary about: @@ -60,6 +79,17 @@ * d. target es6, latest "es20xx", e.g. "es2017" */ +/* + * @todo When dropping TS 2.x support, uncomment the following triple-slash directives and + * remove the copy&paste from this file (marked with #std-lib-copy&paste-to-remove) + * + * TS 2.x support should be dropped once bluebird's typings stop compiling on 2.x (i.e. + * once bluebird's typings stop supporting TS 2.x) + */ +/* /// */ +/* /// */ +/* /// */ + import Bluebird = require("bluebird"); declare global { @@ -73,7 +103,7 @@ declare global { bind: Bluebird["bind"]; call: Bluebird["call"]; cancel: Bluebird["cancel"]; - // catch: Bluebird["catch"]; + // catch: Bluebird["catch"]; // Provided by lib.es5.d.ts caught: Bluebird["caught"]; delay: Bluebird["delay"]; disposer: Bluebird["disposer"]; @@ -81,7 +111,7 @@ declare global { each: Bluebird["each"]; error: Bluebird["error"]; filter: Bluebird["filter"]; - // finally: Bluebird["finally"]; + // finally: Bluebird["finally"]; // Provided by lib.es2018.promise.d.ts get: Bluebird["get"]; isCancelled: Bluebird["isCancelled"]; isFulfilled: Bluebird["isFulfilled"]; @@ -103,7 +133,7 @@ declare global { suppressUnhandledRejections: Bluebird["suppressUnhandledRejections"]; tap: Bluebird["tap"]; tapCatch: Bluebird["tapCatch"]; - // then: Bluebird["then"]; + // then: Bluebird["then"]; // Provided by lib.es5.d.ts thenReturn: Bluebird["thenReturn"]; thenThrow: Bluebird["thenThrow"]; catchReturn: Bluebird["catchReturn"]; @@ -115,19 +145,18 @@ declare global { value: Bluebird["value"]; /* - * Copy&paste ::then and ::catch from lib.es2015.promise.d.ts, because Bluebird's typings are not + * Copy&paste ::then and ::catch from lib.es5.promise.d.ts, because Bluebird's typings are not * in line with the standard lib. * - * This is only needed for es5 target, which doesn't include the lib.es2015.promise.d.ts typings. + * #std-lib-copy&paste-to-remove * - * @todo Make Bluebird's typings be in line with the standard lib. + * @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove */ - then(onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - then(onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; - then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; - catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - catch(onrejected: (reason: any) => TResult | PromiseLike): Promise; + then( + onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null + ): Promise; + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; /* * TypeScript disallows adding overrides via `catch: typeof Bluebird.prototype.catch`. Copy&paste them then. @@ -142,7 +171,11 @@ declare global { catch(predicate: Object, onReject: (error: any) => U | PromiseLike): Bluebird; /* - * See comments above `then` for the reason why this is needed. Taken from esnext.promise.d.ts. + * See comments above `then` for the reason why this is needed. Taken from es2018.promise.d.ts. + * + * #std-lib-copy&paste-to-remove + * + * @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove */ finally(onfinally?: (() => void) | undefined | null): Promise; } @@ -153,7 +186,7 @@ declare global { interface PromiseConstructor { new (callback: (resolve: (thenableOrResult?: T | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise; - // all: typeof Bluebird.all; + // all: typeof Bluebird.all; // Provided by lib.es2015.d.ts any: typeof Bluebird.any; attempt: typeof Bluebird.attempt; bind: typeof Bluebird.bind; @@ -176,10 +209,10 @@ declare global { promisify: typeof Bluebird.promisify; promisifyAll: typeof Bluebird.promisifyAll; props: typeof Bluebird.props; - // race: typeof Bluebird.race; + // race: typeof Bluebird.race; // Provided by lib.es2015.d.ts reduce: typeof Bluebird.reduce; - // reject: typeof Bluebird.reject; - // resolve: typeof Bluebird.resolve; + // reject: typeof Bluebird.reject; // Provided by lib.es2015.d.ts + // resolve: typeof Bluebird.resolve; // Provided by lib.es2015.d.ts some: typeof Bluebird.some; try: typeof Bluebird.try; using: typeof Bluebird.using; @@ -187,9 +220,9 @@ declare global { /* * Copy&paste from lib.es2015.promise.d.ts, because Bluebird's typings are not in line with the standard lib. * - * This is only needed for es5 target, which doesn't include the lib.es2015.promise.d.ts typings. + * #std-lib-copy&paste-to-remove * - * @todo Make Bluebird's typings be in line with the standard lib. + * @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; @@ -219,6 +252,10 @@ declare global { /* * Declare the `Promise` variable. This is needed for es5 only and is a no-op for all other targets. + * + * #std-lib-copy&paste-to-remove + * + * @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove */ var Promise: PromiseConstructor; } diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 93dc18dfee..091dbe6e7a 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -70,8 +70,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(onReject: (error: any) => Resolvable): Bluebird; - catch(onReject: ((error: any) => Resolvable) | undefined | null): Bluebird; + catch(onReject: ((error: any) => Resolvable) | undefined | null): Bluebird; /** * This extends `.catch` to work more like catch-clauses in languages like Java or C#. diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 85574e3c91..68625bd5bb 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -37,6 +37,21 @@ client.search({ }, (error) => { }); +client.search({ + body: { + query: { + match_all: { + _name: 'test' + } + } + } +} +).then((body) => { + const hit = body.hits.hits[0]; + const names = hit && hit.matched_queries; +}, (error) => { +}); + client.indices.delete({ index: 'test_index', ignore: [404] diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index c791db72c3..a9dc133545 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -645,6 +645,7 @@ export interface SearchResponse { fields?: any; highlight?: any; inner_hits?: any; + matched_queries?: string[]; sort?: string[]; }>; }; diff --git a/types/expired-storage/expired-storage-tests.ts b/types/expired-storage/expired-storage-tests.ts new file mode 100644 index 0000000000..5c1a814b23 --- /dev/null +++ b/types/expired-storage/expired-storage-tests.ts @@ -0,0 +1,69 @@ +import ExpiredStorage = require('expired-storage'); + +const expiredStorage = new ExpiredStorage(); + +const mjkModel = { + firstName: 'Maynard', + middleName: 'James', + familyName: 'Keenan', +}; + +expiredStorage.clear(); + +expiredStorage.setItem('tool', '46&2', 10); + +if (expiredStorage.getItem('tool') !== '46&2') { + throw new Error('.setItem method is not working!'); +} + +expiredStorage.setJson('mjk', mjkModel, 1); + +const mjkTest = expiredStorage.getJson('mjk'); + +if (typeof mjkTest === 'undefined' || mjkTest.firstName !== mjkModel.firstName || mjkTest.middleName !== mjkModel.middleName || mjkTest.familyName !== mjkModel.familyName) { + throw new Error('.setJson method is not working!'); +} + +const keyCheck = expiredStorage.keys(true); + +if (keyCheck && keyCheck.length === 2) { + throw new Error('.keys method has failed.'); +} + +expiredStorage.setItem('apc', 'brena', 2); + +const goBackToSleep = expiredStorage.peek('apc'); + +if (!goBackToSleep.isExpired && goBackToSleep.value !== 'brena') { + throw new Error('.peek -- we have expired early... or our value was incorrect...'); +} + +do { + // nothing here to see +} while (!expiredStorage.isExpired('apc')); + +const expiredKeys = expiredStorage.clearExpired(); + +if (expiredKeys.indexOf('apc') !== -1) { + throw new Error('.clearExpired did not work..'); +} + +if (expiredStorage.getItem('apc') !== null) { + throw new Error('Expiration as a whole does not work.'); +} + +expiredStorage.setItem('puscifer', 'the humbling river', 10000); + +expiredStorage.updateExpiration('puscifer', 5000); + +const checkKeyTime = expiredStorage.getTimeLeft('puscifer'); + +if (checkKeyTime && checkKeyTime >= 10000) { + throw new Error('.updateExpiration method is broken -- or .getTimeLeft method is broken.'); +} + +if (!expiredStorage.isExpired('mjk')) { + throw new Error('.isExpired or Expiration as a whole is not working...'); +} + +expiredStorage.clear(); diff --git a/types/expired-storage/index.d.ts b/types/expired-storage/index.d.ts new file mode 100644 index 0000000000..bc7f7eb0b5 --- /dev/null +++ b/types/expired-storage/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for extended-storage 1.0 +// Project: https://github.com/RonenNess/ExpiredStorage/ +// Definitions by: Allen Gammel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = ExpiredStorage; + +declare class ExpiredStorage { + constructor(localStorage?: any); + /** + * Clear the entire storage and all keys in it. + */ + clear(): void; + /** + * Get a json serializable value. This basically calls JSON.parse on the returned value. + * @param key Item key to get (string). + * @return Stored value (JSON.parsed), or undefined if not set / expired. + */ + getJson(key: string): any; + /** + * Get item. + * @param key: Item key to get (string). + * @return: Stored value, or undefined if not set / expired. + */ + getItem(key: string): string | null; + /** + * Remove an item. + * @param key Item key to remove (string). + * @return Storage.removeItem() return code. + */ + removeItem(key: string): any; + /** + * Set a json serializable value. This basically calls JSON.stringify on 'val' before setting it. + * @param key Item key to set (string). + * @param value Value to store (object, will be JSON.stringified). + * @param expiration Expiration time, in seconds. If not provided, will not set expiration time. + * @param return Storage.setItem() return code. + */ + setJson(key: string, value: object, expirationTime?: number): any; + /** + * Set item. + * @param key Item key to set (string). + * @param value Value to store (string). + * @param expiration Expiration time, in seconds. If not provided, will not set expiration time. + * @return Storage.setItem() return code. + */ + setItem(key: string, value: string, expiration?: number): any; + /** + * Get all keys in storage, not including internal keys used to store expiration. + * @param: includeExpired: if true, will also include expired keys. + * @return: Array with keys. + */ + keys(includeExpired: boolean): string[] | null; + /** + * Get item time left to live. + * @param key Item key to get (string). + * @return Time left to expire (in seconds), or null if don't have expiration date. + */ + getTimeLeft(key: string): number | null; + /** + * Clear expired keys. + * If you never call this function, expired keys will remain until you try to get them / reset a new value. + * + * @param return: List of removed keys due to expiration. + */ + clearExpired(): string[]; + /** + * Return if an item is expired (don't remove it, even if expired). + * @param key Item key to check (string). + * @return True if expired, False otherwise. + */ + isExpired(key: string): boolean; + /** + * Get item + metadata such as time left and if expired. + * Even if item expired, will not remove it. + * @param key Item key to get (string). + * @return PeekInterface with: {value, timeLeft, isExpired} + */ + peek(key: string): ExpiredStorage.PeekInterface; + /** + * Update expiration time for an item (note: doesn't validate that the item is set). + * @param key: Item key to update expiration for (string). + * @param expiration: New expiration time in seconds to set. + * @return: Storage.setItem() return code for setting new expiration. + */ + updateExpiration(key: string, expiration: number): any; +} + +declare namespace ExpiredStorage { + interface PeekInterface { + /** + * The value of a [key] + */ + value: string | null; + /** + * Time remaining until expiration + */ + timeLeft: number | null; + /** + * Has the [key] expired or not + */ + isExpired: boolean; + } +} diff --git a/types/expired-storage/tsconfig.json b/types/expired-storage/tsconfig.json new file mode 100644 index 0000000000..cd1454cca7 --- /dev/null +++ b/types/expired-storage/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", + "expired-storage-tests.ts" + ] +} \ No newline at end of file diff --git a/types/expired-storage/tslint.json b/types/expired-storage/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/expired-storage/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/jsgraph/index.d.ts b/types/jsgraph/index.d.ts new file mode 100644 index 0000000000..fe4fa42e2f --- /dev/null +++ b/types/jsgraph/index.d.ts @@ -0,0 +1,174 @@ +// Type definitions for jsgraph 0.7 +// Project: https://github.com/Encapsule/jsgraph +// Definitions by: Joel Rosinbum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace jsgraph { + + interface jsGraphStatic { + directed: Directed; + } + + export interface VertexRequest { + u: string; + p: any + } + + export interface JsGraphResponse { + error?: any; + result?: any; + } + + export interface Edge { + u: string; + v: string + } + + export interface EdgeRequest { + e: Edge; + p: any; + } + + export interface DirectedGraph { + new(): DirectedGraph; + + setGraphName(name: string): JsGraphResponse; + + getGraphName(): string; + + setGraphDescription(description: string): JsGraphResponse; + + getGraphDescription(): string; + + verticesCount(): number; + + getVertices(): string[]; + + getEdgeCount(): number; + + getEdeges(): Edge[]; + + rootVerticesCount(): number; + + getRootVertices(): string[]; + + leafVerticesCount(): number; + + getLeafVertices(): string[]; + + toObject(): string; + + toJSON(): string; + + stringify(replacer: Function, space?: number): string; + + fromObject(graph: any): JsGraphResponse; + + + //Vertex functions + addVertex(vertex: VertexRequest): JsGraphResponse; + + removeVertex(vertex: string): boolean; + + getVertexProperty(vertex: string): any; + + setVertexProperty(vertex: VertexRequest): JsGraphResponse; + + hasVertexProperty(vertex: string): boolean; + + clearVertexProperty(vertex: string): boolean; + + inDegree(vertex: string): number; + + inEdges(vertex: string): Edge[]; + + outDegree(vertex: string): number; + + outEdges(vertex: string): Edge[]; + + //Edge functions + addEdge(request: EdgeRequest): JsGraphResponse; + + isEdge(edge: Edge): boolean; + + removeEdge(edge: Edge): JsGraphResponse; + + getEdgeProperty(edge: Edge): any; + + setEdgeProperty(request: EdgeRequest): JsGraphResponse; + + hasEdgeProperty(edge: Edge): boolean; + + clearEdgeProperty(edge: Edge): boolean; + + + } + + export interface Visitor { + initializeVertex(req: { u: string, g: DirectedGraph }): void; + + startVertex(req: { u: string, g: DirectedGraph }): void; + + discoverVertex(req: { u: string, g: DirectedGraph }): void; + + examineVertex(req: { u: string, g: DirectedGraph }): void; + + examineEdge(req: { e: Edge, g: DirectedGraph }): void; + + nonTreeEdge(req: { e: Edge, g: DirectedGraph }): void; + + grayTarget(req: { e: Edge, g: DirectedGraph }): void; + + blackTarget(req: { e: Edge, g: DirectedGraph }): void; + + finishVertex(req: { u: string, g: DirectedGraph }): void; + } + + export interface TraversalContext { + searchStatus: string; + colorMap: any; + undiscoveredMap: any; + } + + export interface TraversalOptions { + startVector: string | string[]; + allowEmptyStartVector: boolean; + signalStart: boolean; + traverseContext: TraversalContext; + } + + export interface TraversalParams { + digraph: DirectedGraph, + visitor: Visitor, + options?: TraversalOptions + } + + export interface TraversalResult { + error?: any; + result?: TraversalContext + } + + export type colors = { white: 0, gray: 1, black: 2 }; + + export interface Directed { + breadthFirstTraverse(params: TraversalParams): TraversalResult; + + colors: colors; + + create(): { result: DirectedGraph }; + + createTraversalContext(req: { dirgaph: DirectedGraph }): TraversalContext; + + depthFirstTraverse(params: TraversalParams): TraversalResult; + + transpose(graph: DirectedGraph): { error?: any, result?: DirectedGraph }; + + directedGraph: DirectedGraph; + + } +} + +declare var jsgraph: jsgraph.jsGraphStatic; + +export = jsgraph; diff --git a/types/jsgraph/jsgraph-tests.ts b/types/jsgraph/jsgraph-tests.ts new file mode 100644 index 0000000000..2fdab3c0bf --- /dev/null +++ b/types/jsgraph/jsgraph-tests.ts @@ -0,0 +1,43 @@ +import * as jsgraph from 'jsgraph'; +import {Edge, JsGraphResponse} from 'jsgraph'; + +const mygraph = jsgraph.directed.create().result; + +let name: string = 'my name'; +mygraph.setGraphName(name); +name = mygraph.getGraphName(); +let description: string = 'My desc'; +mygraph.setGraphDescription(description); +description = mygraph.getGraphDescription(); + +let count: number = mygraph.verticesCount(); +let verticies: string [] = mygraph.getVertices(); +count = mygraph.getEdgeCount(); +let edges: Edge[] = mygraph.getEdeges(); +count = mygraph.rootVerticesCount(); +verticies = mygraph.getRootVertices(); +count = mygraph.leafVerticesCount(); +verticies = mygraph.getLeafVertices(); +let json: string = mygraph.toObject(); +json = mygraph.toJSON(); +json = mygraph.stringify( () => {return}, 2); +const graph2 = mygraph.fromObject(mygraph); + +let response: JsGraphResponse = mygraph.addVertex({u: 'a', p: 'some data'}); +let bool: boolean = mygraph.removeVertex('a'); +let property: string = mygraph.getVertexProperty('a'); +mygraph.setVertexProperty({u: 'a', p: property}); +bool = mygraph.hasVertexProperty('a'); +bool = mygraph.clearVertexProperty('a'); +count = mygraph.inDegree('a'); +edges = mygraph.inEdges('a'); +count = mygraph.outDegree('a'); +edges = mygraph.outEdges('a'); + +response = mygraph.addEdge({e: {u: 'a', v:'b'}, p: 'some data'}); +bool = mygraph.isEdge({u: 'a', v:'b'}); +response = mygraph.removeEdge({u: 'a', v: 'b'}); +property = mygraph.getEdgeProperty({u: 'a', v: 'b'}); +response = mygraph.setEdgeProperty({e: {u: 'a', v: 'b'}, p: 'some data'}); +bool = mygraph.hasEdgeProperty({u: 'a', v: 'b'}); +bool = mygraph.clearEdgeProperty({u:'a', v: 'b'}); diff --git a/types/jsgraph/tsconfig.json b/types/jsgraph/tsconfig.json new file mode 100644 index 0000000000..22997eae59 --- /dev/null +++ b/types/jsgraph/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsgraph-tests.ts" + ] +} diff --git a/types/jsgraph/tslint.json b/types/jsgraph/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/jsgraph/tslint.json @@ -0,0 +1,79 @@ +{ + "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/leaflet-editable/index.d.ts b/types/leaflet-editable/index.d.ts index 932ca33fd2..f73befb161 100644 --- a/types/leaflet-editable/index.d.ts +++ b/types/leaflet-editable/index.d.ts @@ -124,6 +124,11 @@ declare module 'leaflet' { * When you need to stop any ongoing drawing, without needing to know which editor is active. */ stopDrawing(): void; + + /** + * When you need to commit any ongoing drawing, without needing to know which editor is active. + */ + commitDrawing(): void; } let Editable: EditableStatic; diff --git a/types/leaflet-editable/leaflet-editable-tests.ts b/types/leaflet-editable/leaflet-editable-tests.ts index 23bcc988fb..e804fcc250 100644 --- a/types/leaflet-editable/leaflet-editable-tests.ts +++ b/types/leaflet-editable/leaflet-editable-tests.ts @@ -31,6 +31,7 @@ const map: L.Map = L.map('div', { const currentPoly: L.Polygon|L.Polyline| L.Marker = map.editTools.currentPolygon; map.editTools.stopDrawing(); +map.editTools.commitDrawing(); const marker: L.Marker = map.editTools.startMarker(L.latLng(0, 0), { draggable: true }); marker.disable(); diff --git a/types/node-forge/README.md b/types/node-forge/README.md new file mode 100644 index 0000000000..fcac651de8 --- /dev/null +++ b/types/node-forge/README.md @@ -0,0 +1,29 @@ +# DefinitelyTyped for node-forge + +## Current node-forge Version +`v0.7.6` +## Usage + +```bash +npm install --save-dev @types/node-forge +npm install --save node-forge +``` + +example: +```ts +import * as forge from "node-forge"; + +Buffer.isBuffer(forge.pki.ed25519.generateKeyPair().publicKey) // true +``` +## License +BSD-2-Clause + +## dependencies +`@types/node` + +## Author +[Seth Westphal](https://github.com/westy92) +[Kay Schecker](https://github.com/flynetworks) +[Aakash Goenka](https://github.com/a-k-g) +[Rafal2228](https://github.com/rafal2228) +[Beeno Tung](https://github.com/beenotung) diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index 65ff4edb47..e30a217ddc 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for node-forge 0.7.5 +// Type definitions for node-forge 0.7.6 // Project: https://github.com/digitalbazaar/forge // Definitions by: Seth Westphal // Kay Schecker // Aakash Goenka // Rafal2228 +// Beeno Tung // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// declare module "node-forge" { type Byte = string; @@ -73,6 +77,33 @@ declare module "node-forge" { function generateKeyPair(options?: GenerateKeyPairOptions, callback?: (err: Error, keypair: KeyPair) => void): KeyPair; } + namespace ed25519 { + + type NativeBuffer = Buffer | Uint8Array; + + namespace constants { + const PUBLIC_KEY_BYTE_LENGTH = 32; + const PRIVATE_KEY_BYTE_LENGTH = 64; + const SEED_BYTE_LENGTH = 32; + const SIGN_BYTE_LENGTH = 64; + const HASH_BYTE_LENGTH = 64; + } + + function generateKeyPair(options?: { seed?: Buffer | Uint8Array | string }): { + publicKey: NativeBuffer; + privateKey: NativeBuffer; + }; + + function publicKeyFromPrivateKey(options: { privateKey: NativeBuffer }): NativeBuffer; + + function sign(options: { privateKey: NativeBuffer }): NativeBuffer; + + function verify(options: { + signature: Buffer | Uint8Array | util.ByteBuffer | string, + publicKey: NativeBuffer + }): boolean; + } + interface CertificateFieldOptions { name?: string; type?: string; diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 490063fb77..793bbb067c 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -8618,7 +8618,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param coercionType The format for the returned body. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -8635,7 +8635,7 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * The content type is returned as one of the CoercionType values in the asyncResult.value property. */ getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -8669,7 +8669,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -8714,7 +8714,7 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters. * * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -8768,7 +8768,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -8817,7 +8817,7 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -8875,7 +8875,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -8924,7 +8924,7 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; @@ -9066,7 +9066,7 @@ declare namespace Office { * Your callback method should handle this error accordingly. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * @param asyncContext Optional. Any state data that is passed to the callback method. * * [Api set: Mailbox 1.0] @@ -9286,7 +9286,7 @@ declare namespace Office { * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an {@link Office.AsyncResult} object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is message's from value, as an EmailAddressDetails object. */ getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; @@ -9305,7 +9305,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an {@link Office.AsyncResult} object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is message's from value, as an EmailAddressDetails object. */ getAsync(callback?: (result: AsyncResult) => void): void; @@ -9727,7 +9727,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -9750,7 +9750,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -9789,7 +9789,7 @@ declare namespace Office { * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback 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. */ @@ -9872,7 +9872,7 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback 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. */ @@ -9914,7 +9914,7 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type 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. * @@ -9971,7 +9971,7 @@ declare namespace Office { * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** @@ -9994,7 +9994,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. */ @@ -10029,7 +10029,7 @@ declare namespace Office { * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -10101,7 +10101,7 @@ declare namespace Office { * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; @@ -10129,7 +10129,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -10151,7 +10151,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -10197,7 +10197,7 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -10298,7 +10298,7 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @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: AsyncResult) => void): void; /** @@ -10338,7 +10338,7 @@ declare namespace Office { * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; * if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** @@ -10411,7 +10411,7 @@ declare namespace Office { * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } @@ -10752,7 +10752,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -10776,7 +10776,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -10854,7 +10854,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * 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. @@ -10876,7 +10876,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * 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. @@ -11107,7 +11107,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. */ @@ -11137,7 +11137,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -11160,7 +11160,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -11319,7 +11319,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -11342,7 +11342,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -11368,7 +11368,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. */ @@ -11398,7 +11398,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -11422,7 +11422,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -11550,7 +11550,7 @@ declare namespace Office { * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * 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. */ @@ -11618,7 +11618,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * 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. */ @@ -11702,7 +11702,7 @@ declare namespace Office { * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * 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. */ @@ -11746,7 +11746,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. @@ -11777,7 +11777,7 @@ declare namespace Office { * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** @@ -11805,7 +11805,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** @@ -11839,7 +11839,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -11957,7 +11957,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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: AsyncResult) => void): void; @@ -12061,7 +12061,7 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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: AsyncResult) => void): void; @@ -12102,7 +12102,7 @@ declare namespace Office { * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; * if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** @@ -12176,7 +12176,7 @@ declare namespace Office { * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } @@ -12365,7 +12365,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * 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. @@ -12388,7 +12388,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * 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. @@ -12877,7 +12877,7 @@ declare namespace Office { * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the * attachment list. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.asyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * 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. */ @@ -12944,7 +12944,7 @@ declare namespace Office { * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * 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. */ @@ -12998,7 +12998,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -13021,7 +13021,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -13145,7 +13145,7 @@ declare namespace Office { * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * 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. */ @@ -13189,7 +13189,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. @@ -13220,7 +13220,7 @@ declare namespace Office { * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** @@ -13248,7 +13248,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** @@ -13271,7 +13271,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. */ @@ -13307,7 +13307,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -13378,7 +13378,7 @@ declare namespace Office { * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; @@ -13406,7 +13406,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -13429,7 +13429,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -13476,7 +13476,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -13578,7 +13578,7 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ saveAsync(callback: (result: AsyncResult) => void): void; /** @@ -13617,7 +13617,7 @@ declare namespace Office { * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; * if the field is text, then plain text is used. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** @@ -13690,7 +13690,7 @@ declare namespace Office { * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type{@link Office.AsyncResult}. + * typeOffice.AsyncResult. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } @@ -14046,7 +14046,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -14070,7 +14070,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -14149,7 +14149,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * 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. @@ -14173,7 +14173,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * 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. @@ -14406,7 +14406,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. */ @@ -14435,7 +14435,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -14458,7 +14458,7 @@ declare namespace Office { * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * * @beta */ @@ -14530,7 +14530,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * @@ -14552,7 +14552,7 @@ declare namespace Office { * The location of the appointment is provided as a string in the asyncResult.value property. * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.1] * @@ -14572,7 +14572,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -14638,7 +14638,7 @@ declare namespace Office { * * @param location The location of the appointment. The string is limited to 255 characters. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -14770,7 +14770,7 @@ declare namespace Office { * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -15028,7 +15028,7 @@ declare namespace Office { * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. + * type Office.AsyncResult. The token is provided as a string in the asyncResult.value property. */ getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; /** @@ -15082,7 +15082,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. + * type Office.AsyncResult. The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; @@ -15103,7 +15103,7 @@ declare namespace Office { * {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method.| */ @@ -15155,7 +15155,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param data The EWS request. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * The `value` property of the result is the XML of the EWS request provided as a string. * If the result exceeds 1 MB in size, an error message is returned instead. * @param userContext Optional. Any state data that is passed to the asynchronous method. @@ -15269,7 +15269,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.3] * @@ -15336,7 +15336,7 @@ declare namespace Office { * @param JSONmessage A JSON object that contains the notification message to be added to the item. * It contains a NotificationMessageDetails object. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * * [Api set: Mailbox 1.3] * @@ -15362,7 +15362,7 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * The `value` property of the result is an array of NotificationMessageDetails objects. */ getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -15376,7 +15376,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. * The `value` property of the result is an array of NotificationMessageDetails objects. */ getAllAsync(callback: (result: AsyncResult) => void): void; @@ -15402,7 +15402,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -15445,7 +15445,7 @@ declare namespace Office { * * @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 {@link Office.AsyncResult}. + * type Office.AsyncResult. */ removeAsync(key: string, callback: (result: AsyncResult) => void): void; /** @@ -15474,7 +15474,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -15529,7 +15529,7 @@ declare namespace Office { * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. * It contains a NotificationMessageDetails object. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; } @@ -15601,7 +15601,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. + * 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: AsyncResult) => void): void; /** @@ -15674,7 +15674,7 @@ declare namespace Office { * * @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 {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. */ addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; /** @@ -15696,7 +15696,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * The `value` property of the result is an array of EmailAddressDetails objects. */ getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; @@ -15713,7 +15713,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * The `value` property of the result is an array of EmailAddressDetails objects. */ getAsync(callback: (result: AsyncResult) => void): void; @@ -15751,7 +15751,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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. */ @@ -15832,7 +15832,7 @@ declare namespace Office { * * @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 {@link Office.AsyncResult}. + * 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. */ @@ -15969,7 +15969,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is a Recurrence object. */ getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -15988,7 +15988,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. * The `value` property of the result is a Recurrence object. */ getAsync(callback?: (result: AsyncResult) => void): void; @@ -16016,7 +16016,7 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. */ setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -16037,7 +16037,7 @@ declare namespace Office { * * @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 {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. */ setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void; } @@ -16128,7 +16128,7 @@ 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 {@link Office.AsyncResult} object. + * asyncResult, which is an Office.AsyncResult object. */ callback?: (result: AsyncResult) => void; } @@ -16199,7 +16199,7 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. */ saveAsync(callback?: (result: AsyncResult) => void): void; /** @@ -16461,7 +16461,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * The `value` property of the result is the subject of the item. */ getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; @@ -16508,7 +16508,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. + * 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: AsyncResult) => void): void; /** @@ -16566,7 +16566,7 @@ declare namespace Office { * * @param subject The subject of the appointment or message. The string is limited to 255 characters. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. + * type Office.AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. */ setAsync(data: string, callback: (result: AsyncResult) => void): void; @@ -16674,7 +16674,7 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * 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: AsyncResult) => void): void; @@ -16739,7 +16739,7 @@ declare namespace Office { * * @param dateTime A date-time object in Coordinated Universal Time (UTC). * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of - * type {@link Office.AsyncResult}. + * type Office.AsyncResult. * If setting the date and time fails, the asyncResult.error property will contain an error code. */ setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 7bdf862ea2..fa312dbb0f 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -9,6 +9,7 @@ // Drew Diamantoukos // Sooraj Pudiyadath // Jon Freedman +// Megan Riel-Mehan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -29,7 +30,7 @@ export interface Point { export interface PlotScatterDataPoint { curveNumber: number; - data: ScatterData; + data: PlotData; pointIndex: number; pointNumber: number; x: number; @@ -49,8 +50,17 @@ export interface PlotCoordinate { pointNumber: number; } +export interface SelectionRange { + x: number[]; + y: number[]; +} + +export type PlotSelectedData = Partial; + export interface PlotSelectionEvent { - points: PlotCoordinate[]; + points: PlotScatterDataPoint[]; + range?: SelectionRange; + lassoPoints?: SelectionRange; } export type PlotRestyleEvent = [ @@ -141,10 +151,10 @@ export interface PlotlyHTMLElement extends HTMLElement { on(event: 'plotly_sliderend', callback: (event: SliderEndEvent) => void): void; on(event: 'plotly_sliderstart', callback: (event: SliderStartEvent) => void): void; on(event: 'plotly_event', callback: (data: any) => void): void; - on(event: 'plotly_beforeplot' , callback: (event: BeforePlotEvent) => boolean): void; + on(event: 'plotly_beforeplot', callback: (event: BeforePlotEvent) => boolean): void; on(event: 'plotly_afterexport' | 'plotly_afterplot' | 'plotly_animated' | 'plotly_animationinterrupted' | 'plotly_autosize' | 'plotly_beforeexport' | 'plotly_deselect' | 'plotly_doubleclick' | 'plotly_framework' | 'plotly_redraw' | - 'plotly_transitioning' | 'plotly_transitioninterrupted' , callback: () => void): void; + 'plotly_transitioning' | 'plotly_transitioninterrupted', callback: () => void): void; } export interface ToImgopts { @@ -192,6 +202,14 @@ export interface Layout { separators: string; hidesources: boolean; xaxis: Partial; + xaxis2: Partial; + xaxis3: Partial; + xaxis4: Partial; + xaxis5: Partial; + xaxis6: Partial; + xaxis7: Partial; + xaxis8: Partial; + xaxis9: Partial; yaxis: Partial; yaxis2: Partial; yaxis3: Partial; @@ -418,12 +436,13 @@ export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int export type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot'; -export type Data = Partial; +export type Data = Partial; export type Color = string | Array | Array>; - +export type DataTransform = Partial; +export type ScatterData = PlotData; // Bar Scatter -export interface ScatterData { - type: 'bar' | 'pointcloud' | 'scatter' | 'scattergl' | 'scatter3d' |'surface'; +export interface PlotData { + type: 'bar' | 'histogram' | 'pointcloud' | 'scatter' | 'scattergl' | 'scatter3d' | 'surface'; x: Datum[] | Datum[][] | TypedArray; y: Datum[] | Datum[][] | TypedArray; z: Datum[] | Datum[][] | Datum[][][] | TypedArray; @@ -438,7 +457,7 @@ export interface ScatterData { 'line.shape': 'linear' | 'spline' | 'hv' | 'vh' | 'hvh' | 'vhv'; 'line.smoothing': number; 'line.simplify': boolean; - marker: Partial; + marker: Partial; 'marker.symbol': string | string[]; // Drawing.symbolList 'marker.color': Color; 'marker.opacity': number | number[]; @@ -454,15 +473,15 @@ export interface ScatterData { mode: 'lines' | 'markers' | 'text' | 'lines+markers' | 'text+markers' | 'text+lines' | 'text+lines+markers' | 'none'; hoveron: 'points' | 'fills'; hoverinfo: 'all' | 'name' | 'none' | 'skip' | 'text' | - 'x' | 'x+text' | 'x+name' | - 'x+y' | 'x+y+text' | 'x+y+name' | - 'x+y+z' | 'x+y+z+text' | 'x+y+z+name' | - 'y+x' | 'y+x+text' | 'y+x+name' | - 'y+z' | 'y+z+text' | 'y+z+name' | - 'y+x+z' | 'y+x+z+text' | 'y+x+z+name' | - 'z+x' | 'z+x+text' | 'z+x+name' | - 'z+y+x' | 'z+y+x+text' | 'z+y+x+name' | - 'z+x+y' | 'z+x+y+text' | 'z+x+y+name'; + 'x' | 'x+text' | 'x+name' | + 'x+y' | 'x+y+text' | 'x+y+name' | + 'x+y+z' | 'x+y+z+text' | 'x+y+z+name' | + 'y+x' | 'y+x+text' | 'y+x+name' | + 'y+z' | 'y+z+text' | 'y+z+name' | + 'y+x+z' | 'y+x+z+text' | 'y+x+z+name' | + 'z+x' | 'z+x+text' | 'z+x+name' | + 'z+y+x' | 'z+y+x+text' | 'z+y+x+name' | + 'z+x+y' | 'z+x+y+text' | 'z+x+y+name'; hoverlabel: Partial