From 8eca1512eb4c8fa3418d6355c8fbee2cecb69dc1 Mon Sep 17 00:00:00 2001 From: John McLaughlin Date: Wed, 2 Aug 2017 12:13:39 +0700 Subject: [PATCH 001/346] Fixed types of debug.names and debug.skips arrays. --- types/debug/debug-tests.ts | 1 + types/debug/index.d.ts | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/types/debug/debug-tests.ts b/types/debug/debug-tests.ts index fc8d3c5e56..73a16fe782 100644 --- a/types/debug/debug-tests.ts +++ b/types/debug/debug-tests.ts @@ -12,6 +12,7 @@ log("Formatted test (%d arg)", 1); log("Formatted %s (%d args)", "test", 2); log("Enabled?: %s", debug.enabled("DefinitelyTyped:log")); +log("Name Enabled: %s", debug.names.some(name => name.test("DefinitelyTyped:log"))); log("Namespace: %s", log.namespace); var error:debug.IDebugger = debug("DefinitelyTyped:error"); diff --git a/types/debug/index.d.ts b/types/debug/index.d.ts index 45d3ad02f3..8987b13a26 100644 --- a/types/debug/index.d.ts +++ b/types/debug/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for debug // Project: https://github.com/visionmedia/debug -// Definitions by: Seon-Wook Park , Gal Talmor +// Definitions by: Seon-Wook Park +// Gal Talmor +// John McLaughlin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var debug: debug.IDebug; @@ -16,8 +18,8 @@ declare namespace debug { enable: (namespaces: string) => void, enabled: (namespaces: string) => boolean, - names: string[], - skips: string[], + names: RegExp[], + skips: RegExp[], formatters: IFormatters } From 3917abac4746cb36f83610d505279f68c1947d02 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Thu, 12 Oct 2017 11:22:36 +0900 Subject: [PATCH 002/346] Resolve N3.js lint errors --- types/n3/index.d.ts | 209 +++++++++++++++++++---------------------- types/n3/n3-tests.ts | 73 +++++++------- types/n3/tsconfig.json | 2 +- types/n3/tslint.json | 80 +--------------- 4 files changed, 135 insertions(+), 229 deletions(-) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index c773c85a28..0ea01c1883 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -1,125 +1,110 @@ -// Type definitions for N3 +// Type definitions for N3 0.12 // Project: https://github.com/RubenVerborgh/N3.js // Definitions by: Fred Eisele +// Ruben Taelman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - import * as fs from "fs"; import * as stream from "stream"; -declare namespace N3 { +export type ErrorCallback = (err: Error, result: any) => void; - type ErrorCallback = (err: Error, result: any) => void; - - interface Prefixes { - [key: string]: string; - } - - interface LiteralValue { - value: string | number; - } - - interface Triple { - subject: string, - predicate: string, - object: string, - graph?: string - } - - interface BlankTriple { - predicate: string, - object: string - } - - - interface ParserConstructor { - new (options?: ParserOptions): N3Parser; - (options?: ParserOptions): N3Parser; - } - const Parser: ParserConstructor; - - interface StreamParserConstructor { - new (options?: ParserOptions): N3StreamParser; - (options?: ParserOptions): N3StreamParser; - } - const StreamParser: StreamParserConstructor; - - interface ParserOptions { - format?: string, - prefixes?: string[] - } - - interface ParseCallback { - (error: Error, triple: Triple, prefixes: Prefixes): void; - } - - interface Logger { - (message?: any, ...optionalParams: any[]): void; - } - interface N3Parser { - parse(input: string, callback: ParseCallback): void; - parse(subject: string, predicate: string, object: string): void; - parse(triple: Triple): void; - parse(stream: fs.ReadStream, log: Logger): void; - } - - interface N3StreamParser extends N3Parser, fs.WriteStream { - pipe(consumer: T): T; - } - - - interface WriterConstructor { - new (options?: WriterOptions): N3Writer; - (options?: WriterOptions): N3Writer; - - new (fd: any, options?: WriterOptions): N3Writer; - (fd: any, options?: WriterOptions): N3Writer; - } - const Writer: WriterConstructor; - - interface N3Writer { - addTriple(subject: string, predicate: string, object: string): void; - addTriple(subject: string, predicate: string, object: string[]): void; - addTriple(triple: Triple): void; - end(err?: ErrorCallback, result?: any): void; - blank(ns: string, name: string): string; - blank(triple: BlankTriple[]): string; - list(triple: string[]): string[]; - } - - function StreamWriter(options: WriterOptions): N3StreamWriter; - - interface N3StreamWriter extends N3Writer { - pipe(consumer: NodeJS.WritableStream): void; - pipe(consumer: stream.Writable): void; - } - - interface WriterOptions { - format?: string, - prefixes?: Prefixes - } - - interface N3StoreWriter extends N3Writer { - find(subject: string, predicate: string | null, object: string | null): Triple[]; - } - function Store(): N3StoreWriter; - - namespace Util { - function createLiteral(value: any): string; - function createLiteral(value: any, type: string): string; - - function isIRI(value: string): boolean; - function isLiteral(value: string): boolean; - function getLiteralValue(value: string): string; - function getLiteralLanguage(value: string): string; - function getLiteralType(value: string): string; - function isBlank(value: string): boolean; - function isPrefixedName(name: string): boolean; - function expandPrefixedName(name: string, prefixes: Prefixes): string; - } +export interface Prefixes { + [key: string]: string; } -export = N3; +export interface LiteralValue { + value: string | number; +} +export interface Triple { + subject: string; + predicate: string; + object: string; + graph?: string; +} + +export interface BlankTriple { + predicate: string; + object: string; +} + +export interface ParserConstructor { + new (options?: ParserOptions): N3Parser; + (options?: ParserOptions): N3Parser; +} +export const Parser: ParserConstructor; + +export interface StreamParserConstructor { + new (options?: ParserOptions): N3StreamParser; + (options?: ParserOptions): N3StreamParser; +} +export const StreamParser: StreamParserConstructor; + +export interface ParserOptions { + format?: string; + prefixes?: string[]; +} + +export type ParseCallback = (error: Error, triple: Triple, prefixes: Prefixes) => void; + +export type Logger = (message?: any, ...optionalParams: any[]) => void; + +export interface N3Parser { + parse(input: string, callback: ParseCallback): void; + parse(subject: string, predicate: string, object: string): void; + parse(triple: Triple): void; + parse(stream: fs.ReadStream, log: Logger): void; +} + +export interface N3StreamParser extends N3Parser, fs.WriteStream { + pipe(consumer: T): T; +} + +export interface WriterConstructor { + new (options?: WriterOptions): N3Writer; + new (fd: any, options?: WriterOptions): N3Writer; + (options?: WriterOptions): N3Writer; + (fd: any, options?: WriterOptions): N3Writer; +} +export const Writer: WriterConstructor; + +export interface N3Writer { + addTriple(subject: string, predicate: string, object: string | string[]): void; + addTriple(triple: Triple): void; + end(err?: ErrorCallback, result?: any): void; + blank(ns: string, name: string): string; + blank(triple: BlankTriple[]): string; + list(triple: string[]): string[]; +} + +export function StreamWriter(options: WriterOptions): N3StreamWriter; + +export interface N3StreamWriter extends N3Writer { + pipe(consumer: NodeJS.WritableStream | stream.Writable): void; +} + +export interface WriterOptions { + format?: string; + prefixes?: Prefixes; +} + +export interface N3StoreWriter extends N3Writer { + find(subject: string, predicate: string | null, object: string | null): Triple[]; +} +export function Store(): N3StoreWriter; + +export namespace Util { + function createLiteral(value: any, type?: string): string; + + function isIRI(value: string): boolean; + function isLiteral(value: string): boolean; + function getLiteralValue(value: string): string; + function getLiteralLanguage(value: string): string; + function getLiteralType(value: string): string; + function isBlank(value: string): boolean; + function isPrefixedName(name: string): boolean; + function expandPrefixedName(name: string, prefixes: Prefixes): string; +} diff --git a/types/n3/n3-tests.ts b/types/n3/n3-tests.ts index d3c664c61e..275e0fc039 100644 --- a/types/n3/n3-tests.ts +++ b/types/n3/n3-tests.ts @@ -3,8 +3,7 @@ import * as fs from "fs"; import * as stream from "stream"; function test_serialize() { - - var writer: N3.N3Writer = N3.Writer( + const writer: N3.N3Writer = N3.Writer( { format: "ttl", prefixes: { @@ -24,56 +23,56 @@ function test_serialize() { }); } -/** +/* The following tests are taken from ... https://github.com/RubenVerborgh/N3.js/blob/master/README.md */ function test_doc_rdf_to_triples_1() { - var parser = N3.Parser(); - parser.parse('@prefix c: .\n' + - 'c:Tom a c:Cat.\n' + - 'c:Jerry a c:Mouse;\n' + - ' c:smarterThan c:Tom.', - function (error: Error, triple: N3.Triple, prefixes: N3.Prefixes) { + const parser = N3.Parser(); + parser.parse(`@prefix c: . + c:Tom a c:Cat. + c:Jerry a c:Mouse; + c:smarterThan c:Tom.`, + (error: Error, triple: N3.Triple, prefixes: N3.Prefixes) => { if (triple) console.log(triple.subject, triple.predicate, triple.object, '.'); else - console.log("# That's all, folks!", prefixes) + console.log("# That's all, folks!", prefixes); }); } function test_doc_rdf_to_triples_2() { - var parser1 = N3.Parser({ format: 'N-Triples' }); - var parser2 = N3.Parser({ format: 'application/trig' }); + const parser1 = N3.Parser({ format: 'N-Triples' }); + const parser2 = N3.Parser({ format: 'application/trig' }); // Notation3 (N3) is supported only through the format argument: - var parser3 = N3.Parser({ format: 'N3' }); - var parser4 = N3.Parser({ format: 'Notation3' }); - var parser5 = N3.Parser({ format: 'text/n3' }); + const parser3 = N3.Parser({ format: 'N3' }); + const parser4 = N3.Parser({ format: 'Notation3' }); + const parser5 = N3.Parser({ format: 'text/n3' }); } function test_doc_rdf_stream_to_triples_1() { - var parser = N3.Parser(); - var rdfStream = fs.createReadStream('cartoons.ttl'); - parser.parse(rdfStream, console.log); + const parser = N3.Parser(); + const rdfStream1 = fs.createReadStream('cartoons.ttl'); + parser.parse(rdfStream1, console.log); - var streamParser = N3.StreamParser(); - var rdfStream = fs.createReadStream('cartoons.ttl'); - rdfStream.pipe(streamParser); + const streamParser = N3.StreamParser(); + const rdfStream2 = fs.createReadStream('cartoons.ttl'); + rdfStream2.pipe(streamParser); streamParser.pipe(new class SlowConsumer extends stream.Writable { constructor() { super({ objectMode: true }); - this._write = function (triple, encoding, done) { + this._write = (triple, encoding, done) => { console.log(triple); setTimeout(done, 1000); }; } - }); + }()); } function test_doc_from_triples_to_string() { - var writer = N3.Writer({ prefixes: { c: 'http://example.org/cartoons#' } }); + const writer = N3.Writer({ prefixes: { c: 'http://example.org/cartoons#' } }); writer.addTriple('http://example.org/cartoons#Tom', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://example.org/cartoons#Cat'); @@ -82,14 +81,14 @@ function test_doc_from_triples_to_string() { predicate: 'http://example.org/cartoons#name', object: '"Tom"' }); - writer.end(function (error, result) { console.log(result); }); + writer.end((error, result) => { console.log(result); }); - var writer1 = N3.Writer({ format: 'N-Triples' }); - var writer2 = N3.Writer({ format: 'application/trig' }); + const writer1 = N3.Writer({ format: 'N-Triples' }); + const writer2 = N3.Writer({ format: 'application/trig' }); } function test_doc_from_triples_to_rdf_stream() { - var writer = N3.Writer(process.stdout, { prefixes: { c: 'http://example.org/cartoons#' } }); + const writer = N3.Writer(process.stdout, { prefixes: { c: 'http://example.org/cartoons#' } }); writer.addTriple('http://example.org/cartoons#Tom', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://example.org/cartoons#Cat'); @@ -102,16 +101,16 @@ function test_doc_from_triples_to_rdf_stream() { } function test_doc_from_triple_stream_to_rdf_stream() { - var streamParser = new N3.StreamParser(), - inputStream = fs.createReadStream('cartoons.ttl'), - streamWriter = /* new */ N3.StreamWriter({ prefixes: { c: 'http://example.org/cartoons#' } }); + const streamParser = new N3.StreamParser(); + const inputStream = fs.createReadStream('cartoons.ttl'); + const streamWriter = /* new */ N3.StreamWriter({ prefixes: { c: 'http://example.org/cartoons#' } }); inputStream.pipe(streamParser); streamParser.pipe(streamWriter); streamWriter.pipe(process.stdout); } function test_doc_blank_nodes_and_lists() { - var writer = N3.Writer({ + const writer = N3.Writer({ prefixes: { c: 'http://example.org/cartoons#', foaf: 'http://xmlns.com/foaf/0.1/' @@ -135,20 +134,20 @@ function test_doc_blank_nodes_and_lists() { 'http://example.org/cartoons#Tom', 'http://example.org/cartoons#Jerry' ])); - writer.end(function (error, result) { console.log(result); }); + writer.end((error, result) => { console.log(result); }); } function test_doc_storing() { - var store = N3.Store(); + const store = N3.Store(); store.addTriple('http://ex.org/Pluto', 'http://ex.org/type', 'http://ex.org/Dog'); store.addTriple('http://ex.org/Mickey', 'http://ex.org/type', 'http://ex.org/Mouse'); - var mickey = store.find('http://ex.org/Mickey', null, null)[0]; + const mickey = store.find('http://ex.org/Mickey', null, null)[0]; console.log(mickey.subject, mickey.predicate, mickey.object, '.'); } function test_doc_utility() { - var N3Util = N3.Util; + const N3Util = N3.Util; N3Util.isIRI('http://example.org/cartoons#Mickey'); // true N3Util.isLiteral('"Mickey Mouse"'); // true @@ -175,7 +174,7 @@ function test_doc_utility() { N3Util.isIRI('_:b1'); // false N3Util.isLiteral('_:b1'); // false - var prefixes: N3.Prefixes = { rdfs: 'http://www.w3.org/2000/01/rdf-schema#' }; + const prefixes: N3.Prefixes = { rdfs: 'http://www.w3.org/2000/01/rdf-schema#' }; N3Util.isPrefixedName('rdfs:label'); // true; N3Util.expandPrefixedName('rdfs:label', prefixes); // http://www.w3.org/2000/01/rdf-schema#label } diff --git a/types/n3/tsconfig.json b/types/n3/tsconfig.json index 4ba121903d..11e61e58e3 100644 --- a/types/n3/tsconfig.json +++ b/types/n3/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "n3-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/n3/tslint.json b/types/n3/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/n3/tslint.json +++ b/types/n3/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } From 974a50c7f537f5b982f812c3b0b561ec1300e5c0 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Thu, 12 Oct 2017 12:10:36 +0900 Subject: [PATCH 003/346] Update n3 to 0.12 with RDFJS types --- types/n3/index.d.ts | 87 +++++++++++++++++++++++++++++++++++++------- types/n3/n3-tests.ts | 12 +++--- 2 files changed, 79 insertions(+), 20 deletions(-) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 0ea01c1883..c83005e9cc 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -8,6 +8,7 @@ import * as fs from "fs"; import * as stream from "stream"; +import * as RDF from "rdf-js"; export type ErrorCallback = (err: Error, result: any) => void; @@ -15,17 +16,71 @@ export interface Prefixes { [key: string]: string; } -export interface LiteralValue { - value: string | number; +export class Term { + termType: "NamedNode" | "BlankNode" | "Literal" | "Variable" | "DefaultGraph"; + constructor(iri: string); + toJSON(): string; + equals(other: RDF.Term): boolean; + subclass(type: any): void; + static fromId(id: string): NamedNode | BlankNode | Variable | Literal; } -export interface Triple { - subject: string; - predicate: string; - object: string; - graph?: string; +export class NamedNode extends Term implements RDF.NamedNode { + termType: "NamedNode"; + value: string; + constructor(iri: string); + toJSON(): string; + equals(other: RDF.Term): boolean; } +export class BlankNode extends Term implements RDF.BlankNode { + static nextId: number; + termType: "BlankNode"; + value: string; + constructor(name: string); + toJSON(): string; + equals(other: RDF.Term): boolean; +} + +export class Variable extends Term implements RDF.Variable { + termType: "Variable"; + value: string; + constructor(name: string); + toJSON(): string; + equals(other: RDF.Term): boolean; +} + +export class Literal extends Term implements RDF.Literal { + static readonly langStringDatatype: NamedNode; + termType: "Literal"; + value: string; + language: string; + datatype: RDF.NamedNode; + datatypeString: string; + constructor(id: string); + toJSON(): string; + equals(other: RDF.Term): boolean; +} + +export class DefaultGraph extends Term implements RDF.DefaultGraph { + termType: "DefaultGraph"; + value: ""; + constructor(); + equals(other: RDF.Term): boolean; +} + +export class Quad implements RDF.Quad { + constructor(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term, graph?: RDF.Term); + subject: RDF.Term; + predicate: RDF.Term; + object: RDF.Term; + graph: RDF.Term; + toJSON(): string; + equals(quad: RDF.Quad): boolean; +} + +export class Triple extends Quad implements RDF.Triple {} + export interface BlankTriple { predicate: string; object: string; @@ -48,15 +103,12 @@ export interface ParserOptions { prefixes?: string[]; } -export type ParseCallback = (error: Error, triple: Triple, prefixes: Prefixes) => void; +export type ParseCallback = (error: Error, quad: Quad, prefixes: Prefixes) => void; export type Logger = (message?: any, ...optionalParams: any[]) => void; export interface N3Parser { parse(input: string, callback: ParseCallback): void; - parse(subject: string, predicate: string, object: string): void; - parse(triple: Triple): void; - parse(stream: fs.ReadStream, log: Logger): void; } export interface N3StreamParser extends N3Parser, fs.WriteStream { @@ -71,9 +123,16 @@ export interface WriterConstructor { } export const Writer: WriterConstructor; +export interface N3Quad { + subject: string; + predicate: string; + object: string; + graph?: string; +} + export interface N3Writer { - addTriple(subject: string, predicate: string, object: string | string[]): void; - addTriple(triple: Triple): void; + addTriple(subject: string, predicate: string, object: string | string[], graph?: string, done?: () => void): void; + addTriple(quad: N3Quad): void; end(err?: ErrorCallback, result?: any): void; blank(ns: string, name: string): string; blank(triple: BlankTriple[]): string; @@ -92,7 +151,7 @@ export interface WriterOptions { } export interface N3StoreWriter extends N3Writer { - find(subject: string, predicate: string | null, object: string | null): Triple[]; + find(subject: string, predicate: string | null, object: string | null): N3Quad[]; } export function Store(): N3StoreWriter; diff --git a/types/n3/n3-tests.ts b/types/n3/n3-tests.ts index 275e0fc039..f7e181cc74 100644 --- a/types/n3/n3-tests.ts +++ b/types/n3/n3-tests.ts @@ -1,4 +1,5 @@ import * as N3 from "n3"; +import * as RDF from "rdf-js"; import * as fs from "fs"; import * as stream from "stream"; @@ -54,17 +55,16 @@ function test_doc_rdf_to_triples_2() { function test_doc_rdf_stream_to_triples_1() { const parser = N3.Parser(); - const rdfStream1 = fs.createReadStream('cartoons.ttl'); - parser.parse(rdfStream1, console.log); + parser.parse('abc', console.log); const streamParser = N3.StreamParser(); - const rdfStream2 = fs.createReadStream('cartoons.ttl'); - rdfStream2.pipe(streamParser); + const rdfStream = fs.createReadStream('cartoons.ttl'); + rdfStream.pipe(streamParser); streamParser.pipe(new class SlowConsumer extends stream.Writable { constructor() { super({ objectMode: true }); - this._write = (triple, encoding, done) => { - console.log(triple); + this._write = (quad: RDF.Quad, encoding, done) => { + console.log(quad); setTimeout(done, 1000); }; } From b5719fd0d2db94f6e83de67600a439825158c5bb Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Fri, 13 Oct 2017 14:39:57 +0900 Subject: [PATCH 004/346] Update n3 writer types --- types/n3/index.d.ts | 105 +++++++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 31 deletions(-) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index c83005e9cc..4621336998 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Fred Eisele // Ruben Taelman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -10,19 +11,19 @@ import * as fs from "fs"; import * as stream from "stream"; import * as RDF from "rdf-js"; -export type ErrorCallback = (err: Error, result: any) => void; - export interface Prefixes { [key: string]: string; } export class Term { termType: "NamedNode" | "BlankNode" | "Literal" | "Variable" | "DefaultGraph"; + id: string; constructor(iri: string); toJSON(): string; equals(other: RDF.Term): boolean; subclass(type: any): void; static fromId(id: string): NamedNode | BlankNode | Variable | Literal; + static toId(term: string | null | RDF.Term): string; } export class NamedNode extends Term implements RDF.NamedNode { @@ -81,9 +82,18 @@ export class Quad implements RDF.Quad { export class Triple extends Quad implements RDF.Triple {} +export type ErrorCallback = (err: Error, result: any) => void; +export type QuadCallback = (result: Quad) => void; +export type QuadPredicate = (result: Quad) => boolean; + +export type OTerm = string | null; +export type OIRI = RDF.Term | null; + +export type Logger = (message?: any, ...optionalParams: any[]) => void; + export interface BlankTriple { - predicate: string; - object: string; + predicate: RDF.Term; + object: RDF.Term; } export interface ParserConstructor { @@ -92,12 +102,6 @@ export interface ParserConstructor { } export const Parser: ParserConstructor; -export interface StreamParserConstructor { - new (options?: ParserOptions): N3StreamParser; - (options?: ParserOptions): N3StreamParser; -} -export const StreamParser: StreamParserConstructor; - export interface ParserOptions { format?: string; prefixes?: string[]; @@ -105,16 +109,25 @@ export interface ParserOptions { export type ParseCallback = (error: Error, quad: Quad, prefixes: Prefixes) => void; -export type Logger = (message?: any, ...optionalParams: any[]) => void; - export interface N3Parser { parse(input: string, callback: ParseCallback): void; } +export interface StreamParserConstructor { + new (options?: ParserOptions): N3StreamParser; + (options?: ParserOptions): N3StreamParser; +} +export const StreamParser: StreamParserConstructor; + export interface N3StreamParser extends N3Parser, fs.WriteStream { pipe(consumer: T): T; } +export interface WriterOptions { + format?: string; + prefixes?: Prefixes; +} + export interface WriterConstructor { new (options?: WriterOptions): N3Writer; new (fd: any, options?: WriterOptions): N3Writer; @@ -123,20 +136,16 @@ export interface WriterConstructor { } export const Writer: WriterConstructor; -export interface N3Quad { - subject: string; - predicate: string; - object: string; - graph?: string; -} - export interface N3Writer { - addTriple(subject: string, predicate: string, object: string | string[], graph?: string, done?: () => void): void; - addTriple(quad: N3Quad): void; + tripleToString(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term, graph?: RDF.Term): string; + triplesToString(quads: RDF.Quad[]): string; + addTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; + addTriple(quad: RDF.Quad): void; + addTriples(quads: RDF.Quad[]): void; end(err?: ErrorCallback, result?: any): void; - blank(ns: string, name: string): string; - blank(triple: BlankTriple[]): string; - list(triple: string[]): string[]; + blank(predicate: RDF.Term, object: RDF.Term): string; + blank(triple: BlankTriple | RDF.Quad | BlankTriple[] | RDF.Quad[]): string; + list(triple: RDF.Term[]): string[]; } export function StreamWriter(options: WriterOptions): N3StreamWriter; @@ -145,16 +154,50 @@ export interface N3StreamWriter extends N3Writer { pipe(consumer: NodeJS.WritableStream | stream.Writable): void; } -export interface WriterOptions { - format?: string; +export interface N3Store { + size: number; + addTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; + addTriple(quad: RDF.Quad): void; + addTriples(quads: RDF.Quad[]): void; + addPrefix(prefix: string, iri: RDF.NamedNode): void; + addPrefixes(prefixes: Prefixes): void; + removeTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; + removeTriple(quad: RDF.Quad): void; + removeTriples(quads: RDF.Quad[]): void; + getTriples(subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): Quad[]; + getTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): Quad[]; + countTriples(subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): number; + countTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): number; + forEach(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): void; + forEachByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): void; + every(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + everyByIRI(callback: QuadPredicate, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): boolean; + some(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + someByIRI(callback: QuadPredicate, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): boolean; + getSubjects(predicate: OTerm, object: OTerm, graph: OTerm): RDF.Term[]; + getSubjectsByIRI(predicate: OIRI, object: OIRI, graph: OIRI): RDF.Term[]; + forSubjects(callback: QuadCallback, predicate: OTerm, object: OTerm, graph: OTerm): void; + forSubjectsByIRI(callback: QuadCallback, predicate: OIRI, object: OIRI, graph: OIRI): void; + getPredicates(subject: OTerm, object: OTerm, graph: OTerm): RDF.Term[]; + getPredicatesByIRI(subject: OIRI, object: OIRI, graph: OIRI): RDF.Term[]; + forPredicates(callback: QuadCallback, subject: OTerm, object: OTerm, graph: OTerm): void; + forPredicatesByIRI(callback: QuadCallback, subject: OIRI, object: OIRI, graph: OIRI): void; + getObjects(subject: OTerm, predicate: OTerm, graph: OTerm): RDF.Term[]; + getObjectsByIRI(subject: OIRI, predicate: OIRI, graph: OIRI): RDF.Term[]; + forObjects(callback: QuadCallback, subject: OTerm, predicate: OTerm, graph: OTerm): void; + forObjectsByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, graph: OIRI): void; + getGraphs(subject: OTerm, predicate: OTerm, object: OTerm): RDF.Term[]; + getGraphsByIRI(subject: OIRI, predicate: OIRI, object: OIRI): RDF.Term[]; + forGraphs(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm): void; + forGraphsByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, object: OIRI): void; + createBlankNode(suggestedName: string): BlankNode; +} +export function Store(triples?: RDF.Quad[], options?: StoreOptions): N3Store; + +export interface StoreOptions { prefixes?: Prefixes; } -export interface N3StoreWriter extends N3Writer { - find(subject: string, predicate: string | null, object: string | null): N3Quad[]; -} -export function Store(): N3StoreWriter; - export namespace Util { function createLiteral(value: any, type?: string): string; From d51d1c98efa1edc5a0d2d2474ea67aa419a66c8b Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Wed, 18 Oct 2017 15:26:20 +0900 Subject: [PATCH 005/346] Update n3 store and util types --- types/n3/index.d.ts | 51 ++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 4621336998..75c2318743 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -86,7 +86,7 @@ export type ErrorCallback = (err: Error, result: any) => void; export type QuadCallback = (result: Quad) => void; export type QuadPredicate = (result: Quad) => boolean; -export type OTerm = string | null; +export type OString = string | RDF.Term | null; export type OIRI = RDF.Term | null; export type Logger = (message?: any, ...optionalParams: any[]) => void; @@ -155,7 +155,7 @@ export interface N3StreamWriter extends N3Writer { } export interface N3Store { - size: number; + readonly size: number; addTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; addTriple(quad: RDF.Quad): void; addTriples(quads: RDF.Quad[]): void; @@ -164,31 +164,31 @@ export interface N3Store { removeTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; removeTriple(quad: RDF.Quad): void; removeTriples(quads: RDF.Quad[]): void; - getTriples(subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): Quad[]; - getTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): Quad[]; - countTriples(subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): number; + getTriples(subject: OString, predicate: OString, object: OString | OString[], graph: OString): Quad[]; + getTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI | OIRI[], graph: OIRI): Quad[]; + countTriples(subject: OString, predicate: OString, object: OString, graph: OString): number; countTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): number; - forEach(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): void; + forEach(callback: QuadCallback, subject: OString, predicate: OString, object: OString, graph: OString): void; forEachByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): void; - every(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + every(callback: QuadPredicate, subject: OString, predicate: OString, object: OString, graph: OString): boolean; everyByIRI(callback: QuadPredicate, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): boolean; - some(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + some(callback: QuadPredicate, subject: OString, predicate: OString, object: OString, graph: OString): boolean; someByIRI(callback: QuadPredicate, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): boolean; - getSubjects(predicate: OTerm, object: OTerm, graph: OTerm): RDF.Term[]; + getSubjects(predicate: OString, object: OString, graph: OString): RDF.Term[]; getSubjectsByIRI(predicate: OIRI, object: OIRI, graph: OIRI): RDF.Term[]; - forSubjects(callback: QuadCallback, predicate: OTerm, object: OTerm, graph: OTerm): void; + forSubjects(callback: QuadCallback, predicate: OString, object: OString, graph: OString): void; forSubjectsByIRI(callback: QuadCallback, predicate: OIRI, object: OIRI, graph: OIRI): void; - getPredicates(subject: OTerm, object: OTerm, graph: OTerm): RDF.Term[]; + getPredicates(subject: OString, object: OString, graph: OString): RDF.Term[]; getPredicatesByIRI(subject: OIRI, object: OIRI, graph: OIRI): RDF.Term[]; - forPredicates(callback: QuadCallback, subject: OTerm, object: OTerm, graph: OTerm): void; + forPredicates(callback: QuadCallback, subject: OString, object: OString, graph: OString): void; forPredicatesByIRI(callback: QuadCallback, subject: OIRI, object: OIRI, graph: OIRI): void; - getObjects(subject: OTerm, predicate: OTerm, graph: OTerm): RDF.Term[]; + getObjects(subject: OString, predicate: OString, graph: OString): RDF.Term[]; getObjectsByIRI(subject: OIRI, predicate: OIRI, graph: OIRI): RDF.Term[]; - forObjects(callback: QuadCallback, subject: OTerm, predicate: OTerm, graph: OTerm): void; + forObjects(callback: QuadCallback, subject: OString, predicate: OString, graph: OString): void; forObjectsByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, graph: OIRI): void; - getGraphs(subject: OTerm, predicate: OTerm, object: OTerm): RDF.Term[]; + getGraphs(subject: OString, predicate: OString, object: OString): RDF.Term[]; getGraphsByIRI(subject: OIRI, predicate: OIRI, object: OIRI): RDF.Term[]; - forGraphs(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm): void; + forGraphs(callback: QuadCallback, subject: OString, predicate: OString, object: OString): void; forGraphsByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, object: OIRI): void; createBlankNode(suggestedName: string): BlankNode; } @@ -199,14 +199,17 @@ export interface StoreOptions { } export namespace Util { - function createLiteral(value: any, type?: string): string; + function createLiteral(value: any, type?: string): Literal; + function createIRI(iri: string): NamedNode; - function isIRI(value: string): boolean; - function isLiteral(value: string): boolean; - function getLiteralValue(value: string): string; - function getLiteralLanguage(value: string): string; - function getLiteralType(value: string): string; - function isBlank(value: string): boolean; + function isIRI(value: RDF.Term | null): boolean; + function isLiteral(value: RDF.Term | null): boolean; + function isBlank(value: RDF.Term | null): boolean; + function isDefaultGraph(value: RDF.Term | null): boolean; + function inDefaultGraph(value: RDF.Quad): boolean; + function getLiteralValue(value: RDF.Literal): string; + function getLiteralLanguage(value: RDF.Literal): string; + function getLiteralType(value: RDF.Literal): RDF.NamedNode; function isPrefixedName(name: string): boolean; - function expandPrefixedName(name: string, prefixes: Prefixes): string; + function expandPrefixedName(name: string, prefixes: Prefixes): string | RDF.NamedNode; } From 8155227b9c7335604e1ae484078539b9aaf16982 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Fri, 13 Apr 2018 07:40:05 +0200 Subject: [PATCH 006/346] Update n3 typings to 1.0.0 --- types/n3/index.d.ts | 121 +++++++++++++++++++------------------------ types/n3/n3-tests.ts | 117 ++++++++++++++++++++--------------------- types/n3/tslint.json | 80 +++++++++++++++++++++++++++- 3 files changed, 188 insertions(+), 130 deletions(-) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 75c2318743..2e038f0878 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for N3 0.12 +// Type definitions for N3 1.0 // Project: https://github.com/RubenVerborgh/N3.js // Definitions by: Fred Eisele // Ruben Taelman @@ -10,18 +10,20 @@ import * as fs from "fs"; import * as stream from "stream"; import * as RDF from "rdf-js"; +import { EventEmitter } from "events"; export interface Prefixes { [key: string]: string; } -export class Term { +export class Term implements RDF.Term { termType: "NamedNode" | "BlankNode" | "Literal" | "Variable" | "DefaultGraph"; id: string; + value: string; constructor(iri: string); toJSON(): string; equals(other: RDF.Term): boolean; - subclass(type: any): void; + static subclass(type: any): void; static fromId(id: string): NamedNode | BlankNode | Variable | Literal; static toId(term: string | null | RDF.Term): string; } @@ -30,8 +32,6 @@ export class NamedNode extends Term implements RDF.NamedNode { termType: "NamedNode"; value: string; constructor(iri: string); - toJSON(): string; - equals(other: RDF.Term): boolean; } export class BlankNode extends Term implements RDF.BlankNode { @@ -39,16 +39,12 @@ export class BlankNode extends Term implements RDF.BlankNode { termType: "BlankNode"; value: string; constructor(name: string); - toJSON(): string; - equals(other: RDF.Term): boolean; } export class Variable extends Term implements RDF.Variable { termType: "Variable"; value: string; constructor(name: string); - toJSON(): string; - equals(other: RDF.Term): boolean; } export class Literal extends Term implements RDF.Literal { @@ -59,15 +55,12 @@ export class Literal extends Term implements RDF.Literal { datatype: RDF.NamedNode; datatypeString: string; constructor(id: string); - toJSON(): string; - equals(other: RDF.Term): boolean; } export class DefaultGraph extends Term implements RDF.DefaultGraph { termType: "DefaultGraph"; value: ""; constructor(); - equals(other: RDF.Term): boolean; } export class Quad implements RDF.Quad { @@ -76,18 +69,27 @@ export class Quad implements RDF.Quad { predicate: RDF.Term; object: RDF.Term; graph: RDF.Term; + equals(other: RDF.Quad): boolean; toJSON(): string; - equals(quad: RDF.Quad): boolean; } export class Triple extends Quad implements RDF.Triple {} +export namespace DataFactory { + function namedNode(value: string): RDF.NamedNode; + function blankNode(value?: string): RDF.BlankNode; + function literal(value: string | number, languageOrDatatype?: string | RDF.NamedNode): RDF.Literal; + function variable(value: string): RDF.Variable; + function defaultGraph(): RDF.DefaultGraph; + function triple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term): RDF.Quad; + function quad(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term, graph?: RDF.Term): RDF.Quad; +} + export type ErrorCallback = (err: Error, result: any) => void; export type QuadCallback = (result: Quad) => void; export type QuadPredicate = (result: Quad) => boolean; -export type OString = string | RDF.Term | null; -export type OIRI = RDF.Term | null; +export type OTerm = RDF.Term | string | null; export type Logger = (message?: any, ...optionalParams: any[]) => void; @@ -137,15 +139,15 @@ export interface WriterConstructor { export const Writer: WriterConstructor; export interface N3Writer { - tripleToString(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term, graph?: RDF.Term): string; - triplesToString(quads: RDF.Quad[]): string; - addTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; - addTriple(quad: RDF.Quad): void; - addTriples(quads: RDF.Quad[]): void; + quadToString(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term, graph?: RDF.Term): string; + quadsToString(quads: RDF.Quad[]): string; + addQuad(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; + addQuad(quad: RDF.Quad): void; + addQuads(quads: RDF.Quad[]): void; end(err?: ErrorCallback, result?: any): void; - blank(predicate: RDF.Term, object: RDF.Term): string; - blank(triple: BlankTriple | RDF.Quad | BlankTriple[] | RDF.Quad[]): string; - list(triple: RDF.Term[]): string[]; + blank(predicate: RDF.Term, object: RDF.Term): RDF.Term; + blank(triple: BlankTriple | RDF.Quad | BlankTriple[] | RDF.Quad[]): RDF.Term; + list(triple: RDF.Term[]): RDF.Term[]; } export function StreamWriter(options: WriterOptions): N3StreamWriter; @@ -154,43 +156,31 @@ export interface N3StreamWriter extends N3Writer { pipe(consumer: NodeJS.WritableStream | stream.Writable): void; } -export interface N3Store { +export interface N3Store extends RDF.Sink { readonly size: number; - addTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; - addTriple(quad: RDF.Quad): void; - addTriples(quads: RDF.Quad[]): void; - addPrefix(prefix: string, iri: RDF.NamedNode): void; - addPrefixes(prefixes: Prefixes): void; - removeTriple(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; - removeTriple(quad: RDF.Quad): void; - removeTriples(quads: RDF.Quad[]): void; - getTriples(subject: OString, predicate: OString, object: OString | OString[], graph: OString): Quad[]; - getTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI | OIRI[], graph: OIRI): Quad[]; - countTriples(subject: OString, predicate: OString, object: OString, graph: OString): number; - countTriplesByIRI(subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): number; - forEach(callback: QuadCallback, subject: OString, predicate: OString, object: OString, graph: OString): void; - forEachByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): void; - every(callback: QuadPredicate, subject: OString, predicate: OString, object: OString, graph: OString): boolean; - everyByIRI(callback: QuadPredicate, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): boolean; - some(callback: QuadPredicate, subject: OString, predicate: OString, object: OString, graph: OString): boolean; - someByIRI(callback: QuadPredicate, subject: OIRI, predicate: OIRI, object: OIRI, graph: OIRI): boolean; - getSubjects(predicate: OString, object: OString, graph: OString): RDF.Term[]; - getSubjectsByIRI(predicate: OIRI, object: OIRI, graph: OIRI): RDF.Term[]; - forSubjects(callback: QuadCallback, predicate: OString, object: OString, graph: OString): void; - forSubjectsByIRI(callback: QuadCallback, predicate: OIRI, object: OIRI, graph: OIRI): void; - getPredicates(subject: OString, object: OString, graph: OString): RDF.Term[]; - getPredicatesByIRI(subject: OIRI, object: OIRI, graph: OIRI): RDF.Term[]; - forPredicates(callback: QuadCallback, subject: OString, object: OString, graph: OString): void; - forPredicatesByIRI(callback: QuadCallback, subject: OIRI, object: OIRI, graph: OIRI): void; - getObjects(subject: OString, predicate: OString, graph: OString): RDF.Term[]; - getObjectsByIRI(subject: OIRI, predicate: OIRI, graph: OIRI): RDF.Term[]; - forObjects(callback: QuadCallback, subject: OString, predicate: OString, graph: OString): void; - forObjectsByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, graph: OIRI): void; - getGraphs(subject: OString, predicate: OString, object: OString): RDF.Term[]; - getGraphsByIRI(subject: OIRI, predicate: OIRI, object: OIRI): RDF.Term[]; - forGraphs(callback: QuadCallback, subject: OString, predicate: OString, object: OString): void; - forGraphsByIRI(callback: QuadCallback, subject: OIRI, predicate: OIRI, object: OIRI): void; + addQuad(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; + addQuad(quad: RDF.Quad): void; + addQuads(quads: RDF.Quad[]): void; + removeQuad(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; + removeQuad(quad: RDF.Quad): void; + removeQuads(quads: RDF.Quad[]): void; + getQuads(subject: OTerm, predicate: OTerm, object: OTerm | OTerm[], graph: OTerm): Quad[]; + countQuads(subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): number; + forEach(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): void; + every(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + some(callback: QuadPredicate, subject: OTerm, predicate: OTerm, object: OTerm, graph: OTerm): boolean; + getSubjects(predicate: OTerm, object: OTerm, graph: OTerm): RDF.Term[]; + forSubjects(callback: QuadCallback, predicate: OTerm, object: OTerm, graph: OTerm): void; + getPredicates(subject: OTerm, object: OTerm, graph: OTerm): RDF.Term[]; + forPredicates(callback: QuadCallback, subject: OTerm, object: OTerm, graph: OTerm): void; + getObjects(subject: OTerm, predicate: OTerm, graph: OTerm): RDF.Term[]; + forObjects(callback: QuadCallback, subject: OTerm, predicate: OTerm, graph: OTerm): void; + getGraphs(subject: OTerm, predicate: OTerm, object: OTerm): RDF.Term[]; + forGraphs(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm): void; createBlankNode(suggestedName: string): BlankNode; + + // match, removeMatches and deleteGraph are missing for full RDF.Store adherence + remove(stream: stream.Stream): EventEmitter; } export function Store(triples?: RDF.Quad[], options?: StoreOptions): N3Store; @@ -199,17 +189,12 @@ export interface StoreOptions { } export namespace Util { - function createLiteral(value: any, type?: string): Literal; - function createIRI(iri: string): NamedNode; - - function isIRI(value: RDF.Term | null): boolean; + function isNamedNode(value: RDF.Term | null): boolean; + function isBlankNode(value: RDF.Term | null): boolean; function isLiteral(value: RDF.Term | null): boolean; - function isBlank(value: RDF.Term | null): boolean; + function isVariable(value: RDF.Term | null): boolean; function isDefaultGraph(value: RDF.Term | null): boolean; function inDefaultGraph(value: RDF.Quad): boolean; - function getLiteralValue(value: RDF.Literal): string; - function getLiteralLanguage(value: RDF.Literal): string; - function getLiteralType(value: RDF.Literal): RDF.NamedNode; - function isPrefixedName(name: string): boolean; - function expandPrefixedName(name: string, prefixes: Prefixes): string | RDF.NamedNode; + function prefix(iri: string): (suffix: string) => RDF.NamedNode; + function prefixes(defaultPrefixes: Prefixes): (iri: string) => (suffix: string) => RDF.NamedNode; } diff --git a/types/n3/n3-tests.ts b/types/n3/n3-tests.ts index f7e181cc74..cdca08b99f 100644 --- a/types/n3/n3-tests.ts +++ b/types/n3/n3-tests.ts @@ -13,11 +13,11 @@ function test_serialize() { g: "http://base.google.com/ns/1.0" } }); - writer.addTriple({ - subject: "subject-name", - predicate: "predicate-name", - object: N3.Util.createLiteral(12) - }); + writer.addQuad(N3.DataFactory.quad( + N3.DataFactory.namedNode("subject-name"), + N3.DataFactory.namedNode("predicate-name"), + N3.DataFactory.literal(12) + )); writer.end((error, result) => { console.log(`result ${result}`); @@ -35,9 +35,9 @@ function test_doc_rdf_to_triples_1() { c:Tom a c:Cat. c:Jerry a c:Mouse; c:smarterThan c:Tom.`, - (error: Error, triple: N3.Triple, prefixes: N3.Prefixes) => { - if (triple) - console.log(triple.subject, triple.predicate, triple.object, '.'); + (error: Error, quad: N3.Quad, prefixes: N3.Prefixes) => { + if (quad) + console.log(quad.subject, quad.predicate, quad.object, quad.graph, '.'); else console.log("# That's all, folks!", prefixes); }); @@ -73,14 +73,16 @@ function test_doc_rdf_stream_to_triples_1() { function test_doc_from_triples_to_string() { const writer = N3.Writer({ prefixes: { c: 'http://example.org/cartoons#' } }); - writer.addTriple('http://example.org/cartoons#Tom', - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - 'http://example.org/cartoons#Cat'); - writer.addTriple({ - subject: 'http://example.org/cartoons#Tom', - predicate: 'http://example.org/cartoons#name', - object: '"Tom"' - }); + writer.addQuad(N3.DataFactory.quad( + N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), + N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), + N3.DataFactory.namedNode('http://example.org/cartoons#Cat') + )); + writer.addQuad(N3.DataFactory.quad( + N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), + N3.DataFactory.namedNode('http://example.org/cartoons#name'), + N3.DataFactory.literal('Tom'), + )); writer.end((error, result) => { console.log(result); }); const writer1 = N3.Writer({ format: 'N-Triples' }); @@ -89,14 +91,16 @@ function test_doc_from_triples_to_string() { function test_doc_from_triples_to_rdf_stream() { const writer = N3.Writer(process.stdout, { prefixes: { c: 'http://example.org/cartoons#' } }); - writer.addTriple('http://example.org/cartoons#Tom', - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - 'http://example.org/cartoons#Cat'); - writer.addTriple({ - subject: 'http://example.org/cartoons#Tom', - predicate: 'http://example.org/cartoons#name', - object: '"Tom"' - }); + writer.addQuad(N3.DataFactory.quad( + N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), + N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), + N3.DataFactory.namedNode('http://example.org/cartoons#Cat'), + )); + writer.addQuad(N3.DataFactory.quad( + N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), + N3.DataFactory.namedNode('http://example.org/cartoons#name'), + N3.DataFactory.literal('Tom'), + )); writer.end(); } @@ -116,65 +120,56 @@ function test_doc_blank_nodes_and_lists() { foaf: 'http://xmlns.com/foaf/0.1/' } }); - writer.addTriple(writer.blank('http://xmlns.com/foaf/0.1/givenName', '"Tom"@en'), - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - 'http://example.org/cartoons#Cat'); - writer.addTriple('http://example.org/cartoons#Jerry', - 'http://xmlns.com/foaf/0.1/knows', + writer.addQuad(writer.blank(N3.DataFactory.namedNode('http://xmlns.com/foaf/0.1/givenName'), N3.DataFactory.literal('Tom', 'en')), + N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), + N3.DataFactory.namedNode('http://example.org/cartoons#Cat')); + writer.addQuad(N3.DataFactory.namedNode('http://example.org/cartoons#Jerry'), + N3.DataFactory.namedNode('http://xmlns.com/foaf/0.1/knows'), writer.blank([{ - predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - object: 'http://example.org/cartoons#Cat' + predicate: N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), + object: N3.DataFactory.namedNode('http://example.org/cartoons#Cat') }, { - predicate: 'http://xmlns.com/foaf/0.1/givenName', - object: '"Tom"@en', + predicate: N3.DataFactory.namedNode('http://xmlns.com/foaf/0.1/givenName'), + object: N3.DataFactory.literal('Tom', 'en'), }])); - writer.addTriple('http://example.org/cartoons#Mammy', - 'http://example.org/cartoons#hasPets', + writer.addQuad(N3.DataFactory.namedNode('http://example.org/cartoons#Mammy'), + N3.DataFactory.namedNode('http://example.org/cartoons#hasPets'), writer.list([ - 'http://example.org/cartoons#Tom', - 'http://example.org/cartoons#Jerry' + N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), + N3.DataFactory.namedNode('http://example.org/cartoons#Jerry') ])); writer.end((error, result) => { console.log(result); }); } function test_doc_storing() { const store = N3.Store(); - store.addTriple('http://ex.org/Pluto', 'http://ex.org/type', 'http://ex.org/Dog'); - store.addTriple('http://ex.org/Mickey', 'http://ex.org/type', 'http://ex.org/Mouse'); + store.addQuad(N3.DataFactory.namedNode('http://ex.org/Pluto'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Dog')); + store.addQuad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse')); - const mickey = store.find('http://ex.org/Mickey', null, null)[0]; + const mickey = store.getQuads(N3.DataFactory.namedNode('http://ex.org/Mickey'), null, null, null)[0]; console.log(mickey.subject, mickey.predicate, mickey.object, '.'); } function test_doc_utility() { const N3Util = N3.Util; - N3Util.isIRI('http://example.org/cartoons#Mickey'); // true + N3Util.isNamedNode(N3.DataFactory.namedNode('http://example.org/cartoons#Mickey')); // true - N3Util.isLiteral('"Mickey Mouse"'); // true - N3Util.getLiteralValue('"Mickey Mouse"'); // 'Mickey Mouse' - N3Util.isLiteral('"Mickey Mouse"@en'); // true - N3Util.getLiteralLanguage('"Mickey Mouse"@en'); // 'en' - N3Util.isLiteral('"3"^^http://www.w3.org/2001/XMLSchema#integer'); // true - N3Util.getLiteralType('"3"^^http://www.w3.org/2001/XMLSchema#integer'); // 'http://www.w3.org/2001/XMLSchema#integer' - N3Util.isLiteral('"http://example.org/"'); // true - N3Util.getLiteralValue('"http://example.org/"'); // 'http://example.org/' + N3Util.isLiteral(N3.DataFactory.literal('Mickey Mouse')); // true + N3Util.isLiteral(N3.DataFactory.literal('Mickey Mouse', 'en')); // true + N3Util.isLiteral(N3.DataFactory.literal('3', N3.DataFactory.namedNode('http://www.w3.org/2001/XMLSchema#integer'))); // true + N3Util.isLiteral(N3.DataFactory.literal('http://example.org/')); // true - N3Util.isLiteral('"This word is "quoted"!"'); // true - N3Util.isLiteral('"3"^^http://www.w3.org/2001/XMLSchema#integer'); // true + N3Util.isLiteral(N3.DataFactory.literal('This word is "quoted"!')); // true + N3Util.isLiteral(N3.DataFactory.literal('3', N3.DataFactory.namedNode('http://www.w3.org/2001/XMLSchema#integer'))); // true new N3.Parser().parse(' "This word is \\"quoted\\"!".', console.log); // { subject: 'a', predicate: 'b', object: '"This word is "quoted"!"' } - N3Util.createLiteral('My text', 'en-gb'); - N3Util.createLiteral('123', 'http://www.w3.org/2001/XMLSchema#integer'); - N3Util.createLiteral(123); - N3Util.createLiteral(false); - - N3Util.isBlank('_:b1'); // true - N3Util.isIRI('_:b1'); // false - N3Util.isLiteral('_:b1'); // false + N3Util.isBlankNode(N3.DataFactory.blankNode('b1')); // true + N3Util.isNamedNode(N3.DataFactory.blankNode('b1')); // false + N3Util.isLiteral(N3.DataFactory.blankNode('b1')); // false const prefixes: N3.Prefixes = { rdfs: 'http://www.w3.org/2000/01/rdf-schema#' }; - N3Util.isPrefixedName('rdfs:label'); // true; - N3Util.expandPrefixedName('rdfs:label', prefixes); // http://www.w3.org/2000/01/rdf-schema#label + const namedNode1: RDF.NamedNode = N3Util.prefix('http://www.w3.org/2000/01/rdf-schema#')('label'); + const namedNode2: RDF.NamedNode = N3Util.prefixes(prefixes)('rdfs')('label'); } diff --git a/types/n3/tslint.json b/types/n3/tslint.json index 3db14f85ea..886f1a8b6c 100644 --- a/types/n3/tslint.json +++ b/types/n3/tslint.json @@ -1 +1,79 @@ -{ "extends": "dtslint/dt.json" } +{ + "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 + } +} From 9c48bfe14b5f5219a630502ecafc3afa338734ef Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 5 Jul 2018 16:47:39 +0300 Subject: [PATCH 007/346] Added support for className option in ImageOverlayOptions. ImageOverlayOptions extends InteractiveLayerOptions as described in Leaflet docs. Added bubblingMouseEvents option to InteractiveLayerOptions. --- types/leaflet/index.d.ts | 4 +++- types/leaflet/leaflet-tests.ts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 89f9625114..47b2ebc515 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -390,6 +390,7 @@ export interface LayerOptions { export interface InteractiveLayerOptions extends LayerOptions { interactive?: boolean; + bubblingMouseEvents?: boolean; } export class Layer extends Evented { @@ -542,12 +543,13 @@ export namespace tileLayer { function wms(baseUrl: string, options?: WMSOptions): TileLayer.WMS; } -export interface ImageOverlayOptions extends LayerOptions { +export interface ImageOverlayOptions extends InteractiveLayerOptions { opacity?: number; alt?: string; interactive?: boolean; attribution?: string; crossOrigin?: boolean; + className?: string; } export class ImageOverlay extends Layer { diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index a22ab91248..1f6671cc8c 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -251,6 +251,29 @@ tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png'); tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', tileLayerOptions); tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''}); +// imageOverlay +let imageOverlayOptions: L.ImageOverlayOptions; +imageOverlayOptions = { + opacity: 100, + alt: 'alt', + interactive: true, + attribution: 'attribution', + crossOrigin: true, + className: 'className', + bubblingMouseEvents: false, + pane: 'pane' +}; + +const imageOverlayBounds = latLngBounds; +let imageOverlay: L.ImageOverlay; +imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds); +imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds, imageOverlayOptions); +imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds, { + opacity: 100, + alt: 'alt', + className: 'className', +}); + const eventHandler = () => {}; const domEvent: Event = {} as Event; L.DomEvent From 7d7efddea88a05d3c0fc1c81c130de5b61f1c3eb Mon Sep 17 00:00:00 2001 From: ostap Date: Fri, 13 Jul 2018 22:16:14 +0300 Subject: [PATCH 008/346] initial --- types/better-queue/better-queue-tests.ts | 117 ++++++++++++++++++++ types/better-queue/index.d.ts | 135 +++++++++++++++++++++++ types/better-queue/tsconfig.json | 23 ++++ types/better-queue/tslint.json | 1 + 4 files changed, 276 insertions(+) create mode 100644 types/better-queue/better-queue-tests.ts create mode 100644 types/better-queue/index.d.ts create mode 100644 types/better-queue/tsconfig.json create mode 100644 types/better-queue/tslint.json diff --git a/types/better-queue/better-queue-tests.ts b/types/better-queue/better-queue-tests.ts new file mode 100644 index 0000000000..afdbbede76 --- /dev/null +++ b/types/better-queue/better-queue-tests.ts @@ -0,0 +1,117 @@ +import Queue = require('better-queue'); + +interface TestTask { + taskId: string; + taskPayload: any; +} + +interface TestResult { + some: string; +} + +new Queue((task, cb) => { + const test = task.anything; + console.log(task); +}); + +new Queue((task: TestTask, cb) => { + const id = task.taskId; + cb(null, 'result'); + cb(); +}, {}); + +const q = new Queue({ + process(task: TestTask, cb) { + const id = task.taskId; + cb(null, { some: 'prop' }); + }, + filter(task, cb) { + const id = task.taskId; + cb(null, task); + }, + merge(oldTask, newTask, cb) { + const oldId = oldTask.taskId; + const newId = newTask.taskId; + cb(null, newTask); + }, + priority(task, cb) { + const id = task.taskId; + cb(null, 10); + }, + precondition(cb) { + cb(null, true); + }, + afterProcessDelay: 1000, + autoResume: true, + batchDelay: 123, + batchDelayTimeout: 123, + batchSize: 123, + cancelIfRunning: true, + concurrent: 123, + failTaskOnProcessException: true, + filo: true, + id: 'taskId', + maxRetries: 1, + maxTimeout: 1, + retryDelay: 1, + storeMaxRetries: 1, + storeRetryTimeout: 1, + preconditionRetryTimeout: 1, + store: 'test' +}); + +new Queue({ + process(tasks: TestTask[], cb) { + const firstId = tasks[0].taskId; + cb(null, { some: 'prop' }); + } +}); + +new Queue(() => { }, { + id(task, cb) { + const id = task.taskId; + cb(null, 'taskId'); + } +}); + +new Queue(() => { }, { + store: { + type: 'test' + } +}); + +class TestStore implements Queue.Store { + connect(cb: (error: any, length: number) => void) { + cb(null, 1); + } + + getTask(taskId: any, cb: (error: any, task: TestTask) => void) { + cb(null, { taskId: '', taskPayload: '' }); + } + + deleteTask(taskId: any, cb: () => void) { + cb(); + } + + putTask(taskId: any, task: TestTask, priority: number, cb: (error: any) => void) { + cb(null); + } + + takeFirstN(n: number, cb: (error: any, lockId: string) => void) { + cb(null, ''); + } + + takeLastN(n: number, cb: (error: any, lockId: string) => void) { + cb(null, ''); + } + + getLock(lockId: string, cb: (error: any, tasks: { [taskId: string]: TestTask }) => void) { + cb(null, { + id: { taskId: 'id', taskPayload: 'payload' } + }); + } + + releaseLock(lockId: string, cb: (error: any) => void) { + cb(null); + } +} diff --git a/types/better-queue/index.d.ts b/types/better-queue/index.d.ts new file mode 100644 index 0000000000..8ee80281fb --- /dev/null +++ b/types/better-queue/index.d.ts @@ -0,0 +1,135 @@ +// Type definitions for better-queue 3.8 +// Project: https://github.com/diamondio/better-queue +// Definitions by: Ostap Nagovitsyn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/* =================== USAGE =================== + import * as Queue from "better-queue"; + var queue = new Queue(...); + =============================================== */ + +/// + +declare class BetterQueue extends NodeJS.EventEmitter { + constructor(options: BetterQueue.QueueOptions); + constructor(process: BetterQueue.ProcessFunction, options?: Partial>); + + push(task: T, cb?: (err: any, result?: K) => void): BetterQueue.Ticket; + + cancel(taskId: any, cb: () => void): void; + + pause(): void; + + resume(): void; + + destroy(cb: () => void): void; + + use(store: BetterQueue.Store): void; + + getStats(): BetterQueue.QueueStats; + + resetStats(): void; + + on(event: 'task_finish', listener: (taskId: any, result: K) => void): this; + on(event: 'task_failed', listener: (taskId: any, errorMessage: string) => void): this; + on(event: 'task_progress', listener: (taskId: any, completed: number, total: number) => void): this; + on(event: BetterQueue.QueueEvent, listener: (...args: any[]) => void): this; +} + +declare namespace BetterQueue { + interface QueueOptions { + process: ProcessFunction; + filter?(task: T, cb: (error: any, task: T) => void): void; + merge?(oldTask: T, newTask: T, cb: (error: any, mergedTask: T) => void): void; + priority?(task: T, cb: (error: any, priority: number) => void): void; + precondition?(cb: (error: any, passOrFail: boolean) => void): void; + id?: keyof T | ((task: T, cb: (error: any, id: keyof T) => void) => void); + cancelIfRunning?: boolean; + autoResume?: boolean; + failTaskOnProcessException?: boolean; + filo?: boolean; + batchSize?: number; + batchDelay?: number; + batchDelayTimeout?: number; + concurrent?: number; + maxTimeout?: number; + afterProcessDelay?: number; + maxRetries?: number; + retryDelay?: number; + storeMaxRetries?: number; + storeRetryTimeout?: number; + preconditionRetryTimeout?: number; + store?: string | StoreOptions | Store; + } + + type ProcessFunction = (task: T | T[], cb: ProcessFunctionCb) => void; + + type ProcessFunctionCb = (error?: any, result?: K) => void; + + type QueueEvent = + 'task_queued' + | 'task_accepted' + | 'task_started' + | 'task_finish' + | 'task_failed' + | 'task_progress' + | 'batch_finish' + | 'batch_failed' + | 'batch_progress' + | 'error'; + + type TicketEvent = + 'accept' + | 'queued' + | 'started' + | 'progress' + | 'finish' + | 'failed' + | 'error'; + + interface Store { + connect(cb: (error: any, length: number) => void): void; + + getTask(taskId: any, cb: (error: any, task: T) => void): void; + + deleteTask(taskId: any, cb: () => void): void; + + putTask(taskId: any, task: T, priority: number, cb: (error: any) => void): void; + + takeFirstN(n: number, cb: (error: any, lockId: string) => void): void; + + takeLastN(n: number, cb: (error: any, lockId: string) => void): void; + + getLock(lockId: string, cb: (error: any, tasks: { [taskId: string]: T }) => void): void; + + releaseLock(lockId: string, cb: (error: any) => void): void; + } + + interface StoreOptions { + type: string; + // store-specific options + [key: string]: any; + } + + class Ticket extends NodeJS.EventEmitter { + on(event: TicketEvent, listener: (...args: any[]) => void): this; + } + + interface TickerProgress { + eta: string; + pct: number; + complete: number; + total: number; + message: string; + } + + interface QueueStats { + total: number; + average: number; + successRate: number; + peak: number; + } +} + +export = BetterQueue; diff --git a/types/better-queue/tsconfig.json b/types/better-queue/tsconfig.json new file mode 100644 index 0000000000..78d86d651d --- /dev/null +++ b/types/better-queue/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false + }, + "files": [ + "index.d.ts", + "better-queue-tests.ts" + ] +} diff --git a/types/better-queue/tslint.json b/types/better-queue/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/better-queue/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 949e297602d867552b11a7be3e8fa92104c5c469 Mon Sep 17 00:00:00 2001 From: ostap Date: Sun, 15 Jul 2018 23:23:58 +0300 Subject: [PATCH 009/346] strictFunctionTypes=true --- types/better-queue/better-queue-tests.ts | 22 ++++++++++++++++++---- types/better-queue/index.d.ts | 4 ++-- types/better-queue/tsconfig.json | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/types/better-queue/better-queue-tests.ts b/types/better-queue/better-queue-tests.ts index afdbbede76..3df520f11c 100644 --- a/types/better-queue/better-queue-tests.ts +++ b/types/better-queue/better-queue-tests.ts @@ -9,18 +9,23 @@ interface TestResult { some: string; } -new Queue((task, cb) => { +new Queue((task) => { const test = task.anything; console.log(task); }); +new Queue((task: TestTask[]) => { + const test = task[0].taskId; + console.log(task); +}); + new Queue((task: TestTask, cb) => { const id = task.taskId; cb(null, 'result'); cb(); }, {}); -const q = new Queue({ +new Queue({ process(task: TestTask, cb) { const id = task.taskId; cb(null, { some: 'prop' }); @@ -61,8 +66,8 @@ const q = new Queue({ }); new Queue({ - process(tasks: TestTask[], cb) { - const firstId = tasks[0].taskId; + process(task: TestTask[], cb) { + const firstId = task[0].taskId; cb(null, { some: 'prop' }); } }); @@ -80,6 +85,15 @@ new Queue(() => { }, { } }); +const q = new Queue(() => {}) + +const testTask = {taskId: '', taskPayload: ''} + +q.push(testTask) +q.push(testTask, (error, result) => {}) + +q.cancel('id', () => {}) + class TestStore implements Queue.Store { connect(cb: (error: any, length: number) => void) { cb(null, 1); diff --git a/types/better-queue/index.d.ts b/types/better-queue/index.d.ts index 8ee80281fb..4fa342e958 100644 --- a/types/better-queue/index.d.ts +++ b/types/better-queue/index.d.ts @@ -15,9 +15,9 @@ declare class BetterQueue extends NodeJS.EventEmitter { constructor(options: BetterQueue.QueueOptions); constructor(process: BetterQueue.ProcessFunction, options?: Partial>); - push(task: T, cb?: (err: any, result?: K) => void): BetterQueue.Ticket; + push(task: T, cb?: (err: any, result: K) => void): BetterQueue.Ticket; - cancel(taskId: any, cb: () => void): void; + cancel(taskId: any, cb?: () => void): void; pause(): void; diff --git a/types/better-queue/tsconfig.json b/types/better-queue/tsconfig.json index 78d86d651d..4677f6a711 100644 --- a/types/better-queue/tsconfig.json +++ b/types/better-queue/tsconfig.json @@ -7,14 +7,14 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": false + "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", From 3fd8c38c77b77df391b7219290d129d4ca552270 Mon Sep 17 00:00:00 2001 From: ostap Date: Mon, 16 Jul 2018 09:19:33 +0300 Subject: [PATCH 010/346] strictFunctionTypes fix --- types/better-queue/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/better-queue/index.d.ts b/types/better-queue/index.d.ts index 4fa342e958..69861c5132 100644 --- a/types/better-queue/index.d.ts +++ b/types/better-queue/index.d.ts @@ -63,7 +63,8 @@ declare namespace BetterQueue { store?: string | StoreOptions | Store; } - type ProcessFunction = (task: T | T[], cb: ProcessFunctionCb) => void; + // TODO reflect task types somehow (task: T | T[]) + type ProcessFunction = (task: any, cb: ProcessFunctionCb) => void; type ProcessFunctionCb = (error?: any, result?: K) => void; From 334ab585d54fc4c9126ed3766ad8bd65035bb5b5 Mon Sep 17 00:00:00 2001 From: ostap Date: Mon, 16 Jul 2018 09:28:53 +0300 Subject: [PATCH 011/346] lint fix --- types/better-queue/better-queue-tests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/better-queue/better-queue-tests.ts b/types/better-queue/better-queue-tests.ts index 3df520f11c..4a1aa4771e 100644 --- a/types/better-queue/better-queue-tests.ts +++ b/types/better-queue/better-queue-tests.ts @@ -85,14 +85,14 @@ new Queue(() => { }, { } }); -const q = new Queue(() => {}) +const q = new Queue(() => {}); -const testTask = {taskId: '', taskPayload: ''} +const testTask = {taskId: '', taskPayload: ''}; -q.push(testTask) -q.push(testTask, (error, result) => {}) +q.push(testTask); +q.push(testTask, (error, result) => {}); -q.cancel('id', () => {}) +q.cancel('id', () => {}); class TestStore implements Queue.Store { connect(cb: (error: any, length: number) => void) { From 11ef4f5d38ee557563198dc2397473f9b27a16c8 Mon Sep 17 00:00:00 2001 From: YangusKhan <9inchsamurai@gmail.com> Date: Mon, 16 Jul 2018 15:05:49 -0600 Subject: [PATCH 012/346] remove the module declaration from the base slate package to simplify importing --- types/slate-base64-serializer/index.d.ts | 10 +- .../slate-base64-serializer-tests.ts | 4 +- types/slate-html-serializer/index.d.ts | 22 +- types/slate-plain-serializer/index.d.ts | 10 +- .../slate-plain-serializer-tests.ts | 4 +- types/slate-react/index.d.ts | 72 +- types/slate-react/slate-react-tests.tsx | 8 +- types/slate/index.d.ts | 1413 +++++++++-------- types/slate/slate-tests.ts | 4 +- 9 files changed, 774 insertions(+), 773 deletions(-) diff --git a/types/slate-base64-serializer/index.d.ts b/types/slate-base64-serializer/index.d.ts index 86f626fc86..6d356aa1c3 100644 --- a/types/slate-base64-serializer/index.d.ts +++ b/types/slate-base64-serializer/index.d.ts @@ -3,9 +3,9 @@ // Definitions by: Brandon Shelton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { Slate } from "slate"; +import { Value, Node } from "slate"; -export function deserialize(string: string, options?: object): Slate.Value; -export function deserializeNode(string: string, options?: object): Slate.Node; -export function serialize(value: Slate.Value, options?: object): string; -export function serializeNode(node: Slate.Node, options?: object): string; +export function deserialize(string: string, options?: object): Value; +export function deserializeNode(string: string, options?: object): Node; +export function serialize(value: Value, options?: object): string; +export function serializeNode(node: Node, options?: object): string; diff --git a/types/slate-base64-serializer/slate-base64-serializer-tests.ts b/types/slate-base64-serializer/slate-base64-serializer-tests.ts index 3d1b2888b6..680bcf62bd 100644 --- a/types/slate-base64-serializer/slate-base64-serializer-tests.ts +++ b/types/slate-base64-serializer/slate-base64-serializer-tests.ts @@ -1,6 +1,6 @@ import * as Base64 from "slate-base64-serializer"; -import { Slate } from "slate"; +import { Value } from "slate"; -const val = Slate.Value.create(); +const val = Value.create(); const serialized = Base64.serialize(val); const deserialized = Base64.deserialize(serialized); diff --git a/types/slate-html-serializer/index.d.ts b/types/slate-html-serializer/index.d.ts index eb9290955a..cee3041d69 100644 --- a/types/slate-html-serializer/index.d.ts +++ b/types/slate-html-serializer/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 import * as React from 'react'; -import { Slate } from 'slate'; +import { BlockProperties, ValueJSON, Value, Node, Mark, Leaf } from 'slate'; export interface Rule { deserialize?: (el: Element, next: (elements: Element[] | NodeList | Array) => any) => any; @@ -13,28 +13,28 @@ export interface Rule { export interface HtmlOptions { rules?: Rule[]; - defaultBlock?: Slate.BlockProperties; + defaultBlock?: BlockProperties; parseHtml?: (html: string) => HTMLElement; } export default class Html { constructor(options?: HtmlOptions); - deserialize(html: string, options: { toJSON: true }): Slate.ValueJSON; - deserialize(html: string, options?: { toJSON?: false }): Slate.Value; + deserialize(html: string, options: { toJSON: true }): ValueJSON; + deserialize(html: string, options?: { toJSON?: false }): Value; - serialize(value: Slate.Value, options?: { render?: true }): string; - serialize(value: Slate.Value, options: { render: false }): Element[]; + serialize(value: Value, options?: { render?: true }): string; + serialize(value: Value, options: { render: false }): Element[]; protected rules: Rule[]; - protected defaultBlock: Slate.BlockProperties; + protected defaultBlock: BlockProperties; protected parseHtml: (html: string) => HTMLElement; - protected deserializeElements: (elements: HTMLElement[]) => Slate.Node[]; + protected deserializeElements: (elements: HTMLElement[]) => Node[]; protected deserializeElement: (element: HTMLElement) => any; - protected deserializeMark: (mark: Slate.Mark) => Slate.Node[]; + protected deserializeMark: (mark: Mark) => Node[]; - protected serializeNode: (node: Slate.Node) => string; - protected serializeLeaf: (leaf: Slate.Leaf) => string; + protected serializeNode: (node: Node) => string; + protected serializeLeaf: (leaf: Leaf) => string; protected serializeString: (string: string) => string; } diff --git a/types/slate-plain-serializer/index.d.ts b/types/slate-plain-serializer/index.d.ts index 778f523168..b781b4f9e7 100644 --- a/types/slate-plain-serializer/index.d.ts +++ b/types/slate-plain-serializer/index.d.ts @@ -3,13 +3,13 @@ // Definitions by: Brandon Shelton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { Slate } from 'slate'; +import { BlockProperties, MarkProperties, Value } from 'slate'; export interface DeserializeOptions { toJson?: boolean; - defaultBlock?: Slate.BlockProperties; - defaultMarks?: Slate.MarkProperties[] | Set; + defaultBlock?: BlockProperties; + defaultMarks?: MarkProperties[] | Set; } -export function deserialize(string: string, options?: DeserializeOptions): Slate.Value; -export function serialize(value: Slate.Value): string; +export function deserialize(string: string, options?: DeserializeOptions): Value; +export function serialize(value: Value): string; diff --git a/types/slate-plain-serializer/slate-plain-serializer-tests.ts b/types/slate-plain-serializer/slate-plain-serializer-tests.ts index 7d7db6ff84..c7b7f97e07 100644 --- a/types/slate-plain-serializer/slate-plain-serializer-tests.ts +++ b/types/slate-plain-serializer/slate-plain-serializer-tests.ts @@ -1,6 +1,6 @@ import * as Plain from "slate-plain-serializer"; -import { Slate } from "slate"; +import { Value } from "slate"; -const val = Slate.Value.create(); +const val = Value.create(); const serialized = Plain.serialize(val); const deserialized = Plain.deserialize(serialized); diff --git a/types/slate-react/index.d.ts b/types/slate-react/index.d.ts index 492156363a..3ef179a14b 100644 --- a/types/slate-react/index.d.ts +++ b/types/slate-react/index.d.ts @@ -7,7 +7,7 @@ // Brandon Shelton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { Slate } from 'slate'; +import { Mark, Node, Block, Change, Schema, Value, Stack } from 'slate'; import * as Immutable from 'immutable'; import * as React from 'react'; @@ -20,9 +20,9 @@ export interface RenderMarkProps { attributes: RenderAttributes; children: React.ReactNode; editor: Editor; - mark: Slate.Mark; - marks: Immutable.Set; - node: Slate.Node; + mark: Mark; + marks: Immutable.Set; + node: Node; offset: number; text: string; } @@ -33,26 +33,26 @@ export interface RenderNodeProps { editor: Editor; isSelected: boolean; key: string; - node: Slate.Block; - parent: Slate.Node; + node: Block; + parent: Node; } export interface Plugin { - onBeforeInput?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onBlur?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onFocus?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onClick?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onCopy?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onCut?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onDrop?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onKeyDown?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onKeyUp?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onPaste?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onSelect?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; - onChange?: (change: Slate.Change) => any; + onBeforeInput?: (event: Event, change: Change, editor: Editor) => Change | void; + onBlur?: (event: Event, change: Change, editor: Editor) => Change | void; + onFocus?: (event: Event, change: Change, editor: Editor) => Change | void; + onClick?: (event: Event, change: Change, editor: Editor) => Change | void; + onCopy?: (event: Event, change: Change, editor: Editor) => Change | void; + onCut?: (event: Event, change: Change, editor: Editor) => Change | void; + onDrop?: (event: Event, change: Change, editor: Editor) => Change | void; + onKeyDown?: (event: Event, change: Change, editor: Editor) => Change | void; + onKeyUp?: (event: Event, change: Change, editor: Editor) => Change | void; + onPaste?: (event: Event, change: Change, editor: Editor) => Change | void; + onSelect?: (event: Event, change: Change, editor: Editor) => Change | void; + onChange?: (change: Change) => any; renderEditor?: (props: RenderAttributes, editor: Editor) => object | void; - schema?: Slate.Schema; - decorateNode?: (node: Slate.Node) => Slate.Range[] | void; + schema?: Schema; + decorateNode?: (node: Node) => Range[] | void; renderMark?: (props: RenderMarkProps) => any; renderNode?: (props: RenderNodeProps) => any; renderPlaceholder?: (props: RenderAttributes) => any; @@ -61,16 +61,16 @@ export interface Plugin { } export interface BasicEditorProps { - value: Slate.Value; + value: Value; autoCorrect?: boolean; autoFocus?: boolean; className?: string; - onChange?: (change: Slate.Change) => any; + onChange?: (change: Change) => any; placeholder?: any; plugins?: Plugin[]; readOnly?: boolean; role?: string; - schema?: Slate.Schema; + schema?: Schema; spellCheck?: boolean; style?: { [key: string]: string }; tabIndex?: number; @@ -80,29 +80,29 @@ export interface BasicEditorProps { export type EditorProps = BasicEditorProps & Plugin; export interface EditorState { - schema: Slate.Schema; - value: Slate.Value; - stack: Slate.Stack; // [TODO] define stack + schema: Schema; + value: Value; + stack: Stack; // [TODO] define stack } export class Editor extends React.Component { - schema: Slate.Schema; - value: Slate.Value; - stack: Slate.Stack; + schema: Schema; + value: Value; + stack: Stack; // Instance Methods blur(): void; - change(fn: (change: Slate.Change) => any): void; + change(fn: (change: Change) => any): void; change(...args: any[]): void; focus(): void; } export type SlateType = 'fragment' | 'html' | 'node' | 'rich' | 'text' | 'files'; -export function findDOMNode(node: Slate.Node): Element; -export function findDOMRange(range: Slate.Range): Range; -export function findNode(element: Element, value: Slate.Value): Slate.Node; -export function findRange(selection: Selection, value: Slate.Value): Slate.Range; -export function getEventRange(event: Event, value: Slate.Value): Slate.Range; -export function getEventTransfer(event: Event): { type: SlateType; node: Slate.Node }; +export function findDOMNode(node: Node): Element; +export function findDOMRange(range: Range): Range; +export function findNode(element: Element, value: Value): Node; +export function findRange(selection: Selection, value: Value): Range; +export function getEventRange(event: Event, value: Value): Range; +export function getEventTransfer(event: Event): { type: SlateType; node: Node }; export function setEventTransfer(event: Event, type: SlateType, data: any): void; diff --git a/types/slate-react/slate-react-tests.tsx b/types/slate-react/slate-react-tests.tsx index f576ea580c..074f6caa9b 100644 --- a/types/slate-react/slate-react-tests.tsx +++ b/types/slate-react/slate-react-tests.tsx @@ -1,9 +1,9 @@ import { Editor, Plugin, EditorProps } from "slate-react"; -import { Slate } from "slate"; +import { Change, Value } from "slate"; import * as React from "react"; class MyPlugin implements Plugin { - onChange(change: Slate.Change): void { + onChange(change: Change): void { change.blur(); } } @@ -11,14 +11,14 @@ class MyPlugin implements Plugin { const myPlugin = new MyPlugin(); interface MyEditorState { - value: Slate.Value; + value: Value; } class MyEditor extends React.Component { constructor(props: EditorProps) { super(props); this.state = { - value: Slate.Value.create() + value: Value.create() }; } diff --git a/types/slate/index.d.ts b/types/slate/index.d.ts index b73746414d..91fc084056 100644 --- a/types/slate/index.d.ts +++ b/types/slate/index.d.ts @@ -8,714 +8,715 @@ // TypeScript Version: 2.3 import * as Immutable from 'immutable'; -export namespace Slate { - interface Data { - [key: string]: any; - } +export interface Data { + [key: string]: any; +} - interface RulesByNodeType { - [key: string]: Rules; - } +export interface RulesByNodeType { + [key: string]: Rules; +} - interface KindsAndTypes { +export interface KindsAndTypes { + kinds?: string[]; + types?: string[]; +} + +export type InvalidReason = + | 'child_kind_invalid' + | 'child_required' + | 'child_type_invalid' + | 'child_unknown' + | 'first_child_kind_invalid' + | 'first_child_type_invalid' + | 'last_child_kind_invalid' + | 'last_child_type_invalid' + | 'node_data_invalid' + | 'node_is_void_invalid' + | 'node_mark_invalid' + | 'node_text_invalid' + | 'parent_kind_invalid' + | 'parent_type_invalid'; + +export interface Rules { + data?: { + [key: string]: (v: any) => boolean; + }; + first?: KindsAndTypes; + isVoid?: boolean; + last?: KindsAndTypes; + nodes?: Array<{ kinds?: string[]; types?: string[]; - } - - type InvalidReason = - | 'child_kind_invalid' - | 'child_required' - | 'child_type_invalid' - | 'child_unknown' - | 'first_child_kind_invalid' - | 'first_child_type_invalid' - | 'last_child_kind_invalid' - | 'last_child_type_invalid' - | 'node_data_invalid' - | 'node_is_void_invalid' - | 'node_mark_invalid' - | 'node_text_invalid' - | 'parent_kind_invalid' - | 'parent_type_invalid'; - - interface Rules { - data?: { - [key: string]: (v: any) => boolean; - }; - first?: KindsAndTypes; - isVoid?: boolean; - last?: KindsAndTypes; - nodes?: Array<{ - kinds?: string[]; - types?: string[]; - min?: number; - max?: number; - }>; - normalize?: ( - change: Change, - reason: InvalidReason, - context: { [key: string]: any } - ) => void; - parent?: KindsAndTypes; - text?: RegExp; - } - - interface SchemaProperties { - document?: Rules; - blocks?: RulesByNodeType; - inlines?: RulesByNodeType; - } - - class Schema extends Immutable.Record({}) { - document: Rules; - blocks: RulesByNodeType; - inlines: RulesByNodeType; - - static create(properties: SchemaProperties | Schema): Schema; - static fromJSON(object: SchemaProperties): Schema; - static isSchema(maybeSchema: any): maybeSchema is Schema; - - toJSON(): SchemaProperties; - } - - interface ValueProperties { - document?: Document; - selection?: Range; - history?: History; - schema?: Schema; - data?: Data; - decorations?: Immutable.List | null; - } - - interface ValueJSON { - document?: DocumentJSON; - selection?: Range; - history?: History; - schema?: Schema; - data?: Data; - decorations?: Immutable.List | null; - object?: 'value'; - } - - class Value extends Immutable.Record({}) { - document: Document; - selection: Range; - history: History; - schema: Schema; - data: Data; - object: 'value'; - decorations: Immutable.List | null; - - readonly anchorText: Text; - readonly focusText: Text; - readonly startText: Text; - readonly endText: Text; - - readonly anchorBlock: Block; - readonly focusBlock: Block; - readonly startBlock: Block; - readonly endBlock: Block; - - readonly marks: Immutable.Set; - readonly activeMarks: Immutable.Set; - readonly blocks: Immutable.List; - readonly fragment: Document; - readonly inlines: Immutable.List; - readonly text: Immutable.List; - readonly characters: Immutable.List; - readonly hasUndos: boolean; - readonly hasRedos: boolean; - - readonly anchorKey: string; - readonly focusKey: string; - readonly startKey: string; - readonly endKey: string; - readonly anchorOffset: number; - readonly focusOffset: number; - readonly startOffset: number; - readonly endOffset: number; - readonly isBackward: boolean; - readonly isBlurred: boolean; - readonly isCollapsed: boolean; - readonly isExpanded: boolean; - readonly isFocused: boolean; - readonly isForward: boolean; - - static create(properties?: ValueProperties | Value): Value; - static fromJSON(properties: ValueJSON): Value; - static isValue(maybeValue: any): maybeValue is Value; - - change(): Change; - toJSON(): ValueJSON; - } - - interface DocumentProperties { - nodes?: Immutable.List | Node[]; - key?: string; - data?: Immutable.Map | { [key: string]: any }; - } - - interface DocumentJSON { - nodes?: NodeJSON[]; - key?: string; - data?: { [key: string]: any }; - object?: 'document'; - } - - class Document extends BaseNode< - DataMap - > { - object: 'document'; - nodes: Immutable.List; - - static create( - properties: DocumentProperties | Document | Immutable.List | Node[] - ): Document; - static fromJSON(properties: DocumentProperties | Document): Document; - static isDocument(maybeDocument: any): maybeDocument is Document; - - toJSON(): DocumentJSON; - } - - interface BlockProperties { - type: string; - key?: string; - nodes?: Immutable.List; - isVoid?: boolean; - data?: Immutable.Map | { [key: string]: any }; - } - - interface BlockJSON { - type: string; - key?: string; - nodes?: NodeJSON[]; - isVoid?: boolean; - data?: { [key: string]: any }; - object: 'block'; - } - - class Block extends BaseNode { - isVoid: boolean; - object: 'block'; - nodes: Immutable.List; - - static create(properties: BlockProperties | Block | string): Block; - static createList( - array: (BlockProperties[] | Block[] | string[]) - ): Immutable.List; - static fromJSON(properties: BlockProperties | Block): Block; - static isBlock(maybeBlock: any): maybeBlock is Block; - - toJSON(): BlockJSON; - } - - interface InlineProperties { - type: string; - key?: string; - nodes?: Immutable.List; - isVoid?: boolean; - data?: Immutable.Map | { [key: string]: any }; - } - - interface InlineJSON { - type: string; - key?: string; - nodes?: NodeJSON[]; - isVoid?: boolean; - data?: { [key: string]: any }; - object: 'inline'; - } - - class Inline extends BaseNode { - isVoid: boolean; - object: 'inline'; - nodes: Immutable.List; - - static create(properties: InlineProperties | Inline | string): Inline; - static createList( - array: (InlineProperties[] | Inline[] | string[]) - ): Immutable.List; - static fromJSON(properties: InlineProperties | Inline): Inline; - static isInline(maybeInline: any): maybeInline is Inline; - - toJSON(): InlineJSON; - } - - interface Leaf { - marks?: Mark[]; - text: string; - } - - interface TextProperties { - key?: string; - characters: Immutable.List; - } - - interface TextJSON { - key?: string; - characters?: Character[]; - leaves: Leaf[]; - object: 'text'; - } - - class Text extends Immutable.Record({}) { - object: 'text'; - characters: Immutable.List; - key: string; - text: string; - - static create(properties: TextProperties | Text | string): Text; - static fromJSON(properties: TextProperties | Text): Text; - static isText(maybeText: any): maybeText is Text; - - toJSON(): TextJSON; - } - - type Node = Document | Block | Inline | Text; - type NodeJSON = DocumentJSON | BlockJSON | InlineJSON | TextJSON; - - class BaseNode extends Immutable.Record( - {} - ) { - data: Immutable.Map; - type: string; - key: string; - object: 'document' | 'block' | 'inline' | 'text'; - nodes: Immutable.List; - readonly text: string; - - filterDescendants(iterator: (node: Node) => boolean): Immutable.List; - findDescendants(iterator: (node: Node) => boolean): Node | null; - getBlocksAtRange(range: Range): Immutable.List; - getBlocks(): Immutable.List; - getCharactersAtRange(range: Range): Immutable.List; - getChild(key: string | Node): Node | null; - getClosestBlock(key: string | Node): Block | null; - getClosestInline(key: string | Node): Inline | null; - getClosest(key: string | Node, match: (node: Node) => boolean): Node | null; - getDepth(key: string | Node): number; - getDescendant(key: string | Node): Node | null; - getFirstText(): Text | null; - getFragmentAtRange(range: Range): Document; - getFurthest(key: string, iterator: (node: Node) => boolean): Node | null; - getFurthestAncestor(key: string): Node | null; - getFurthestBlock(key: string): Block | null; - getFurthestInline(key: string): Inline | null; - getFurthestOnlyChildAncestor(key: string): Node | null; - getInlinesAtRange(range: Range): Immutable.List; - getLastText(): Text | null; - getMarksAtRange(range: Range): Immutable.Set; - getNextBlock(key: string | Node): Block | null; - getNextSibling(key: string | Node): Node | null; - getNextText(key: string | Node): Text | null; - getParent(key: string | Node): Node | null; - getPreviousBlock(key: string | Node): Block | null; - getPreviousSibling(key: string | Node): Node | null; - getPreviousText(key: string | Node): Text | null; - getTexts(): Immutable.List; - getTextsAsArray(): Text[]; - getTextAtOffset(offset: number): Text | null; - getTextsAtRange(range: Range): Immutable.List; - getTextsAtRangeAsArray(range: Range): Text[]; - hasChild(key: string | Node): boolean; - } - - interface CharacterProperties { - marks?: Immutable.Set | Mark[]; - text: string; - } - - class Character extends Immutable.Record({}) { - object: 'character'; - marks: Immutable.Set; - text: string; - - static create( - properties: CharacterProperties | Character | string - ): Character; - static createList( - array: (CharacterProperties[] | Character[] | string[]) - ): Immutable.List; - static fromJSON(properties: CharacterProperties | Character): Character; - static isCharacter(maybeCharacter: any): maybeCharacter is Character; - - toJSON(): CharacterProperties; - } - - interface MarkProperties { - type: string; - data?: Immutable.Map | { [key: string]: any }; - } - - interface MarkJSON { - type: string; - data?: { [key: string]: any }; - } - - class Mark extends Immutable.Record({}) { - object: 'mark'; - type: string; - data: Immutable.Map; - - static create(properties: MarkProperties | Mark | string): Mark; - static createSet( - array: (MarkProperties[] | Mark[] | string[]) - ): Immutable.Set; - static fromJSON(properties: MarkJSON | Mark): Mark; - static isMark(maybeMark: any): maybeMark is Mark; - - toJSON(): MarkProperties; - } - - class Change extends Immutable.Record({}) { - object: 'change'; - value: Value; - operations: Immutable.List; - - call(customChange: (change: Change, ...args: any[]) => Change): Change; - - applyOperations(operations: Operation[]): Change; - applyOperation(operation: Operation): Change; - - // Full Value Change - setValue(properties: Value | ValueProperties): Change; - - // Current Value Changes - deleteBackward(n: number): Change; - deleteForward(n: number): Change; - delete(): Change; - insertBlock(block: Block | BlockProperties | string): Change; - insertFragment(fragment: Document): Change; - insertInline(inline: Inline | InlineProperties): Change; - insertText(text: string): Change; - addMark(mark: Mark | MarkProperties | string): Change; - setBlocks(properties: BlockProperties | string): Change; - setInlines(properties: InlineProperties | string): Change; - splitBlock(depth: number): Change; - splitInline(depth: number): Change; - removeMark(mark: Mark | MarkProperties | string): Change; - toggleMark(mark: Mark | MarkProperties | string): Change; - unwrapBlock(properties: BlockProperties | string): Change; - unwrapInline(properties: InlineProperties | string): Change; - wrapBlock(properties: BlockProperties | string): Change; - wrapInline(properties: InlineProperties | string): Change; - wrapText(prefix: string, suffix?: string): Change; - - // Selection Changes - blur(): Change; - collapseToAnchor(): Change; - collapseToFocus(): Change; - collapseToStart(): Change; - collapseToEnd(): Change; - collapseToStartOf(node: Node): Change; - collapseToEndOf(node: Node): Change; - collapseToStartOfNextBlock(): Change; - collapseToEndOfNextBlock(): Change; - collapseToStartOfPreviousBlock(): Change; - collapseToEndOfPreviousBlock(): Change; - collapseToStartOfNextText(): Change; - collapseToEndOfNextText(): Change; - collapseToStartOfPreviousText(): Change; - collapseToEndOfPreviousText(): Change; - extend(n: number): Change; - extendToStartOf(node: Node): Change; - extendToEndOf(node: Node): Change; - flip(): Change; - focus(): Change; - move(n: number): Change; - moveStart(n: number): Change; - moveEnd(n: number): Change; - moveOffsetsTo(anchorOffset: number, focusOffset: number): Change; - moveToRangeOf(node: Node): Change; - select(properties: Range | RangeProperties): Change; - selectAll(): Change; - deselect(): Change; - - // Document Changes - deleteBackwardAtRange(range: Range, n: number): Change; - deleteForwardAtRange(range: Range, n: number): Change; - deleteAtRange(range: Range): Change; - insertBlockAtRange( - range: Range, - block: Block | BlockProperties | string - ): Change; - insertFragmentAtRange(range: Range, fragment: Document): Change; - insertInlineAtRange( - range: Range, - inline: Inline | InlineProperties - ): Change; - insertTextAtRange(range: Range, text: string): Change; - addMarkAtRange(range: Range, mark: Mark | MarkProperties | string): Change; - setBlocksAtRange(range: Range, properties: BlockProperties | string): Change; - setInlinesAtRange( - range: Range, - properties: InlineProperties | string - ): Change; - splitBlockAtRange(range: Range, depth: number): Change; - splitInlineAtRange(range: Range, depth: number): Change; - removeMarkAtRange( - range: Range, - mark: Mark | MarkProperties | string - ): Change; - toggleMarkAtRange( - range: Range, - mark: Mark | MarkProperties | string - ): Change; - unwrapBlockAtRange( - range: Range, - properties: BlockProperties | string - ): Change; - unwrapInlineAtRange( - range: Range, - properties: InlineProperties | string - ): Change; - wrapBlockAtRange( - range: Range, - properties: BlockProperties | string - ): Change; - wrapInlineAtRange( - range: Range, - properties: InlineProperties | string - ): Change; - wrapTextAtRange(range: Range, prefix: string, suffix?: string): Change; - - // Node Changes - addMarkByKey( - key: string, - offset: number, - length: number, - mark: Mark - ): Change; - insertNodeByKey(key: string, index: number, node: Node): Change; - insertFragmentByKey(key: string, index: number, fragment: Document): Change; - insertTextByKey( - key: string, - offset: number, - text: string, - marks?: Immutable.Set | Mark[] - ): Change; - moveNodeByKey(key: string, newKey: string, newIndex: number): Change; - removeMarkByKey( - key: string, - offset: number, - length: number, - mark: Mark - ): Change; - removeNodeByKey(key: string): Change; - replaceNodeByKey(key: string, node: Node): Change; - removeTextByKey(key: string, offset: number, length: number): Change; - setMarkByKey( - key: string, - offset: number, - length: number, - mark: Mark, - properties: MarkProperties - ): Change; - setNodeByKey( - key: string, - properties: BlockProperties | InlineProperties | string - ): Change; - splitNodeByKey(key: string, offset: number): Change; - unwrapInlineByKey( - key: string, - properties: InlineProperties | string - ): Change; - unwrapBlockByKey(key: string, properties: BlockProperties | string): Change; - unwrapNodeByKey(key: string): Change; - wrapInlineByKey(key: string, properties: InlineProperties | string): Change; - wrapBlockByKey(key: string, properties: BlockProperties | string): Change; - - // History Changes - redo(): Change; - undo(): Change; - } - - interface RangeProperties { - anchorKey?: string | null; - anchorOffset?: number; - focusKey?: string | null; - focusOffset?: number; - isFocused?: boolean; - isBackward?: boolean | null; - marks?: Immutable.Set | null; - } - - interface RangeJSON { - anchorKey?: string | null; - anchorOffset?: number; - focusKey?: string | null; - focusOffset?: number; - isFocused?: boolean; - isBackward?: boolean | null; - marks?: MarkJSON[] | null; - } - - class Range extends Immutable.Record({}) { - object: 'range'; - anchorKey: string | null; - anchorOffset: number; - focusKey: string | null; - focusOffset: number; - isFocused: boolean; - isBackward: boolean | null; - marks: Immutable.Set | null; - - readonly isBlurred: boolean; - readonly isCollapsed: boolean; - readonly isExpanded: boolean; - readonly isForward: boolean; - readonly startKey: string; - readonly startOffset: number; - readonly endKey: string; - readonly endOffset: number; - - static create(properties: RangeProperties | Range): Range; - static fromJSON(properties: RangeJSON): Range; - static isRange(maybeRange: any): maybeRange is Range; - - toJSON(): RangeProperties; - - hasAnchorAtStartOf(node: Node): boolean; - hasFocusAtStartOf(node: Node): boolean; - hasStartAtStartOf(node: Node): boolean; - hasEndAtStartOf(node: Node): boolean; - hasEdgeAtStartOf(node: Node): boolean; - - hasAnchorAtEndOf(node: Node): boolean; - hasFocusAtEndOf(node: Node): boolean; - hasStartAtEndOf(node: Node): boolean; - hasEndAtEndOf(node: Node): boolean; - hasEdgeAtEndOf(node: Node): boolean; - - hasAnchorBetween(node: Node, start: number, end: number): boolean; - hasFocusBetween(node: Node, start: number, end: number): boolean; - hasStartBetween(node: Node, start: number, end: number): boolean; - hasEndBetween(node: Node, start: number, end: number): boolean; - hasEdgeBetween(node: Node, start: number, end: number): boolean; - - hasAnchorIn(node: Node): boolean; - hasFocusIn(node: Node): boolean; - hasStartIn(node: Node): boolean; - hasEndIn(node: Node): boolean; - hasEdgeIn(node: Node): boolean; - - isAtStartOf(node: Node): boolean; - isAtEndOf(node: Node): boolean; - } - - type Operation = - | InsertTextOperation - | RemoveTextOperation - | AddMarkOperation - | RemoveMarkOperation - | SetMarkOperation - | InsertNodeOperation - | MergeNodeOperation - | MoveNodeOperation - | RemoveNodeOperation - | SetNodeOperation - | SplitNodeOperation - | SetSelectionOperation - | SetValueOperation; - - interface InsertTextOperation { - type: 'insert_text'; - path: number[]; - offset: number; - text: string; - marks: Mark[]; - } - - interface RemoveTextOperation { - type: 'remove_text'; - path: number[]; - offset: number; - text: string; - } - - interface AddMarkOperation { - type: 'add_mark'; - path: number[]; - offset: number; - length: number; - mark: Mark; - } - - interface RemoveMarkOperation { - type: 'remove_mark'; - path: number[]; - offset: number; - length: number; - mark: Mark; - } - - interface SetMarkOperation { - type: 'set_mark'; - path: number[]; - offset: number; - length: number; - mark: Mark; - properties: MarkProperties; - } - - interface InsertNodeOperation { - type: 'insert_node'; - path: number[]; - node: Node; - } - - interface MergeNodeOperation { - type: 'merge_node'; - path: number[]; - position: number; - } - - interface MoveNodeOperation { - type: 'move_node'; - path: number[]; - newPath: number[]; - } - - interface RemoveNodeOperation { - type: 'remove_node'; - path: number[]; - node: Node; - } - - interface SetNodeOperation { - type: 'set_node'; - path: number[]; - properties: BlockProperties | InlineProperties | TextProperties; - } - - interface SplitNodeOperation { - type: 'split_node'; - path: number[]; - position: number; - target: number; - } - - interface SetSelectionOperation { - type: 'set_selection'; - properties: RangeProperties; - selection: Range; - } - - interface SetValueOperation { - type: 'set_value'; - properties: ValueProperties; - value: Value; - } - - const Operations: { - apply: (value: Value, operation: Operation) => Value; - invert: (operation: Operation) => Operation; - }; - - class Stack extends Immutable.Record({}) { - plugins: any[]; - } - - function setKeyGenerator(func: () => string): null; - function resetKeyGenerator(): null; + min?: number; + max?: number; + }>; + normalize?: ( + change: Change, + reason: InvalidReason, + context: { [key: string]: any } + ) => void; + parent?: KindsAndTypes; + text?: RegExp; } + +export interface SchemaProperties { + document?: Rules; + blocks?: RulesByNodeType; + inlines?: RulesByNodeType; +} + +export class Schema extends Immutable.Record({}) { + document: Rules; + blocks: RulesByNodeType; + inlines: RulesByNodeType; + + static create(properties: SchemaProperties | Schema): Schema; + static fromJSON(object: SchemaProperties): Schema; + static isSchema(maybeSchema: any): maybeSchema is Schema; + + toJSON(): SchemaProperties; +} + +export interface ValueProperties { + document?: Document; + selection?: Range; + history?: History; + schema?: Schema; + data?: Data; + decorations?: Immutable.List | null; +} + +export interface ValueJSON { + document?: DocumentJSON; + selection?: Range; + history?: History; + schema?: Schema; + data?: Data; + decorations?: Immutable.List | null; + object?: 'value'; +} + +export class Value extends Immutable.Record({}) { + document: Document; + selection: Range; + history: History; + schema: Schema; + data: Data; + object: 'value'; + decorations: Immutable.List | null; + + readonly anchorText: Text; + readonly focusText: Text; + readonly startText: Text; + readonly endText: Text; + + readonly anchorBlock: Block; + readonly focusBlock: Block; + readonly startBlock: Block; + readonly endBlock: Block; + + readonly marks: Immutable.Set; + readonly activeMarks: Immutable.Set; + readonly blocks: Immutable.List; + readonly fragment: Document; + readonly inlines: Immutable.List; + readonly text: Immutable.List; + readonly characters: Immutable.List; + readonly hasUndos: boolean; + readonly hasRedos: boolean; + + readonly anchorKey: string; + readonly focusKey: string; + readonly startKey: string; + readonly endKey: string; + readonly anchorOffset: number; + readonly focusOffset: number; + readonly startOffset: number; + readonly endOffset: number; + readonly isBackward: boolean; + readonly isBlurred: boolean; + readonly isCollapsed: boolean; + readonly isExpanded: boolean; + readonly isFocused: boolean; + readonly isForward: boolean; + + static create(properties?: ValueProperties | Value): Value; + static fromJSON(properties: ValueJSON): Value; + static isValue(maybeValue: any): maybeValue is Value; + + change(): Change; + toJSON(): ValueJSON; +} + +export interface DocumentProperties { + nodes?: Immutable.List | Node[]; + key?: string; + data?: Immutable.Map | { [key: string]: any }; +} + +export interface DocumentJSON { + nodes?: NodeJSON[]; + key?: string; + data?: { [key: string]: any }; + object?: 'document'; +} + +export class Document extends BaseNode< + DataMap +> { + object: 'document'; + nodes: Immutable.List; + + static create( + properties: DocumentProperties | Document | Immutable.List | Node[] + ): Document; + static fromJSON(properties: DocumentProperties | Document): Document; + static isDocument(maybeDocument: any): maybeDocument is Document; + + toJSON(): DocumentJSON; +} + +export interface BlockProperties { + type: string; + key?: string; + nodes?: Immutable.List; + isVoid?: boolean; + data?: Immutable.Map | { [key: string]: any }; +} + +export interface BlockJSON { + type: string; + key?: string; + nodes?: NodeJSON[]; + isVoid?: boolean; + data?: { [key: string]: any }; + object: 'block'; +} + +export class Block extends BaseNode { + isVoid: boolean; + object: 'block'; + nodes: Immutable.List; + + static create(properties: BlockProperties | Block | string): Block; + static createList( + array: (BlockProperties[] | Block[] | string[]) + ): Immutable.List; + static fromJSON(properties: BlockProperties | Block): Block; + static isBlock(maybeBlock: any): maybeBlock is Block; + + toJSON(): BlockJSON; +} + +export interface InlineProperties { + type: string; + key?: string; + nodes?: Immutable.List; + isVoid?: boolean; + data?: Immutable.Map | { [key: string]: any }; +} + +export interface InlineJSON { + type: string; + key?: string; + nodes?: NodeJSON[]; + isVoid?: boolean; + data?: { [key: string]: any }; + object: 'inline'; +} + +export class Inline extends BaseNode { + isVoid: boolean; + object: 'inline'; + nodes: Immutable.List; + + static create(properties: InlineProperties | Inline | string): Inline; + static createList( + array: (InlineProperties[] | Inline[] | string[]) + ): Immutable.List; + static fromJSON(properties: InlineProperties | Inline): Inline; + static isInline(maybeInline: any): maybeInline is Inline; + + toJSON(): InlineJSON; +} + +export interface Leaf { + marks?: Mark[]; + text: string; +} + +export interface TextProperties { + key?: string; + characters: Immutable.List; +} + +export interface TextJSON { + key?: string; + characters?: Character[]; + leaves: Leaf[]; + object: 'text'; +} + +export class Text extends Immutable.Record({}) { + object: 'text'; + characters: Immutable.List; + key: string; + text: string; + + static create(properties: TextProperties | Text | string): Text; + static fromJSON(properties: TextProperties | Text): Text; + static isText(maybeText: any): maybeText is Text; + + toJSON(): TextJSON; +} + +export type Node = Document | Block | Inline | Text; +export type NodeJSON = DocumentJSON | BlockJSON | InlineJSON | TextJSON; + +// tslint:disable-next-line strict-export-declare-modifiers +declare class BaseNode extends Immutable.Record( + {} +) { + data: Immutable.Map; + type: string; + key: string; + object: 'document' | 'block' | 'inline' | 'text'; + nodes: Immutable.List; + readonly text: string; + + filterDescendants(iterator: (node: Node) => boolean): Immutable.List; + findDescendants(iterator: (node: Node) => boolean): Node | null; + getBlocksAtRange(range: Range): Immutable.List; + getBlocks(): Immutable.List; + getCharactersAtRange(range: Range): Immutable.List; + getChild(key: string | Node): Node | null; + getClosestBlock(key: string | Node): Block | null; + getClosestInline(key: string | Node): Inline | null; + getClosest(key: string | Node, match: (node: Node) => boolean): Node | null; + getDepth(key: string | Node): number; + getDescendant(key: string | Node): Node | null; + getFirstText(): Text | null; + getFragmentAtRange(range: Range): Document; + getFurthest(key: string, iterator: (node: Node) => boolean): Node | null; + getFurthestAncestor(key: string): Node | null; + getFurthestBlock(key: string): Block | null; + getFurthestInline(key: string): Inline | null; + getFurthestOnlyChildAncestor(key: string): Node | null; + getInlinesAtRange(range: Range): Immutable.List; + getLastText(): Text | null; + getMarksAtRange(range: Range): Immutable.Set; + getNextBlock(key: string | Node): Block | null; + getNextSibling(key: string | Node): Node | null; + getNextText(key: string | Node): Text | null; + getParent(key: string | Node): Node | null; + getPreviousBlock(key: string | Node): Block | null; + getPreviousSibling(key: string | Node): Node | null; + getPreviousText(key: string | Node): Text | null; + getTexts(): Immutable.List; + getTextsAsArray(): Text[]; + getTextAtOffset(offset: number): Text | null; + getTextsAtRange(range: Range): Immutable.List; + getTextsAtRangeAsArray(range: Range): Text[]; + hasChild(key: string | Node): boolean; +} + +export interface CharacterProperties { + marks?: Immutable.Set | Mark[]; + text: string; +} + +export class Character extends Immutable.Record({}) { + object: 'character'; + marks: Immutable.Set; + text: string; + + static create( + properties: CharacterProperties | Character | string + ): Character; + static createList( + array: (CharacterProperties[] | Character[] | string[]) + ): Immutable.List; + static fromJSON(properties: CharacterProperties | Character): Character; + static isCharacter(maybeCharacter: any): maybeCharacter is Character; + + toJSON(): CharacterProperties; +} + +export interface MarkProperties { + type: string; + data?: Immutable.Map | { [key: string]: any }; +} + +export interface MarkJSON { + type: string; + data?: { [key: string]: any }; +} + +export class Mark extends Immutable.Record({}) { + object: 'mark'; + type: string; + data: Immutable.Map; + + static create(properties: MarkProperties | Mark | string): Mark; + static createSet( + array: (MarkProperties[] | Mark[] | string[]) + ): Immutable.Set; + static fromJSON(properties: MarkJSON | Mark): Mark; + static isMark(maybeMark: any): maybeMark is Mark; + + toJSON(): MarkProperties; +} + +export class Change extends Immutable.Record({}) { + object: 'change'; + value: Value; + operations: Immutable.List; + + call(customChange: (change: Change, ...args: any[]) => Change): Change; + + applyOperations(operations: Operation[]): Change; + applyOperation(operation: Operation): Change; + + // Full Value Change + setValue(properties: Value | ValueProperties): Change; + + // Current Value Changes + deleteBackward(n: number): Change; + deleteForward(n: number): Change; + delete(): Change; + insertBlock(block: Block | BlockProperties | string): Change; + insertFragment(fragment: Document): Change; + insertInline(inline: Inline | InlineProperties): Change; + insertText(text: string): Change; + addMark(mark: Mark | MarkProperties | string): Change; + setBlocks(properties: BlockProperties | string): Change; + setInlines(properties: InlineProperties | string): Change; + splitBlock(depth: number): Change; + splitInline(depth: number): Change; + removeMark(mark: Mark | MarkProperties | string): Change; + toggleMark(mark: Mark | MarkProperties | string): Change; + unwrapBlock(properties: BlockProperties | string): Change; + unwrapInline(properties: InlineProperties | string): Change; + wrapBlock(properties: BlockProperties | string): Change; + wrapInline(properties: InlineProperties | string): Change; + wrapText(prefix: string, suffix?: string): Change; + + // Selection Changes + blur(): Change; + collapseToAnchor(): Change; + collapseToFocus(): Change; + collapseToStart(): Change; + collapseToEnd(): Change; + collapseToStartOf(node: Node): Change; + collapseToEndOf(node: Node): Change; + collapseToStartOfNextBlock(): Change; + collapseToEndOfNextBlock(): Change; + collapseToStartOfPreviousBlock(): Change; + collapseToEndOfPreviousBlock(): Change; + collapseToStartOfNextText(): Change; + collapseToEndOfNextText(): Change; + collapseToStartOfPreviousText(): Change; + collapseToEndOfPreviousText(): Change; + extend(n: number): Change; + extendToStartOf(node: Node): Change; + extendToEndOf(node: Node): Change; + flip(): Change; + focus(): Change; + move(n: number): Change; + moveStart(n: number): Change; + moveEnd(n: number): Change; + moveOffsetsTo(anchorOffset: number, focusOffset: number): Change; + moveToRangeOf(node: Node): Change; + select(properties: Range | RangeProperties): Change; + selectAll(): Change; + deselect(): Change; + + // Document Changes + deleteBackwardAtRange(range: Range, n: number): Change; + deleteForwardAtRange(range: Range, n: number): Change; + deleteAtRange(range: Range): Change; + insertBlockAtRange( + range: Range, + block: Block | BlockProperties | string + ): Change; + insertFragmentAtRange(range: Range, fragment: Document): Change; + insertInlineAtRange( + range: Range, + inline: Inline | InlineProperties + ): Change; + insertTextAtRange(range: Range, text: string): Change; + addMarkAtRange(range: Range, mark: Mark | MarkProperties | string): Change; + setBlocksAtRange(range: Range, properties: BlockProperties | string): Change; + setInlinesAtRange( + range: Range, + properties: InlineProperties | string + ): Change; + splitBlockAtRange(range: Range, depth: number): Change; + splitInlineAtRange(range: Range, depth: number): Change; + removeMarkAtRange( + range: Range, + mark: Mark | MarkProperties | string + ): Change; + toggleMarkAtRange( + range: Range, + mark: Mark | MarkProperties | string + ): Change; + unwrapBlockAtRange( + range: Range, + properties: BlockProperties | string + ): Change; + unwrapInlineAtRange( + range: Range, + properties: InlineProperties | string + ): Change; + wrapBlockAtRange( + range: Range, + properties: BlockProperties | string + ): Change; + wrapInlineAtRange( + range: Range, + properties: InlineProperties | string + ): Change; + wrapTextAtRange(range: Range, prefix: string, suffix?: string): Change; + + // Node Changes + addMarkByKey( + key: string, + offset: number, + length: number, + mark: Mark + ): Change; + insertNodeByKey(key: string, index: number, node: Node): Change; + insertFragmentByKey(key: string, index: number, fragment: Document): Change; + insertTextByKey( + key: string, + offset: number, + text: string, + marks?: Immutable.Set | Mark[] + ): Change; + moveNodeByKey(key: string, newKey: string, newIndex: number): Change; + removeMarkByKey( + key: string, + offset: number, + length: number, + mark: Mark + ): Change; + removeNodeByKey(key: string): Change; + replaceNodeByKey(key: string, node: Node): Change; + removeTextByKey(key: string, offset: number, length: number): Change; + setMarkByKey( + key: string, + offset: number, + length: number, + mark: Mark, + properties: MarkProperties + ): Change; + setNodeByKey( + key: string, + properties: BlockProperties | InlineProperties | string + ): Change; + splitNodeByKey(key: string, offset: number): Change; + unwrapInlineByKey( + key: string, + properties: InlineProperties | string + ): Change; + unwrapBlockByKey(key: string, properties: BlockProperties | string): Change; + unwrapNodeByKey(key: string): Change; + wrapInlineByKey(key: string, properties: InlineProperties | string): Change; + wrapBlockByKey(key: string, properties: BlockProperties | string): Change; + + // History Changes + redo(): Change; + undo(): Change; +} + +export interface RangeProperties { + anchorKey?: string | null; + anchorOffset?: number; + focusKey?: string | null; + focusOffset?: number; + isFocused?: boolean; + isBackward?: boolean | null; + marks?: Immutable.Set | null; +} + +export interface RangeJSON { + anchorKey?: string | null; + anchorOffset?: number; + focusKey?: string | null; + focusOffset?: number; + isFocused?: boolean; + isBackward?: boolean | null; + marks?: MarkJSON[] | null; +} + +export class Range extends Immutable.Record({}) { + object: 'range'; + anchorKey: string | null; + anchorOffset: number; + focusKey: string | null; + focusOffset: number; + isFocused: boolean; + isBackward: boolean | null; + marks: Immutable.Set | null; + + readonly isBlurred: boolean; + readonly isCollapsed: boolean; + readonly isExpanded: boolean; + readonly isForward: boolean; + readonly startKey: string; + readonly startOffset: number; + readonly endKey: string; + readonly endOffset: number; + + static create(properties: RangeProperties | Range): Range; + static fromJSON(properties: RangeJSON): Range; + static isRange(maybeRange: any): maybeRange is Range; + + toJSON(): RangeProperties; + + hasAnchorAtStartOf(node: Node): boolean; + hasFocusAtStartOf(node: Node): boolean; + hasStartAtStartOf(node: Node): boolean; + hasEndAtStartOf(node: Node): boolean; + hasEdgeAtStartOf(node: Node): boolean; + + hasAnchorAtEndOf(node: Node): boolean; + hasFocusAtEndOf(node: Node): boolean; + hasStartAtEndOf(node: Node): boolean; + hasEndAtEndOf(node: Node): boolean; + hasEdgeAtEndOf(node: Node): boolean; + + hasAnchorBetween(node: Node, start: number, end: number): boolean; + hasFocusBetween(node: Node, start: number, end: number): boolean; + hasStartBetween(node: Node, start: number, end: number): boolean; + hasEndBetween(node: Node, start: number, end: number): boolean; + hasEdgeBetween(node: Node, start: number, end: number): boolean; + + hasAnchorIn(node: Node): boolean; + hasFocusIn(node: Node): boolean; + hasStartIn(node: Node): boolean; + hasEndIn(node: Node): boolean; + hasEdgeIn(node: Node): boolean; + + isAtStartOf(node: Node): boolean; + isAtEndOf(node: Node): boolean; +} + +export type Operation = + | InsertTextOperation + | RemoveTextOperation + | AddMarkOperation + | RemoveMarkOperation + | SetMarkOperation + | InsertNodeOperation + | MergeNodeOperation + | MoveNodeOperation + | RemoveNodeOperation + | SetNodeOperation + | SplitNodeOperation + | SetSelectionOperation + | SetValueOperation; + +export interface InsertTextOperation { + type: 'insert_text'; + path: number[]; + offset: number; + text: string; + marks: Mark[]; +} + +export interface RemoveTextOperation { + type: 'remove_text'; + path: number[]; + offset: number; + text: string; +} + +export interface AddMarkOperation { + type: 'add_mark'; + path: number[]; + offset: number; + length: number; + mark: Mark; +} + +export interface RemoveMarkOperation { + type: 'remove_mark'; + path: number[]; + offset: number; + length: number; + mark: Mark; +} + +export interface SetMarkOperation { + type: 'set_mark'; + path: number[]; + offset: number; + length: number; + mark: Mark; + properties: MarkProperties; +} + +export interface InsertNodeOperation { + type: 'insert_node'; + path: number[]; + node: Node; +} + +export interface MergeNodeOperation { + type: 'merge_node'; + path: number[]; + position: number; +} + +export interface MoveNodeOperation { + type: 'move_node'; + path: number[]; + newPath: number[]; +} + +export interface RemoveNodeOperation { + type: 'remove_node'; + path: number[]; + node: Node; +} + +export interface SetNodeOperation { + type: 'set_node'; + path: number[]; + properties: BlockProperties | InlineProperties | TextProperties; +} + +export interface SplitNodeOperation { + type: 'split_node'; + path: number[]; + position: number; + target: number; +} + +export interface SetSelectionOperation { + type: 'set_selection'; + properties: RangeProperties; + selection: Range; +} + +export interface SetValueOperation { + type: 'set_value'; + properties: ValueProperties; + value: Value; +} + +export const Operations: { + apply: (value: Value, operation: Operation) => Value; + invert: (operation: Operation) => Operation; +}; + +export class Stack extends Immutable.Record({}) { + plugins: any[]; +} + +export function setKeyGenerator(func: () => string): null; +export function resetKeyGenerator(): null; + +export {}; diff --git a/types/slate/slate-tests.ts b/types/slate/slate-tests.ts index 45aca77e7e..2c07a4571b 100644 --- a/types/slate/slate-tests.ts +++ b/types/slate/slate-tests.ts @@ -1,6 +1,6 @@ -import { Slate } from "slate"; +import { Value } from "slate"; -const value = Slate.Value.create(); +const value = Value.create(); value.change() .focus() .selectAll() From e840b49872d8d97d51883c79f57a7ec7bf6cc009 Mon Sep 17 00:00:00 2001 From: Romain Faust Date: Sun, 22 Jul 2018 17:22:30 +0200 Subject: [PATCH 013/346] Add koa-router's Router to koa's Context --- types/koa-router/index.d.ts | 5 ++++ types/koa-router/koa-router-tests.ts | 36 ++++++++++++++++------------ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index 7382dd91e6..f8a31e71cb 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Jerry Chin // Pavel Ivanov // JounQin +// Romain Faust // Definitions: https://github.com/hellopao/DefinitelyTyped // TypeScript Version: 2.3 @@ -51,6 +52,10 @@ declare namespace Router { * url params */ params: any; + /** + * the router instance + */ + router: Router; } export interface IMiddleware { diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index 1325da0de0..b2bec9ad0c 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -8,21 +8,27 @@ const router = new Router({ }); router - .param('id', function(id, ctx, next) { - next(); - }) - .get('/', function (ctx, next) { - ctx.body = 'Hello World!'; - }) - .post('/users', function (ctx, next) { - // ... - }) - .put('/users/:id', function (ctx, next) { - ctx.body = ctx.params.id; - }) - .del('/users/:id', function () { - // ... - }); + .param('id', function (id, ctx, next) { + next(); + }) + .get('/', function (ctx, next) { + ctx.body = 'Hello World!'; + }) + .get('/users/:id', function (ctx, next) { + ctx.body = ctx.router.url('user-accounts', { id: ctx.params.id }) + }) + .get('user-accounts', '/users/:id/accounts', function (ctx, next) { + // ... + }) + .post('/users', function (ctx, next) { + // ... + }) + .put('/users/:id', function (ctx, next) { + ctx.body = ctx.params.id; + }) + .del('/users/:id', function () { + // ... + }); router.get('user', '/users/:id', function (ctx) { ctx.body = "sdsd"; From ac3c6f5947dc65b98330082d26649935d555c986 Mon Sep 17 00:00:00 2001 From: Sean Genabe Date: Thu, 26 Jul 2018 07:13:37 +0800 Subject: [PATCH 014/346] Add typings for yoctodelay --- types/yoctodelay/index.d.ts | 12 ++++++++++++ types/yoctodelay/tsconfig.json | 23 +++++++++++++++++++++++ types/yoctodelay/tslint.json | 1 + types/yoctodelay/yoctodelay-tests.ts | 4 ++++ 4 files changed, 40 insertions(+) create mode 100644 types/yoctodelay/index.d.ts create mode 100644 types/yoctodelay/tsconfig.json create mode 100644 types/yoctodelay/tslint.json create mode 100644 types/yoctodelay/yoctodelay-tests.ts diff --git a/types/yoctodelay/index.d.ts b/types/yoctodelay/index.d.ts new file mode 100644 index 0000000000..ba4d2c6c58 --- /dev/null +++ b/types/yoctodelay/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for yoctodelay 1.1 +// Project: https://github.com/sindresorhus/yoctodelay#readme +// Definitions by: Sean Marvi Oliver Genabe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Delay the promise and then resolve. + * @param ms Milliseconds to delay the promise. + */ +declare function delay(ms: number): Promise; + +export = delay; diff --git a/types/yoctodelay/tsconfig.json b/types/yoctodelay/tsconfig.json new file mode 100644 index 0000000000..6f4d1bf068 --- /dev/null +++ b/types/yoctodelay/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "yoctodelay-tests.ts" + ] +} diff --git a/types/yoctodelay/tslint.json b/types/yoctodelay/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/yoctodelay/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/yoctodelay/yoctodelay-tests.ts b/types/yoctodelay/yoctodelay-tests.ts new file mode 100644 index 0000000000..67a0158d50 --- /dev/null +++ b/types/yoctodelay/yoctodelay-tests.ts @@ -0,0 +1,4 @@ +import delay = require('yoctodelay'); // delay is(ms: number) => Promise + +// $ExpectType Promise +delay(4); From aa28f4cd15bf4558ae9b5a913e4dd274497736f1 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 24 Jul 2018 10:59:14 +0200 Subject: [PATCH 015/346] Add section in SectionListRenderItemInfo --- types/react-native/index.d.ts | 14 ++++++++++++-- types/react-native/test/index.tsx | 5 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 2d3337c96d..9964c0c8ec 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3973,7 +3973,7 @@ export interface SectionBase { key?: string; - renderItem?: ListRenderItem; + renderItem?: SectionListRenderItem; ItemSeparatorComponent?: React.ComponentClass | (() => React.ReactElement) | null; @@ -3984,6 +3984,16 @@ export interface SectionListData extends SectionBase { [key: string]: any; } +/** + * @see https://facebook.github.io/react-native/docs/sectionlist.html#props + */ + +export interface SectionListRenderItemInfo extends ListRenderItemInfo { + section: SectionListData; +} + +export type SectionListRenderItem = (info: SectionListRenderItemInfo) => React.ReactElement | null; + export interface SectionListProps extends ScrollViewProps { /** * Rendered in between adjacent Items within each section. @@ -4087,7 +4097,7 @@ export interface SectionListProps extends ScrollViewProps { /** * Default renderer for every item in every section. Can be over-ridden on a per-section basis. */ - renderItem?: ListRenderItem; + renderItem?: SectionListRenderItem; /** * Rendered at the top of each section. Sticky headers are not yet supported. diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 818be960c7..cb8807e13c 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -49,6 +49,7 @@ import { findNodeHandle, ScrollView, ScrollViewProps, + SectionListRenderItemInfo, RefreshControl, TabBarIOS, NativeModules, @@ -350,9 +351,9 @@ export class SectionListTest extends React.Component, { {section.title} )} - renderItem={(info: { item: string }) => ( + renderItem={(info: SectionListRenderItemInfo) => ( - {info.item} + {`${info.section.title} - ${info.item}`} )} /> From b266279babdd9a69e5495e03132adfffa3cf06c0 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Wed, 1 Aug 2018 10:35:45 +0200 Subject: [PATCH 016/346] Updated typings to match Vimeo's player.js v2.6.3, updated tests to reflect new methods, properties, and events --- types/vimeo__player/index.d.ts | 14 +++++- types/vimeo__player/vimeo__player-tests.ts | 50 +++++++++++++++++++++- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index d5f224975e..4e5b21e82d 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for @vimeo/player 2.0 +// Type definitions for @vimeo/player 2.6.3 // Project: https://github.com/vimeo/player.js // Definitions by: Denis Yılmaz // Felix Albert // Tim Chen +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export function myMethod(a: string): string; @@ -22,7 +23,8 @@ export interface InvalidCuePoint extends Error {name: "InvalidCuePoint"; message export interface RangeError extends Error {name: "RangeError"; message: string; method: string; } export interface TypeError extends Error {name: "TypeError"; message: string; method: string; } -export type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | "seeked" | "texttrackchange" | "cuechange" | "cuepoint" | "volumechange" | "error" | "loaded" | string; +export type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | "seeked" | "texttrackchange" | + "cuechange" | "cuepoint" | "volumechange" | "playbackratechange" | "bufferstart" | "bufferend" | "error" | "loaded" | string; export type EventCallback = (data: any) => any; export class Player { @@ -51,6 +53,8 @@ export class Player { getLoop(): VimeoPromise; setLoop(loop: boolean): VimeoPromise; getPaused(): VimeoPromise; + getPlaybackRate(): VimeoPromise; + setPlaybackRate(playbackRate: number): VimeoPromise; getTextTracks(): VimeoPromise; getVideoEmbedCode(): VimeoPromise; getVideoId(): VimeoPromise; @@ -85,14 +89,20 @@ export interface Options { url?: string; autopause?: boolean; autoplay?: boolean; + background?: boolean; byline?: boolean; color?: string; height?: number; loop?: boolean; maxheight?: number; maxwidth?: number; + muted?: boolean; + playsinline?: boolean; portrait?: boolean; + responsive?: boolean; + speed?: boolean; title?: boolean; + transparent?: boolean; width?: number; } diff --git a/types/vimeo__player/vimeo__player-tests.ts b/types/vimeo__player/vimeo__player-tests.ts index bf5a637762..0dbba1a3a8 100644 --- a/types/vimeo__player/vimeo__player-tests.ts +++ b/types/vimeo__player/vimeo__player-tests.ts @@ -6,7 +6,21 @@ let player: Player ; player = new Player('handstick', { id: 19231868, - width: 640 + width: 640, + + // Use default values for settings, to test typings + autopause: true, + autoplay: false, + background: false, + byline: true, + color: '#00adef', + loop: false, + muted: false, + playsinline: true, + portrait: true, + speed: false, + title: true, + transparent: true }); const onPlay = (data: any) => { @@ -281,12 +295,33 @@ player.getPaused().then((paused) => { // an error occurred }); +player.getPlaybackRate().then((playbackRate) => { + // playbackRate = a numeric value of the current playback rate +}).catch((error) => { + // an error occurred +}); + +player.setPlaybackRate(0.5).then((playbackRate) => { + // playback rate was set +}).catch((error) => { + switch (error.name) { + case 'RangeError': + // the playback rate was less than 0.5 or greater than 2 + break; + + default: + // some other error occurred + break; + } +}); + player.getTextTracks().then((tracks) => { // tracks = an array of track objects tracks.forEach((track) => { console.log(track.label); console.log(track.kind); console.log(track.language); + console.log(track.mode); }); }).catch((error) => { // an error occurred @@ -436,6 +471,19 @@ player.on('volumechange', (data) => { console.log(data.volume); }); +player.on('playbackratechange', (data) => { + // data is an object containing properties specific to that event + console.log(data.playbackRate); +}); + +player.on('bufferstart', (data) => { + // no associated data with this event +}); + +player.on('bufferend', (data) => { + // no associated data with this event +}); + player.on('error', (data) => { // data is an object containing properties specific to that event console.log(data.message); From 2924d2ed0388c5e6c388db7686ba7a699492cbf9 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Wed, 1 Aug 2018 11:21:31 +0200 Subject: [PATCH 017/346] Cleanup of unused boilerplate lines --- types/vimeo__player/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index 4e5b21e82d..edf98de573 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -6,9 +6,6 @@ // Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function myMethod(a: string): string; -export function myOtherMethod(a: number): number; - export type CallbackFunction = (...args: any[]) => any; export interface Error {name: string; message: string; method: string; } From 2bf892910b946867fc2e83d07ad638c278969c5e Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Wed, 1 Aug 2018 11:21:46 +0200 Subject: [PATCH 018/346] setPlaybackRate may return RangeError --- types/vimeo__player/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index edf98de573..181edb4f97 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -51,7 +51,7 @@ export class Player { setLoop(loop: boolean): VimeoPromise; getPaused(): VimeoPromise; getPlaybackRate(): VimeoPromise; - setPlaybackRate(playbackRate: number): VimeoPromise; + setPlaybackRate(playbackRate: number): VimeoPromise; getTextTracks(): VimeoPromise; getVideoEmbedCode(): VimeoPromise; getVideoId(): VimeoPromise; From 1eb84d482e7059438dec1841536957fabed48150 Mon Sep 17 00:00:00 2001 From: denis Date: Tue, 31 Jul 2018 23:41:23 +0200 Subject: [PATCH 019/346] Activate strictNullChecks And strictFunctionTypes --- types/d3-hierarchy/d3-hierarchy-tests.ts | 94 ++++++++++++++---------- types/d3-hierarchy/index.d.ts | 8 +- types/d3-hierarchy/tsconfig.json | 2 +- 3 files changed, 62 insertions(+), 42 deletions(-) diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts index b75b9fbbd0..7e4181f822 100644 --- a/types/d3-hierarchy/d3-hierarchy-tests.ts +++ b/types/d3-hierarchy/d3-hierarchy-tests.ts @@ -13,8 +13,10 @@ import * as d3Hierarchy from 'd3-hierarchy'; // ----------------------------------------------------------------------- let num: number; +let numOrUndefined: number | undefined; let size: [number, number]; -let idString: string; +let sizeOrNull: [number, number] | null; +let idString: string | undefined; // ----------------------------------------------------------------------- // Hierarchy @@ -47,16 +49,20 @@ let hierarchyRootDatum: HierarchyDatum = { ] }; -let hierarchyNodeArray: Array>; +let hierarchyNodeArray: Array> = []; +let hierarchyNodeArrayOrUndefined: Array> | undefined; let hierarchyNode: d3Hierarchy.HierarchyNode; -let hierarchyPointNodeArray: Array>; +let hierarchyPointNodeArray: Array> = []; +let hierarchyPointNodeArrayOrUndefined: Array> | undefined; let hierarchyPointNode: d3Hierarchy.HierarchyPointNode; -let hierarchyRectangularNodeArray: Array>; +let hierarchyRectangularNodeArray: Array> = []; +let hierarchyRectangularNodeArrayOrUndefined: Array> | undefined; let hierarchyRectangularNode: d3Hierarchy.HierarchyRectangularNode; -let hierarchyCircularNodeArray: Array>; +let hierarchyCircularNodeArray: Array> = []; +let hierarchyCircularNodeArrayOrUndefined: Array> | undefined; let hierarchyCircularNode: d3Hierarchy.HierarchyCircularNode; // Create Hierarchy Layout Root Node ===================================== @@ -65,6 +71,10 @@ let hierarchyRootNode: d3Hierarchy.HierarchyNode; hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum); +hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => { + return d.children; +}); + hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => { return d.children || null; }); @@ -79,10 +89,11 @@ num = hierarchyRootNode.height; // children, parent ------------------------------------------------------ -hierarchyNodeArray = hierarchyRootNode.children; +hierarchyNodeArrayOrUndefined = hierarchyRootNode.children; -let parentNode: d3Hierarchy.HierarchyNode; +let parentNode: d3Hierarchy.HierarchyNode | null; parentNode = hierarchyNodeArray.length ? hierarchyNodeArray[0].parent : null; +parentNode = hierarchyNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -119,19 +130,19 @@ hierarchyNode = link.target; hierarchyRootNode = hierarchyRootNode.sum((d) => d.val); -num = hierarchyRootNode.value; +numOrUndefined = hierarchyRootNode.value; // count() and value ---------------------------------------------------------- hierarchyRootNode = hierarchyRootNode.count(); -num = hierarchyRootNode.value; +numOrUndefined = hierarchyRootNode.value; // sort --------------------------------------------------------------------- hierarchyRootNode = hierarchyRootNode.sort((a, b) => { console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); // each(), eachAfter(), eachBefore() ---------------------------------------- @@ -161,12 +172,12 @@ copiedHierarchyNode = hierarchyRootNode.copy(); // ----------------------------------------------------------------------- interface HierarchyDatumWithParentId extends HierarchyDatum { - parentId: string; + parentId: string | null; } interface TabularHierarchyDatum { name: string; - parentId: string; + parentId: string | null; val: number; } @@ -178,7 +189,7 @@ tabularData = [ { name: 'n121', parentId: 'n12', val: 30 } ]; -let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: TabularHierarchyDatum[]) => (string | null | '' | undefined); +let idStringAccessor: (d: TabularHierarchyDatum, i: number, data: TabularHierarchyDatum[]) => (string | null | '' | undefined); // Create Stratify Operator --------------------------------------------- @@ -217,7 +228,8 @@ idStringAccessor = stratificatorizer.parentId(); // Use Stratify Operator ------------------------------------------------ -const stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); +const stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); +const pId: string | null = stratifiedRootNode.data.parentId; // ----------------------------------------------------------------------- // Cluster @@ -235,12 +247,12 @@ clusterLayout = d3Hierarchy.cluster(); clusterLayout = clusterLayout.size([200, 200]); -size = clusterLayout.size(); +sizeOrNull = clusterLayout.size(); // nodeSize() ------------------------------------------------------------ clusterLayout = clusterLayout.nodeSize([10, 10]); -size = clusterLayout.nodeSize(); +sizeOrNull = clusterLayout.nodeSize(); // separation() ---------------------------------------------------------- @@ -272,10 +284,11 @@ num = clusterRootNode.height; // children, parent ------------------------------------------------------ -hierarchyPointNodeArray = clusterRootNode.children; +hierarchyPointNodeArrayOrUndefined = clusterRootNode.children; -let parentPointNode: d3Hierarchy.HierarchyPointNode; +let parentPointNode: d3Hierarchy.HierarchyPointNode | null; parentPointNode = hierarchyPointNodeArray.length ? hierarchyPointNodeArray[0].parent : null; +parentPointNode = hierarchyPointNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -312,20 +325,20 @@ hierarchyPointNode = pointLink.target; clusterRootNode = clusterRootNode.sum((d) => d.val); -num = clusterRootNode.value; +numOrUndefined = clusterRootNode.value; // count() and value ---------------------------------------------------------- clusterRootNode = clusterRootNode.count(); -num = clusterRootNode.value; +numOrUndefined = clusterRootNode.value; // sort --------------------------------------------------------------------- clusterRootNode = clusterRootNode.sort((a, b) => { console.log('x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); // each(), eachAfter(), eachBefore() ---------------------------------------- @@ -366,12 +379,12 @@ treeLayout = d3Hierarchy.tree(); treeLayout = treeLayout.size([200, 200]); -size = treeLayout.size(); +sizeOrNull = treeLayout.size(); // nodeSize() ------------------------------------------------------------ treeLayout = treeLayout.nodeSize([10, 10]); -size = treeLayout.nodeSize(); +sizeOrNull = treeLayout.nodeSize(); // separation() ---------------------------------------------------------- @@ -547,10 +560,11 @@ num = treemapRootNode.height; // children, parent ------------------------------------------------------ -hierarchyRectangularNodeArray = treemapRootNode.children; +hierarchyRectangularNodeArrayOrUndefined = treemapRootNode.children; -let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode; +let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode | null; parentRectangularNode = hierarchyRectangularNodeArray.length ? hierarchyRectangularNodeArray[0].parent : null; +parentRectangularNode = hierarchyRectangularNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -587,19 +601,19 @@ hierarchyRectangularNode = rectangularLink.target; treemapRootNode = treemapRootNode.sum((d) => d.val); -num = treemapRootNode.value; +numOrUndefined = treemapRootNode.value; // count() and value ---------------------------------------------------------- treemapRootNode = treemapRootNode.count(); -num = treemapRootNode.value; +numOrUndefined = treemapRootNode.value; // sort --------------------------------------------------------------------- treemapRootNode = treemapRootNode.sort((a, b) => { console.log('x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); // each(), eachAfter(), eachBefore() ---------------------------------------- @@ -664,7 +678,9 @@ partitionRootNode = partitionLayout(stratifiedRootNode); // Pack // ----------------------------------------------------------------------- -let numberCircularNodeAccessor: (node: d3Hierarchy.HierarchyCircularNode) => number; +type CircularAccessor = (node: d3Hierarchy.HierarchyCircularNode) => number; +let numberCircularNodeAccessor: CircularAccessor; +let numberCircularNodeAccessorOrNull: CircularAccessor | null; // Create pack layout generator ======================================= @@ -682,13 +698,15 @@ size = packLayout.size(); // radius() ------------------------------------------------------------ +packLayout = packLayout.radius(null); + packLayout = packLayout.radius((node) => { console.log('Radius property of node before completing accessor: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode - return node.value; + return node.value!; }); -numberCircularNodeAccessor = packLayout.radius(); +numberCircularNodeAccessorOrNull = packLayout.radius(); // padding() ---------------------------------------------------------------- @@ -697,7 +715,7 @@ packLayout = packLayout.padding(1); packLayout = packLayout.padding((node) => { console.log('Radius property of node: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode - return node.value > 10 ? 2 : 1; + return node.value! > 10 ? 2 : 1; }); numberCircularNodeAccessor = packLayout.padding(); @@ -724,10 +742,11 @@ num = packRootNode.height; // children, parent ------------------------------------------------------ -hierarchyCircularNodeArray = packRootNode.children; +hierarchyCircularNodeArrayOrUndefined = packRootNode.children; -let parentCircularNode: d3Hierarchy.HierarchyCircularNode; +let parentCircularNode: d3Hierarchy.HierarchyCircularNode | null; parentCircularNode = hierarchyCircularNodeArray.length ? hierarchyCircularNodeArray[0].parent : null; +parentCircularNode = hierarchyCircularNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -764,19 +783,20 @@ hierarchyCircularNode = circularLink.target; packRootNode = packRootNode.sum((d) => d.val); -num = packRootNode.value; +numOrUndefined = packRootNode.value; // count() and value ---------------------------------------------------------- packRootNode = packRootNode.count(); -num = packRootNode.value; +numOrUndefined = packRootNode.value; + // sort --------------------------------------------------------------------- packRootNode = packRootNode.sort((a, b) => { console.log('radius of a:', a.r, ' and b:', b.r); // a and b are of type HierarchyCircularNode console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); // each(), eachAfter(), eachBefore() ---------------------------------------- diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts index bdb7b652d5..31209377b9 100644 --- a/types/d3-hierarchy/index.d.ts +++ b/types/d3-hierarchy/index.d.ts @@ -154,7 +154,7 @@ export interface HierarchyNode { * Must return an array of data representing the children, and return null or undefined if the current datum has no children. * If children is not specified, it defaults to: `(d) => d.children`. */ -export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode; +export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null | undefined)): HierarchyNode; // ----------------------------------------------------------------------- // Stratify @@ -182,7 +182,7 @@ export interface StratifyOperator { * * @param id The id accessor. */ - id(id: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this; + id(id: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this; /** * Returns the current parent id accessor, which defaults to: `(d) => d.parentId`. @@ -197,7 +197,7 @@ export interface StratifyOperator { * * @param parentId The parent id accessor. */ - parentId(parentId: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this; + parentId(parentId: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this; } /** @@ -748,7 +748,7 @@ export interface PackLayout { * * @param radius The specified radius accessor. */ - radius(radius: (node: HierarchyCircularNode) => number): this; + radius(radius: null | ((node: HierarchyCircularNode) => number)): this; /** * Returns the current size, which defaults to [1, 1]. diff --git a/types/d3-hierarchy/tsconfig.json b/types/d3-hierarchy/tsconfig.json index 7fbc1fb5df..da64c5832c 100644 --- a/types/d3-hierarchy/tsconfig.json +++ b/types/d3-hierarchy/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From 240bc77bf3b535144d6d3b2cf93056b27ab877c0 Mon Sep 17 00:00:00 2001 From: denis Date: Wed, 1 Aug 2018 11:41:54 +0200 Subject: [PATCH 020/346] 75 col dash --- types/d3-hierarchy/d3-hierarchy-tests.ts | 110 +++++++++++------------ types/d3-hierarchy/index.d.ts | 2 +- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts index 7e4181f822..16b372993d 100644 --- a/types/d3-hierarchy/d3-hierarchy-tests.ts +++ b/types/d3-hierarchy/d3-hierarchy-tests.ts @@ -104,17 +104,17 @@ idString = hierarchyRootNode.id; const ancestors: Array> = hierarchyRootNode.ancestors(); const descendants: Array> = hierarchyRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyNodeArray = hierarchyRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyNode = descendants[descendants.length - 1]; const path: Array> = hierarchyRootNode.path(hierarchyNode); -// links() and HierarchyLink<...> ------------------------------------------ +// links() and HierarchyLink<...> ---------------------------------------- let links: Array>; @@ -126,26 +126,26 @@ link = links[0]; hierarchyNode = link.source; hierarchyNode = link.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- hierarchyRootNode = hierarchyRootNode.sum((d) => d.val); numOrUndefined = hierarchyRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- hierarchyRootNode = hierarchyRootNode.count(); numOrUndefined = hierarchyRootNode.value; -// sort --------------------------------------------------------------------- +// sort ------------------------------------------------------------------ hierarchyRootNode = hierarchyRootNode.sort((a, b) => { console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- hierarchyRootNode = hierarchyRootNode.each((node) => { console.log('Raw value of node:', node.data.val); // node type is HierarchyNode @@ -162,7 +162,7 @@ hierarchyRootNode = hierarchyRootNode.eachBefore((node) => { console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedHierarchyNode: d3Hierarchy.HierarchyNode; copiedHierarchyNode = hierarchyRootNode.copy(); @@ -299,17 +299,17 @@ idString = clusterRootNode.id; const pointNodeAncestors: Array> = clusterRootNode.ancestors(); const pointNodeDescendants: Array> = clusterRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyPointNodeArray = clusterRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyPointNode = pointNodeDescendants[pointNodeDescendants.length - 1]; const clusterPath: Array> = clusterRootNode.path(hierarchyPointNode); -// links() and HierarchyPointLink<...> ------------------------------------------ +// links() and HierarchyPointLink<...> ----------------------------------- let pointLinks: Array>; @@ -321,19 +321,19 @@ pointLink = pointLinks[0]; hierarchyPointNode = pointLink.source; hierarchyPointNode = pointLink.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- clusterRootNode = clusterRootNode.sum((d) => d.val); numOrUndefined = clusterRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- clusterRootNode = clusterRootNode.count(); numOrUndefined = clusterRootNode.value; -// sort --------------------------------------------------------------------- +// sort ------------------------------------------------------------------ clusterRootNode = clusterRootNode.sort((a, b) => { console.log('x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode @@ -341,7 +341,7 @@ clusterRootNode = clusterRootNode.sort((a, b) => { return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- clusterRootNode = clusterRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode @@ -358,7 +358,7 @@ clusterRootNode = clusterRootNode.eachBefore((node) => { console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedClusterNode: d3Hierarchy.HierarchyPointNode; copiedClusterNode = clusterRootNode.copy(); @@ -367,13 +367,13 @@ copiedClusterNode = clusterRootNode.copy(); // Tree // ----------------------------------------------------------------------- -// Create tree layout generator ======================================= +// Create tree layout generator ========================================== let treeLayout: d3Hierarchy.TreeLayout; treeLayout = d3Hierarchy.tree(); -// Configure tree layout generator ==================================== +// Configure tree layout generator ======================================= // size() ---------------------------------------------------------------- @@ -437,13 +437,13 @@ treemapLayout = treemapLayout.size([400, 200]); size = treemapLayout.size(); -// round() ------------------------------------------------------------ +// round() --------------------------------------------------------------- treemapLayout = treemapLayout.round(true); let roundFlag: boolean = treemapLayout.round(); -// padding() ---------------------------------------------------------------- +// padding() ------------------------------------------------------------- treemapLayout = treemapLayout.padding(1); treemapLayout = treemapLayout.padding((node) => { @@ -453,7 +453,7 @@ treemapLayout = treemapLayout.padding((node) => { numberRectangularNodeAccessor = treemapLayout.padding(); -// paddingInner() ---------------------------------------------------------------- +// paddingInner() -------------------------------------------------------- treemapLayout = treemapLayout.paddingInner(1); treemapLayout = treemapLayout.paddingInner((node) => { @@ -463,7 +463,7 @@ treemapLayout = treemapLayout.paddingInner((node) => { numberRectangularNodeAccessor = treemapLayout.paddingInner(); -// paddingOuter() ---------------------------------------------------------------- +// paddingOuter() -------------------------------------------------------- treemapLayout = treemapLayout.paddingOuter(1); treemapLayout = treemapLayout.paddingOuter((node) => { @@ -473,7 +473,7 @@ treemapLayout = treemapLayout.paddingOuter((node) => { numberRectangularNodeAccessor = treemapLayout.paddingOuter(); -// paddingTop() ---------------------------------------------------------------- +// paddingTop() ---------------------------------------------------------- treemapLayout = treemapLayout.paddingTop(1); treemapLayout = treemapLayout.paddingTop((node) => { @@ -483,7 +483,7 @@ treemapLayout = treemapLayout.paddingTop((node) => { numberRectangularNodeAccessor = treemapLayout.paddingTop(); -// paddingRight() ---------------------------------------------------------------- +// paddingRight() -------------------------------------------------------- treemapLayout = treemapLayout.paddingRight(1); treemapLayout = treemapLayout.paddingRight((node) => { @@ -493,7 +493,7 @@ treemapLayout = treemapLayout.paddingRight((node) => { numberRectangularNodeAccessor = treemapLayout.paddingRight(); -// paddingBottom() ---------------------------------------------------------------- +// paddingBottom() ------------------------------------------------------- treemapLayout = treemapLayout.paddingBottom(1); treemapLayout = treemapLayout.paddingBottom((node) => { @@ -503,7 +503,7 @@ treemapLayout = treemapLayout.paddingBottom((node) => { numberRectangularNodeAccessor = treemapLayout.paddingBottom(); -// paddingLeft() ---------------------------------------------------------------- +// paddingLeft() --------------------------------------------------------- treemapLayout = treemapLayout.paddingLeft(1); treemapLayout = treemapLayout.paddingLeft((node) => { @@ -543,7 +543,7 @@ tilingFactoryFn = d3Hierarchy.treemapResquarify.ratio(2); treemapLayout.tile(d3Hierarchy.treemapResquarify.ratio(2)); -// Use HierarchyRectangularNode ================================================ +// Use HierarchyRectangularNode ========================================== // x and y coordinates --------------------------------------------------- @@ -575,17 +575,17 @@ idString = treemapRootNode.id; const rectangularNodeAncestors: Array> = treemapRootNode.ancestors(); const rectangularNodeDescendants: Array> = treemapRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyRectangularNodeArray = treemapRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyRectangularNode = rectangularNodeDescendants[rectangularNodeDescendants.length - 1]; const treemapPath: Array> = treemapRootNode.path(hierarchyRectangularNode); -// links() and HierarchyRectangularLink<...> ------------------------------------------ +// links() and HierarchyRectangularLink<...> ----------------------------- let rectangularLinks: Array>; @@ -597,18 +597,18 @@ rectangularLink = rectangularLinks[0]; hierarchyRectangularNode = rectangularLink.source; hierarchyRectangularNode = rectangularLink.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- treemapRootNode = treemapRootNode.sum((d) => d.val); numOrUndefined = treemapRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- treemapRootNode = treemapRootNode.count(); numOrUndefined = treemapRootNode.value; -// sort --------------------------------------------------------------------- +// sort ------------------------------------------------------------------ treemapRootNode = treemapRootNode.sort((a, b) => { console.log('x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode @@ -616,7 +616,7 @@ treemapRootNode = treemapRootNode.sort((a, b) => { return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- treemapRootNode = treemapRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode @@ -633,7 +633,7 @@ treemapRootNode = treemapRootNode.eachBefore((node) => { console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedTreemapNode: d3Hierarchy.HierarchyRectangularNode; copiedTreemapNode = treemapRootNode.copy(); @@ -642,13 +642,13 @@ copiedTreemapNode = treemapRootNode.copy(); // Partition // ----------------------------------------------------------------------- -// Create partition layout generator ======================================= +// Create partition layout generator ===================================== let partitionLayout: d3Hierarchy.PartitionLayout; partitionLayout = d3Hierarchy.partition(); -// Configure partition layout generator ==================================== +// Configure partition layout generator ================================== // size() ---------------------------------------------------------------- @@ -656,19 +656,19 @@ partitionLayout = partitionLayout.size([400, 200]); size = partitionLayout.size(); -// round() ------------------------------------------------------------ +// round() --------------------------------------------------------------- partitionLayout = partitionLayout.round(true); roundFlag = partitionLayout.round(); -// padding() ---------------------------------------------------------------- +// padding() ------------------------------------------------------------- partitionLayout = partitionLayout.padding(1); num = partitionLayout.padding(); -// Use partition layout generator ========================================== +// Use partition layout generator ======================================== let partitionRootNode: d3Hierarchy.HierarchyRectangularNode; @@ -682,13 +682,13 @@ type CircularAccessor = (node: d3Hierarchy.HierarchyCircularNode; packLayout = d3Hierarchy.pack(); -// Configure pack layout generator ==================================== +// Configure pack layout generator ======================================= // size() ---------------------------------------------------------------- @@ -696,7 +696,7 @@ packLayout = packLayout.size([400, 400]); size = packLayout.size(); -// radius() ------------------------------------------------------------ +// radius() -------------------------------------------------------------- packLayout = packLayout.radius(null); @@ -708,7 +708,7 @@ packLayout = packLayout.radius((node) => { numberCircularNodeAccessorOrNull = packLayout.radius(); -// padding() ---------------------------------------------------------------- +// padding() ------------------------------------------------------------- packLayout = packLayout.padding(1); @@ -720,15 +720,15 @@ packLayout = packLayout.padding((node) => { numberCircularNodeAccessor = packLayout.padding(); -// Use partition layout generator ========================================== +// Use partition layout generator ======================================== let packRootNode: d3Hierarchy.HierarchyCircularNode; packRootNode = packLayout(stratifiedRootNode); -// Use HierarchyCircularNode ================================================ +// Use HierarchyCircularNode ============================================= -// x and y coordinates and radius r ------------------------------------------ +// x and y coordinates and radius r -------------------------------------- num = packRootNode.x; num = packRootNode.y; @@ -757,17 +757,17 @@ idString = packRootNode.id; const circularNodeAncestors: Array> = packRootNode.ancestors(); const circularNodeDescendants: Array> = packRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyCircularNodeArray = packRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyCircularNode = circularNodeDescendants[circularNodeDescendants.length - 1]; const packPath: Array> = packRootNode.path(hierarchyCircularNode); -// links() and HierarchyRectangularLink<...> ------------------------------------------ +// links() and HierarchyRectangularLink<...> ----------------------------- let circularLinks: Array>; @@ -779,19 +779,19 @@ circularLink = circularLinks[0]; hierarchyCircularNode = circularLink.source; hierarchyCircularNode = circularLink.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- packRootNode = packRootNode.sum((d) => d.val); numOrUndefined = packRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- packRootNode = packRootNode.count(); numOrUndefined = packRootNode.value; -// sort --------------------------------------------------------------------- +// sort ------------------------------------------------------------------ packRootNode = packRootNode.sort((a, b) => { console.log('radius of a:', a.r, ' and b:', b.r); // a and b are of type HierarchyCircularNode @@ -799,7 +799,7 @@ packRootNode = packRootNode.sort((a, b) => { return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- packRootNode = packRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode @@ -816,7 +816,7 @@ packRootNode = packRootNode.eachBefore((node) => { console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedPackNode: d3Hierarchy.HierarchyCircularNode; copiedPackNode = packRootNode.copy(); diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts index 31209377b9..0ec823cc78 100644 --- a/types/d3-hierarchy/index.d.ts +++ b/types/d3-hierarchy/index.d.ts @@ -576,7 +576,7 @@ export interface TreemapLayout { */ export function treemap(): TreemapLayout; -// Tiling functions ----------------------------------------------------------------------- +// Tiling functions ------------------------------------------------------ /** * Recursively partitions the specified nodes into an approximately-balanced binary tree, From bbfa43d8364e412f93ba67a49666520a0f05c014 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Wed, 1 Aug 2018 12:52:32 +0200 Subject: [PATCH 021/346] options argument in constructor is optional --- types/vimeo__player/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index 181edb4f97..6fac1db7d9 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -25,7 +25,7 @@ export type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | export type EventCallback = (data: any) => any; export class Player { - constructor(element: HTMLIFrameElement|HTMLElement|string, options: Options); + constructor(element: HTMLIFrameElement|HTMLElement|string, options?: Options); on(event: EventName, callback: EventCallback): void; off(event: EventName, callback?: EventCallback): void; From df0a61ff6fd597db2670187a14994e0e44745a9c Mon Sep 17 00:00:00 2001 From: denis Date: Wed, 1 Aug 2018 13:07:39 +0200 Subject: [PATCH 022/346] `document.body` is possibly 'null' in TypeScript@next --- types/d3kit/d3kit-tests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/d3kit/d3kit-tests.ts b/types/d3kit/d3kit-tests.ts index ec3b2de1ce..e8f66c71f2 100644 --- a/types/d3kit/d3kit-tests.ts +++ b/types/d3kit/d3kit-tests.ts @@ -64,7 +64,7 @@ function test_abstract_plate() { let sel: d3.Selection; // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; + el = document.body!.appendChild(document.createElement('div')) as Element; // create example of options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -193,7 +193,7 @@ function test_abstract_chart() { let plate: d3kit.AbstractPlate; // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; + el = document.body!.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -285,7 +285,7 @@ function test_svg_chart() { let plate: d3kit.SvgPlate; // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; + el = document.body!.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -326,7 +326,7 @@ function test_canvas_chart() { let context: CanvasRenderingContext2D; // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; + el = document.body!.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -362,7 +362,7 @@ function test_hybrid_chart() { let context: CanvasRenderingContext2D; // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; + el = document.body!.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; From ccb674adc72864b791b0b4f12b4e522733774c6f Mon Sep 17 00:00:00 2001 From: Confusus Date: Thu, 2 Aug 2018 10:00:58 +0200 Subject: [PATCH 023/346] Changed types for chained functions and added tests --- types/underscore/index.d.ts | 6 +++--- types/underscore/underscore-tests.ts | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 8822deca98..db45cf606b 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -7,7 +7,7 @@ declare var _: _.UnderscoreStatic; export = _; export as namespace _; -// The DOM is not required to be present, but these definitions reference type Element for the +// The DOM is not required to be present, but these definitions reference type Element for the // isElement check. If the DOM is present, this declaration will merge. declare global { interface Element { } @@ -5692,7 +5692,7 @@ declare module _ { * Wrapped type `object`. * @see _.values **/ - values(): _Chain; + values(): _Chain; /** * Wrapped type `object`. @@ -5704,7 +5704,7 @@ declare module _ { * Wrapped type `object`. * @see _.pairs **/ - pairs(): _Chain; + pairs(): _Chain; /** * Wrapped type `object`. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 419479f689..220bbcb0ef 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -527,6 +527,20 @@ function chain_tests() { .keys() // return ['foo', 'bar'] : string[] .pairs() // return [['foo', '0'], ['bar', '1']] : string[][] .value(); + + interface IYears { + 2016: number; + 2017: number; + } + + let yearObject: IYears = {2016: 1, 2017: 2}; + let valuePerYear: number[] = _.chain(yearObject) + .values() + .value() + + let keyValuePerYear: (string|number)[][] = _.chain(yearObject) + .pairs() + .value() } var obj: { [k: string] : number } = { From 017ffb7238ce29d3a2bf9d066080c8dc18c4ab8f Mon Sep 17 00:00:00 2001 From: Confusus Date: Thu, 2 Aug 2018 11:19:40 +0200 Subject: [PATCH 024/346] Updated types for pairs --- types/underscore/index.d.ts | 4 ++-- types/underscore/underscore-tests.ts | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index db45cf606b..94ed13d099 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -3631,7 +3631,7 @@ declare module _ { * @param object Convert this object to a list of [key, value] pairs. * @return List of [key, value] pairs on `object`. **/ - pairs(object: any): any[][]; + pairs(object: any): [string, any][]; /** * Returns a copy of the object where the keys have become the values and the values the keys. @@ -4738,7 +4738,7 @@ declare module _ { * Wrapped type `object`. * @see _.pairs **/ - pairs(): any[][]; + pairs(): [string, any][]; /** * Wrapped type `object`. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 220bbcb0ef..6175c1874b 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -537,10 +537,6 @@ function chain_tests() { let valuePerYear: number[] = _.chain(yearObject) .values() .value() - - let keyValuePerYear: (string|number)[][] = _.chain(yearObject) - .pairs() - .value() } var obj: { [k: string] : number } = { From 2d9422f0cbfab797ad64f786ee33627af90d7fc0 Mon Sep 17 00:00:00 2001 From: Confusus Date: Thu, 2 Aug 2018 11:22:38 +0200 Subject: [PATCH 025/346] Added my name --- types/underscore/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 94ed13d099..27346d414d 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Underscore 1.8 // Project: http://underscorejs.org/ -// Definitions by: Boris Yankov , Josh Baldwin , Christopher Currens , Cassey Lottman +// Definitions by: Boris Yankov , Josh Baldwin , Christopher Currens , Cassey Lottman , Ard Timmerman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var _: _.UnderscoreStatic; From 7146aa04998d5453240fc273caa584cdf4e87d7c Mon Sep 17 00:00:00 2001 From: Confusus Date: Thu, 2 Aug 2018 11:29:05 +0200 Subject: [PATCH 026/346] Added space after comment which was removed by my editor --- types/underscore/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 27346d414d..95ff48eddc 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -7,7 +7,7 @@ declare var _: _.UnderscoreStatic; export = _; export as namespace _; -// The DOM is not required to be present, but these definitions reference type Element for the +// The DOM is not required to be present, but these definitions reference type Element for the // isElement check. If the DOM is present, this declaration will merge. declare global { interface Element { } From b8c03532114c64d9cc397f9ef4c2b8607229101f Mon Sep 17 00:00:00 2001 From: denis Date: Thu, 2 Aug 2018 11:30:02 +0200 Subject: [PATCH 027/346] CanvasPathMethods has been renamed CanvasPath --- types/d3-shape/d3-shape-tests.ts | 2 +- types/d3-shape/index.d.ts | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index e668d152f8..8ad3e4809a 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -1184,7 +1184,7 @@ interface SymbolDatum { let customSymbol: d3Shape.SymbolType; customSymbol = { - draw(context: CanvasPathMethods, size: number): void { + draw(context: d3Shape.CanvasPath_D3Shape, size: number): void { // draw custom symbol using canvas path methods } }; diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index 47e5c10feb..83222d0ff0 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -7,6 +7,27 @@ import { Path } from 'd3-path'; +// ----------------------------------------------------------------------------------- +// Shared Types and Interfaces +// ----------------------------------------------------------------------------------- + +/** + * @deprecated + * This interface is used to bridge the gap between two incompatible versions of TypeScript (see [#25944](https://github.com/Microsoft/TypeScript/pull/25944)). + * Use `CanvasPathMethods` instead with TS <= 3.0 and `CanvasPath` with TS >= 3.1. + */ +export interface CanvasPath_D3Shape { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + // ----------------------------------------------------------------------------------- // Arc Generator // ----------------------------------------------------------------------------------- @@ -2264,13 +2285,13 @@ export function linkRadial(): LinkRadial Date: Thu, 2 Aug 2018 11:12:33 -0400 Subject: [PATCH 028/346] Add types to private functions - Job.moveToCompleted - Job.moveToFailed - Queue.getNextJob - Also add null possibility to Queue.getJob --- types/bull/index.d.ts | 1 + types/bull/v2/index.d.ts | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index a11ae0257a..ac820290f2 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -9,6 +9,7 @@ // David Koblas // Bond Akinmade // Wuha Team +// Alec Brunelle // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/bull/v2/index.d.ts b/types/bull/v2/index.d.ts index 3c89655101..e97920efd7 100644 --- a/types/bull/v2/index.d.ts +++ b/types/bull/v2/index.d.ts @@ -54,6 +54,22 @@ declare module "bull" { * since pubsub does not give any guarantees. */ finished(): Promise; + + /** + * Moves a job to the completed queue and moves a new job from 'waiting' to 'active'. + * @param returnValue The jobs success message. + * @param ignoreLock True when wanting to ignore the redis lock on this job. + * @returns Returns the id of the pulled job. + */ + moveToCompleted(returnValue: string, ignoreLock: boolean): Promise; + + /** + * Moves a job to the failed queue. + * @param errorInfo The jobs error message. + * @param ignoreLock True when wanting to ignore the redis lock on this job. + * @returns void + */ + moveToFailed(errorInfo: ErrorMessage, ignoreLock: boolean): Promise; } export interface Backoff { @@ -204,7 +220,7 @@ declare module "bull" { * Returns a promise that will return the job instance associated with the jobId parameter. * If the specified job cannot be located, the promise callback parameter will be set to null. */ - getJob(jobId: string): Promise; + getJob(jobId: string): Promise; /** * Tells the queue remove all jobs created outside of a grace period in milliseconds. @@ -217,6 +233,18 @@ declare module "bull" { * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' */ on(eventName: string, callback: EventCallback): void; + + /** + * Moves the next job from 'waiting' to 'active'. + * Sets the processedOn timestamp to the current datetime. + * @param jobId If specified, will move a specific job from 'waiting' to 'active', + * @returns Returns the job moved from waiting to active queue. + */ + getNextJob:(jobId?: string) => Promise; + } + + interface ErrorMessage { + message: string; } interface EventCallback { From a8486a33eababbecc2acd6fa62cf6c6e63947ba9 Mon Sep 17 00:00:00 2001 From: Geoff Cameron Date: Wed, 1 Aug 2018 15:24:43 -0400 Subject: [PATCH 029/346] Make typings compatible with ES6 promises Since ES6 promises don't implement finally, trying to $q.when a third party promises fails typings. This introduces a new type that is compatible with this, to allow for typings to work when taking an ES6 promise. Totally willing to change the name to something more sensible here --- types/angular/index.d.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 450d381b6d..42200cf69f 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1137,12 +1137,12 @@ declare namespace angular { * * @param value Value or a promise */ - resolve(value: IPromise|T): IPromise; + resolve(value: IPromiseGlobal|T): IPromise; /** * @deprecated Since TS 2.4, inference is stricter and no longer produces the desired type when T1 !== T2. * To use resolve with two different types, pass a union type to the single-type-argument overload. */ - resolve(value: IPromise|T2): IPromise; + resolve(value: IPromiseGlobal|T2): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1152,11 +1152,11 @@ declare namespace angular { * * @param value Value or a promise */ - when(value: IPromise|T): IPromise; - when(value: IPromise|T2): IPromise; - when(value: IPromise|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; + when(value: IPromiseGlobal|T): IPromise; + when(value: IPromiseGlobal|T2): IPromise; + when(value: IPromiseGlobal|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: IPromise, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; + when(value: IPromiseGlobal, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1182,7 +1182,11 @@ declare namespace angular { errorOnUnhandledRejections(value: boolean): IQProvider; } - interface IPromise { + /** + * Spec that all promises should adhere to, for typing reasons -- so when and resolve can take + * 3rd party promises as arguments (ES6 Promises don't have finally) + */ + interface IPromiseGlobal { /** * Regardless of when the promise was or will be resolved or rejected, then calls one of * the success or error callbacks asynchronously as soon as the result is available. The @@ -1214,7 +1218,9 @@ declare namespace angular { | ((reason: any) => IPromise | IPromise | TResult) | null ): IPromise; + } + interface IPromise extends IPromiseGlobal { /** * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. * From f28e09e7b0db43fe9434d31bac20aca0c33c259b Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Thu, 2 Aug 2018 16:54:07 -0400 Subject: [PATCH 030/346] Add typings file for dialogflow --- types/dialogflow/dialogflow-tests.ts | 10 + types/dialogflow/index.d.ts | 915 +++++++++++++++++++++++++++ types/dialogflow/tsconfig.json | 22 + types/dialogflow/tslint.json | 1 + 4 files changed, 948 insertions(+) create mode 100644 types/dialogflow/dialogflow-tests.ts create mode 100644 types/dialogflow/index.d.ts create mode 100644 types/dialogflow/tsconfig.json create mode 100644 types/dialogflow/tslint.json diff --git a/types/dialogflow/dialogflow-tests.ts b/types/dialogflow/dialogflow-tests.ts new file mode 100644 index 0000000000..aae5fc4ef9 --- /dev/null +++ b/types/dialogflow/dialogflow-tests.ts @@ -0,0 +1,10 @@ +import * as dialogflow from "dialogflow"; + +const agentsClient = new dialogflow.AgentsClient() +const contextsClient = new dialogflow.ContextsClient() +const entityTypesClient = new dialogflow.EntityTypesClient() +const intentsClient = new dialogflow.IntentsClient() +const sessionEntityTypesClient = new dialogflow.SessionEntityTypesClient() +const sessionsClient = new dialogflow.SessionsClient() + +// TODO: Add real significant tests diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts new file mode 100644 index 0000000000..9c8d499a41 --- /dev/null +++ b/types/dialogflow/index.d.ts @@ -0,0 +1,915 @@ +// Type definitions for dialogflow 0.6 +// Project: https://github.com/dialogflow/dialogflow-nodejs-client-v2#readme +// Definitions by: Daniel Dyla +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export namespace v2 { + class AgentsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + getAgent( + request: GetAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, agent?: Agent) => void, + ): Promise<[Agent]>; + searchAgents( + request: SearchAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, agents?: Agent[], arg3?: any, response?: any) => void, + ): Promise; + searchAgentsStream( + request: SearchAgentRequest, + options?: gax.CallOptions, + ): NodeJS.ReadableStream; + trainAgent( + request: TrainAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void, + ): Promise<[gax.Operation]>; + exportAgent( + request: ExportAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void, + ): Promise<[gax.Operation]>; + importAgent( + request: ImportAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void, + ): Promise<[gax.Operation]>; + restoreAgent( + request: RestoreAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void, + ): Promise<[gax.Operation]>; + } + + class ContextsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + listContexts( + request: ListContextsRequest, + options?: gax.CallOptions, + ): Promise<[Context[]]>; + listContextsStream( + request: ListContextsRequest, + options?: gax.CallOptions, + ): NodeJS.ReadableStream; + getContext( + request: GetContextRequest, + options?: gax.CallOptions, + ): Promise<[Context]>; + createContext( + request: CreateContextReqeust, + options?: gax.CallOptions, + ): Promise<[Context]>; + updateContext( + request: UpdateContextRequest, + options?: gax.CallOptions, + ): Promise<[Context]>; + deleteContext( + request: DeleteContextRequest, + options?: gax.CallOptions, + ): Promise; + deleteAllContexts( + request: DeleteAllContextsRequest, + options?: gax.CallOptions, + ): Promise; + + sessionPath(project: string, session: string): string; + contextPath(project: string, session: string, context: string): string; + + matchProjectFromContextName(name: string): string; + matchSessionFromContextName(name: string): string; + matchContextFromContextName(name: string): string; + + matchProjectFromSessionName(name: string): string; + matchSessionFromSessionName(name: string): string; + } + + class EntityTypesClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + listEntityTypes( + request: ListEntityTypesRequest, + options?: gax.CallOptions, + ): Promise<[EntityType[]]>; + + listEntityTypesStream( + request: ListEntityTypesRequest, + options?: gax.CallOptions, + ): NodeJS.ReadableStream; + + getEntityType( + request: GetEntityTypeRequest, + options?: gax.CallOptions, + ): Promise<[EntityType]>; + createEntityType( + request: CreateEntityTypeRequest, + options?: gax.CallOptions, + ): Promise<[EntityType]>; + updateEntityType( + request: UpdateEntityTypeRequest, + options?: gax.CallOptions, + ): Promise<[EntityType]>; + deleteEntityType( + request: DeleteEntityTypeRequest, + options?: gax.CallOptions, + ): Promise; + + // TODO: add batch style calls + // batchUpdateEntityTypes + // batchDeleteEntityTypes + // batchCreateEntities + // batchUpdateEntities + // batchDeleteEntities + + projectAgentPath(project: string): string; + entityTypePath(project: string, entityType: string): string; + matchProjectFromProjectAgentName(entityTypeName: string): string; + matchProjectFromEntityTypeName(entityTypeName: string): string; + matchEntityTypeFromEntityTypeName(entityTypeName: string): string; + } + + class IntentsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + listIntents( + request: ListIntentsRequest, + options?: gax.CallOptions, + ): Promise<[Intent[]]>; + getIntent( + request: GetIntentRequest, + options?: gax.CallOptions, + ): Promise<[Intent]>; + createIntent( + request: CreateIntentRequest, + options?: gax.CallOptions, + ): Promise<[Intent]>; + updateIntent( + request: UpdateIntentRequest, + options?: gax.CallOptions, + ): Promise<[Intent]>; + deleteIntent( + request: DeleteIntentRequest, + options?: gax.CallOptions, + ): Promise; + + // TODO: add batch style calls + // batchUpdateIntents(request: BatchUpdateIntentsRequest): void; + // batchDeleteIntents(request: BatchDeleteIntentsRequest): void; + + projectAgentPath(project: string): string; + intentPath(project: string, intent: string): string; + agentPath(project: string, agent: string): string; + + matchProjectFromProjectAgentName(projectAgentName: string): string; + matchProjectFromIntentName(intentName: string): string; + matchIntentFromIntentName(intentName: string): string; + matchProjectFromAgentName(agentName: string): string; + matchAgentFromAgentName(agentName: string): string; + } + + class SessionEntityTypesClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + // TODO: add Session Entity Types service methods + } + + class SessionsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + detectIntent( + request: DetectIntentRequest, + options?: gax.CallOptions, + ): Promise; + streamingDetectIntent(options?: gax.CallOptions): Promise; + + sessionPath(projectId: string, sessionId: string): string; + } + } + + export namespace v2beta1 { + class AgentsClient extends v2.AgentsClient {} + class ContextsClient extends v2.ContextsClient { + environmentSessionPath( + project: string, + environment: string, + user: string, + session: string, + ): string; + + environmentContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string, + ): string; + + matchProjectFromEnvironmentSessionName( + environmentSessionName: string, + ): string; + matchEnvironmentFromEnvironmentSessionName( + environmentSessionName: string, + ): string; + matchUserFromEnvironmentSessionName(environmentSessionName: string): string; + matchSessionFromEnvironmentSessionName( + environmentSessionName: string, + ): string; + + matchProjectFromEnvironmentContextName( + environmentContextName: string, + ): string; + matchEnvironmentFromEnvironmentContextName( + environmentContextName: string, + ): string; + matchUserFromEnvironmentContextName(environmentContextName: string): string; + matchSessionFromEnvironmentContextName( + environmentContextName: string, + ): string; + matchContextFromEnvironmentContextName( + environmentContextName: string, + ): string; + } + class EntityTypesClient extends v2.EntityTypesClient {} + class IntentsClient extends v2.IntentsClient {} + class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} + class SessionsClient extends v2.SessionsClient { + environmentSessionPath( + project: string, + environment: string, + user: string, + session: string, + ): string; + + matchProjectFromEnvironmentSessionName( + environmentSessionName: string, + ): string; + matchEnvironmentFromEnvironmentSessionName( + environmentSessionName: string, + ): string; + matchUserFromEnvironmentSessionName(environmentSessionName: string): string; + matchSessionFromEnvironmentSessionName( + environmentSessionName: string, + ): string; + } + } + + export class AgentsClient extends v2.AgentsClient {} + export class ContextsClient extends v2.ContextsClient {} + export class EntityTypesClient extends v2.EntityTypesClient {} + export class IntentsClient extends v2.IntentsClient {} + export class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} + export class SessionsClient extends v2.SessionsClient {} + + export namespace entities { + namespace DateTimeVariants { + type DateTime = { + date_time: string; + }; + + type DateTimePeriod = { + startDateTime: DateTime; + endDateTime: DateTime; + }; + + type DatePeriod = { + startDate: Date; + endDate: Date; + }; + type TimePeriod = { + startTime: string; + endTime: string; + }; + } + + type DateTime = + | string + | DateTimeVariants.DatePeriod + | DateTimeVariants.TimePeriod + | DateTimeVariants.DateTime + | DateTimeVariants.DateTimePeriod; + + type Duration = { + unit: string; + amount: number; + }; + + type Date = string; + + type Time = string; + } + + export namespace gax { + export interface BackoffSettings { + initialRetryDelayMillis: number; + retryDelayMultiplier: number; + maxRetryDelayMillis: number; + initialRpcTimeoutMillis: number; + maxRpcTimeoutMillis: number; + totalTimeoutMillis: number; + } + + export interface RetryOptions { + retryCodes: string[]; + backoffSettings: BackoffSettings; + } + + export interface CallOptions { + timeout?: number; + retry?: RetryOptions; + autoPaginate?: boolean; + pageToken?: any; + isBundling?: boolean; + longrunning?: BackoffSettings; + promise?: PromiseConstructor; + } + + export interface Operation { + grpcOp: longrunning.Operation; + longrunningDescriptor: any; + backoffSettings: BackoffSettings; + callOptions?: CallOptions; + } + } + + export namespace longrunning { + export type Operation = + | UnfinishedOperation + | FailedOperation + | SuccessfulOperation; + + export interface BaseOperation { + name: string; + metadata: any; + done: boolean; + } + + export interface UnfinishedOperation extends BaseOperation { + done: false; + } + + export interface FailedOperation extends BaseOperation { + done: true; + error: Status; + } + + export interface SuccessfulOperation extends BaseOperation { + done: true; + response: any; + } + + export interface Status { + code: number; + message: string; + details: any[]; + } + } + + export interface GetAgentRequest { + parent: string; + } + + export interface SearchAgentRequest { + parent: string; + pageSize?: number; + } + + export interface TrainAgentRequest { + parent: string; + } + + export interface ExportAgentRequest { + parent: string; + agentUri?: string; + } + + export interface ImportAgentRequest { + parent: string; + agentUri?: string; + agentContent?: string; + } + + export interface RestoreAgentRequest { + parent: string; + agentUri?: string; + agentContent?: string; + } + + export interface ListContextsRequest { + parent: string; + pageSize?: number; + } + + export interface GetContextRequest { + name: string; + } + + export interface CreateContextReqeust { + parent: string; + context: Context; + } + + export interface UpdateContextRequest { + context: Context; + updatemask?: any; + } + + export interface DeleteContextRequest { + name: string; + } + + export interface DeleteAllContextsRequest { + parent: string; + } + + export interface ListEntityTypesRequest { + parent: string; + languageCode?: string; + pageSize?: number; + } + + export interface GetEntityTypeRequest { + name: string; + languageCode?: string; + } + + export interface CreateEntityTypeRequest { + parent: string; + entityType: EntityType; + } + + export interface UpdateEntityTypeRequest { + entityType: EntityType; + languageCode?: string; + /** @link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto */ + updateMask?: any; + } + + export interface DeleteEntityTypeRequest { + name: string; + } + + export interface ListIntentsRequest { + parent: string; + languageCode?: string; + intentView?: IntentView; + pageSize?: number; + } + + export interface GetIntentRequest { + name: string; + languageCode?: string; + intentView?: IntentView; + } + + export interface CreateIntentRequest { + parent: string; + intent: Intent; + languageCode?: string; + intentView?: IntentView; + } + + export interface UpdateIntentRequest { + intent: Intent; + languageCode?: string; + updateMask?: any; + intentView?: IntentView; + } + + export interface DeleteIntentRequest { + name: string; + } + + export interface DetectIntentRequest { + session: string; + queryInput: QueryInput; + queryParams?: QueryParams; + inputAudio?: Buffer; + } + + export interface DetectIntentResponse { + responseId: string; + queryResult: QueryResult; + webhookStatus: Status; + } + + export interface QueryResult { + queryText: string; + laugnageCode: string; + speechRecognitionConfidence: number; + action: string; + parameters: any; + allRequiredParamsSent: boolean; + fulfillmentText: string; + fulfillmentMessages: Message[]; + webhookSource: string; + webhookPayload: any; + outputContexts: Context[]; + intent: Intent; + intentDetectionConfidence: number; + diagnosticInfo: any; + } + + export interface Status { + code: StatusCode; + message: string; + details: any[]; + } + + export enum StatusCode { + // Not an error; returned on success + // + // HTTP Mapping: 200 OK + OK = 0, + + // The operation was cancelled, typically by the caller. + // + // HTTP Mapping: 499 Client Closed Request + CANCELLED = 1, + + // Unknown error. For example, this error may be returned when + // a `Status` value received from another address space belongs to + // an error space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2, + + // The client specified an invalid argument. Note that this differs + // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3, + + // The deadline expired before the operation could complete. For operations + // that change the state of the system, this error may be returned + // even if the operation has completed successfully. For example, a + // successful response from a server could have been delayed long + // enough for the deadline to expire. + // + // HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4, + + // Some requested entity (e.g., file or directory) was not found. + // + // Note to server developers: if a request is denied for an entire class + // of users, such as gradual feature rollout or undocumented whitelist, + // `NOT_FOUND` may be used. If a request is denied for some users within + // a class of users, such as user-based access control, `PERMISSION_DENIED` + // must be used. + // + // HTTP Mapping: 404 Not Found + NOT_FOUND = 5, + + // The entity that a client attempted to create (e.g., file or directory) + // already exists. + // + // HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6, + + // The caller does not have permission to execute the specified + // operation. `PERMISSION_DENIED` must not be used for rejections + // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + // instead for those errors). `PERMISSION_DENIED` must not be + // used if the caller can not be identified (use `UNAUTHENTICATED` + // instead for those errors). This error code does not imply the + // request is valid or the requested entity exists or satisfies + // other pre-conditions. + // + // HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7, + + // The request does not have valid authentication credentials for the + // operation. + // + // HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16, + + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + // + // HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8, + + // The operation was rejected because the system is not in a state + // required for the operation's execution. For example, the directory + // to be deleted is non-empty, an rmdir operation is applied to + // a non-directory, etc. + // + // Service implementors can use the following guidelines to decide + // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. + // + // HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9, + + // The operation was aborted, typically due to a concurrency issue such as + // a sequencer check failure or transaction abort. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 409 Conflict + ABORTED = 10, + + // The operation was attempted past the valid range. E.g., seeking or + // reading past end-of-file. + // + // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate `INVALID_ARGUMENT` if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // `OUT_OF_RANGE` if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between `FAILED_PRECONDITION` and + // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an `OUT_OF_RANGE` error to detect when + // they are done. + // + // HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11, + + // The operation is not implemented or is not supported/enabled in this + // service. + // + // HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12, + + // Internal errors. This means that some invariants expected by the + // underlying system have been broken. This error code is reserved + // for serious errors. + // + // HTTP Mapping: 500 Internal Server Error + INTERNAL = 13, + + // The service is currently unavailable. This is most likely a + // transient condition, which can be corrected by retrying with + // a backoff. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14, + + // Unrecoverable data loss or corruption. + // + // HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15, + } + + export interface Agent { + parent: string; + displayName: string; + defaultLanguageCode: string; + supportedLanguageCodes?: string[]; + timeZone: string; + description?: string; + avatarUri?: string; + enableLogging?: boolean; + matchMode?: MatchMode; + classificationThreshold?: number; + } + + export interface Context { + name: string; + lifespanCount?: number; + parameters?: any; + } + + export interface EntityType { + name: string; + entities: EntitySynonyms[]; + displayName: string; + kind: EntityKind; + autoExpansionMode: EntityAutoExpansionMode; + } + + export enum MatchMode { + MATCH_MODE_UNSPECIFIED = "MATCH_MODE_UNSPECIFIED", + MATCH_MODE_HYBRID = "MATCH_MODE_HYBRID", + MATCH_MODE_ML_ONLY = "MATCH_MODE_ML_ONLY", + } + + export interface Credentials { + clientEmail?: string; + privateKey?: string; + } + + export interface ClientOptions { + credentials?: Credentials; + email?: string; + keyFilename?: string; + port?: number; + projectId?: string; + promise?: PromiseConstructor; + servicePath?: string; + } + + export interface EntitySynonyms { + synonyms: string[]; + value: string; + } + + export enum EntityKind { + KIND_MAP = "KIND_MAP", + KIND_LIST = "KIND_LIST", + } + + export enum EntityAutoExpansionMode { + AUTO_EXPANSION_MODE_DEFAULT = "AUTO_EXPANSION_MODE_DEFAULT", + AUTO_EXPANSION_MODE_UNSPECIFIED = "AUTO_EXPANSION_MODE_UNSPECIFIED", + } + + export enum IntentView { + INTENT_VIEW_UNSPECIFIED = "INTENT_VIEW_UNSPECIFIED", + INTENT_VIEW_FULL = "INTENT_VIEW_FULL", + } + + export interface Intent { + name: string; + displayName: string; + webhookState: string; + priority?: number; + isFallback?: boolean; + mlEnabled?: boolean; + inputContextNames?: string[]; + events?: string[]; + trainingPhrases?: TrainingPhrase[]; + action?: string; + outputContexts?: Context[]; + resetContexts?: boolean; + parameters?: Parameter[]; + messages?: Message[]; + defaultResponsePlatforms?: string[]; + rootFollowupIntentName: string; + parentFollowupIntentName: string; + followupIntentInfo?: FollowupIntentInfo[]; + } + + export interface TrainingPhrase { + name: string; + type: string; + parts: Part[]; + timesAddedCount?: number; + } + + export interface Part { + text: string; + entityType?: string; + alias?: string; + userDefined?: boolean; + } + + export interface Parameter { + name: string; + displayName: string; + value?: string; + defaultValue?: string; + entityTypeDisplayName?: string; + mandatory?: boolean; + prompts?: string[]; + isList?: boolean; + } + + export interface FollowupIntentInfo { + followupIntentName: string; + parentFollowupIntentName: string; + } + + export interface Message { + platform?: string; + text?: Text; + card?: Card; + payload?: any; + } + + export interface Text { + text: string[]; + } + + export interface Card { + title?: string; + subtitle?: string; + imageUri?: string; + buttons?: Button[]; + } + + export interface Button { + text?: string; + postback?: string; + } + + export interface EventInput { + name: string; + languageCode: string; + parameters?: any; + } + + export interface TextInput { + text: string; + languageCode: string; + } + + export interface QueryInput { + text?: TextInput; + event?: EventInput; + } + + export interface QueryParams { + timeZone?: string; + geoLocation?: LatLong; + contexts?: Context[]; + resetContexts?: boolean; + sessionEntityTypes?: SessionEntityType[]; + payload?: any; + } + + export interface LatLong { + latitude: number; + longitude: number; + } + + export interface SessionEntityType { + name: string; + entityOverrideMode: string; + entities: Entity[]; + } + + export interface Entity { + value: string; + synonyms: string[]; + } + + export interface WebhookRequest { + session: string; + responseId: string; + + queryResult: QueryResult; + originalDetectIntentRequest?: any; + } + + export interface WebhookResponse { + fulfillmentText?: string; + fulfillmentMessages?: Message[]; + source?: string; + payload?: any; + outputContexts?: Context[]; + followupEventInput?: EventInput; + } diff --git a/types/dialogflow/tsconfig.json b/types/dialogflow/tsconfig.json new file mode 100644 index 0000000000..3133bd6dcb --- /dev/null +++ b/types/dialogflow/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": ["node", "gax-nodejs"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dialogflow-tests.ts" + ] +} diff --git a/types/dialogflow/tslint.json b/types/dialogflow/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dialogflow/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 964331d33485c37a063cad5895bf1c54551d61c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Sm=C3=B3=C5=82ka?= Date: Fri, 3 Aug 2018 09:48:32 +0200 Subject: [PATCH 031/346] kendo-ui: added missing drag and drop data definitions --- types/kendo-ui/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index dc9f7d43f0..ca3a28e376 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -20299,16 +20299,19 @@ interface JQueryPromise { interface JQuery { + data(key: any): any; + kendoDraggable(): JQuery; kendoDraggable(options: kendo.ui.DraggableOptions): JQuery; + data(key: "kendoDraggable"): kendo.ui.Draggable; kendoDropTarget(): JQuery; kendoDropTarget(options: kendo.ui.DropTargetOptions): JQuery; + data(key: "kendoDropTarget"): kendo.ui.DropTarget; kendoDropTargetArea(): JQuery; kendoDropTargetArea(options: kendo.ui.DropTargetAreaOptions): JQuery; - - data(key: any): any; + data(key: "kendoDropTargetArea"): kendo.ui.DropTargetArea; kendoAlert(): JQuery; kendoAlert(options: kendo.ui.AlertOptions): JQuery; From 322c5e6cad5425511f721159d79b88c291b1cdb0 Mon Sep 17 00:00:00 2001 From: Geoff Cameron Date: Fri, 3 Aug 2018 19:34:11 -0400 Subject: [PATCH 032/346] Use real promise base class --- types/angular/index.d.ts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 42200cf69f..1f7437a02d 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1137,12 +1137,12 @@ declare namespace angular { * * @param value Value or a promise */ - resolve(value: IPromiseGlobal|T): IPromise; + resolve(value: PromiseLike|T): IPromise; /** * @deprecated Since TS 2.4, inference is stricter and no longer produces the desired type when T1 !== T2. * To use resolve with two different types, pass a union type to the single-type-argument overload. */ - resolve(value: IPromiseGlobal|T2): IPromise; + resolve(value: PromiseLike|T2): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1152,11 +1152,11 @@ declare namespace angular { * * @param value Value or a promise */ - when(value: IPromiseGlobal|T): IPromise; - when(value: IPromiseGlobal|T2): IPromise; - when(value: IPromiseGlobal|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; + when(value: PromiseLike|T): IPromise; + when(value: PromiseLike|T2): IPromise; + when(value: PromiseLike|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: IPromiseGlobal, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1182,11 +1182,7 @@ declare namespace angular { errorOnUnhandledRejections(value: boolean): IQProvider; } - /** - * Spec that all promises should adhere to, for typing reasons -- so when and resolve can take - * 3rd party promises as arguments (ES6 Promises don't have finally) - */ - interface IPromiseGlobal { + interface IPromise { /** * Regardless of when the promise was or will be resolved or rejected, then calls one of * the success or error callbacks asynchronously as soon as the result is available. The @@ -1218,9 +1214,7 @@ declare namespace angular { | ((reason: any) => IPromise | IPromise | TResult) | null ): IPromise; - } - interface IPromise extends IPromiseGlobal { /** * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. * From 2c06bf7252757a765a9127c67205f0b6ef1c199b Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Aug 2018 20:00:10 -0500 Subject: [PATCH 033/346] Added signal to CredentialRequestOptions and CredentialCreationOptions interfaces. --- types/webappsec-credential-management/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/webappsec-credential-management/index.d.ts b/types/webappsec-credential-management/index.d.ts index 9ab3292c3b..12b2468c3e 100644 --- a/types/webappsec-credential-management/index.d.ts +++ b/types/webappsec-credential-management/index.d.ts @@ -314,6 +314,11 @@ interface CredentialRequestOptions { * This property specifies options for requesting a public-key signature. */ publicKey?: PublicKeyCredentialRequestOptions; + + /** + * This property lets the developer abort an ongoing get() operation. + */ + signal?: AbortSignal; } /** @@ -342,6 +347,10 @@ interface CredentialCreationOptions { * @see {@link https://w3c.github.io/webauthn/#dictionary-makecredentialoptions} */ publicKey?: PublicKeyCredentialCreationOptions; + /** + * @see {@link https://w3c.github.io/webappsec-credential-management/#dom-credentialrequestoptions-signal} + */ + signal?: AbortSignal; } /** From 84ccd818d7414b089b34a2ef6561e8710d93d66a Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Aug 2018 20:57:39 -0500 Subject: [PATCH 034/346] Updated TypeScript version in modified index file.. --- types/webappsec-credential-management/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webappsec-credential-management/index.d.ts b/types/webappsec-credential-management/index.d.ts index 12b2468c3e..ad36b0318d 100644 --- a/types/webappsec-credential-management/index.d.ts +++ b/types/webappsec-credential-management/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/w3c/webappsec-credential-management // Definitions by: Iain McGinniss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.7 // Spec: https://www.w3.org/TR/2017/WD-credential-management-1-20170804 From 3721705444a3924f32a6b3c714ef1b94d7db548d Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Aug 2018 21:15:35 -0500 Subject: [PATCH 035/346] Fixed error in seemingly unrelated test case. --- .../webappsec-credential-management-tests.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/types/webappsec-credential-management/webappsec-credential-management-tests.ts b/types/webappsec-credential-management/webappsec-credential-management-tests.ts index 2afa9f8785..a475fa5379 100644 --- a/types/webappsec-credential-management/webappsec-credential-management-tests.ts +++ b/types/webappsec-credential-management/webappsec-credential-management-tests.ts @@ -214,7 +214,10 @@ function signOutDeprecated() { } navigator.credentials.requireUserMediation().then(() => { - document.location.assign('/'); + const location = document.location; + if (location) { + location.assign('/'); + } }); } @@ -224,7 +227,10 @@ function signOut() { } navigator.credentials.preventSilentAccess().then(() => { - document.location.assign('/'); + const location = document.location; + if (location) { + location.assign('/'); + } }); } From efeac3258dc2de78b456f90308f1a0a73f64180e Mon Sep 17 00:00:00 2001 From: zaycker Date: Sat, 4 Aug 2018 22:08:24 +0300 Subject: [PATCH 036/346] Added absent rc-select props: to Select: + getInputElement + id + labelInValue + maxTagCount + maxTagPlaceholder + onBlur + onFocus + onInputKeyDown + onPopupScroll + placeholder + showAction + showArrow + tokenSeparators to Option: + title Sorted alph-ly --- types/rc-select/index.d.ts | 60 +++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/types/rc-select/index.d.ts b/types/rc-select/index.d.ts index b78fc03837..a27ee36784 100644 --- a/types/rc-select/index.d.ts +++ b/types/rc-select/index.d.ts @@ -20,41 +20,55 @@ export { declare namespace RcSelect { interface SelectProps { - className?: string; - prefixCls?: string; - animation?: string; - transitionName?: string; - choiceTransitionName?: string; - dropdownMatchSelectWidth?: boolean; - dropdownClassName?: string; - dropdownStyle?: { [key: string]: string }; - dropdownMenuStyle?: { [key: string]: string }; - notFoundContent?: string; - showSearch?: boolean; allowClear?: boolean; - tags?: boolean; - maxTagTextLength?: number; + animation?: string; + choiceTransitionName?: string; + className?: string; combobox?: boolean; - multiple?: boolean; - disabled?: boolean; - filterOption?: boolean; - optionFilterProp?: string; - optionLabelProp?: string; + defaultActiveFirstOption?: boolean; + defaultLabel?: string | Array; defaultValue?: string | Array; - value?: string | Array; + disabled?: boolean; + dropdownClassName?: string; + dropdownMatchSelectWidth?: boolean; + dropdownMenuStyle?: { [key: string]: string }; + dropdownStyle?: { [key: string]: string }; + filterOption?: boolean; + getPopupContainer?: (trigger: Node) => Node; + getInputElement?: () => Node; + id?: string; + labelInValue?: boolean; + maxTagCount?: number; + maxTagPlaceholder?: React.ReactNode | Function; + maxTagTextLength?: number; + multiple?: boolean; + notFoundContent?: string; + onBlur?: Function; onChange?: (value: string, label: string) => void; + onDeselect?: Function; + onFocus?: Function; + onInputKeyDown?: Function; + onPopupScroll?: Function; onSearch?: Function; onSelect?: (value: string, ontion: Option) => void; - onDeselect?: Function; - defaultLabel?: string | Array; - defaultActiveFirstOption?: boolean; - getPopupContainer?: (trigger: Node) => Node; + optionFilterProp?: string; + optionLabelProp?: string; + placeholder?: React.ReactNode; + prefixCls?: string; + showAction?: string[]; + showArrow?: boolean; + showSearch?: boolean; + tags?: boolean; + tokenSeparators?: string[]; + transitionName?: string; + value?: string | Array; } export class Select extends React.Component { } interface OptionProps { className?: string; disabled?: boolean; key?: string; + title?: string; value?: string; } export class Option extends React.Component { } From dc9936dd0e7a3765398fb79a0b6d3ab26e584f7c Mon Sep 17 00:00:00 2001 From: Paul Sowden Date: Sun, 5 Aug 2018 18:01:36 -0700 Subject: [PATCH 037/346] Add missing modifier property to Ripple See https://github.com/OnsenUI/OnsenUI/pull/2506 for identical change to upstream API. --- types/react-onsenui/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-onsenui/index.d.ts b/types/react-onsenui/index.d.ts index 91055d25b4..4f1ef5ef44 100644 --- a/types/react-onsenui/index.d.ts +++ b/types/react-onsenui/index.d.ts @@ -281,6 +281,7 @@ export class Ripple extends Component<{ color?: string, background?: string, disabled?: boolean, + modifier?: string, }, any> {} /*** Forms ***/ From 909037546a26fa0e989d111c9db03b92d1a5b34e Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Mon, 6 Aug 2018 09:00:46 -0400 Subject: [PATCH 038/346] Fix linting issues --- types/dialogflow/dialogflow-tests.ts | 12 +- types/dialogflow/index.d.ts | 868 ++++++++++++++------------- types/dialogflow/tsconfig.json | 3 +- 3 files changed, 448 insertions(+), 435 deletions(-) diff --git a/types/dialogflow/dialogflow-tests.ts b/types/dialogflow/dialogflow-tests.ts index aae5fc4ef9..42d905839e 100644 --- a/types/dialogflow/dialogflow-tests.ts +++ b/types/dialogflow/dialogflow-tests.ts @@ -1,10 +1,10 @@ import * as dialogflow from "dialogflow"; -const agentsClient = new dialogflow.AgentsClient() -const contextsClient = new dialogflow.ContextsClient() -const entityTypesClient = new dialogflow.EntityTypesClient() -const intentsClient = new dialogflow.IntentsClient() -const sessionEntityTypesClient = new dialogflow.SessionEntityTypesClient() -const sessionsClient = new dialogflow.SessionsClient() +const agentsClient = new dialogflow.AgentsClient(); +const contextsClient = new dialogflow.ContextsClient(); +const entityTypesClient = new dialogflow.EntityTypesClient(); +const intentsClient = new dialogflow.IntentsClient(); +const sessionEntityTypesClient = new dialogflow.SessionEntityTypesClient(); +const sessionsClient = new dialogflow.SessionsClient(); // TODO: Add real significant tests diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts index 9c8d499a41..96c4b11016 100644 --- a/types/dialogflow/index.d.ts +++ b/types/dialogflow/index.d.ts @@ -2,541 +2,553 @@ // Project: https://github.com/dialogflow/dialogflow-nodejs-client-v2#readme // Definitions by: Daniel Dyla // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 export namespace v2 { class AgentsClient { - constructor(options?: ClientOptions); + constructor(options?: ClientOptions); - servicePath: string; - port: number; - scopes: string[]; + servicePath: string; + port: number; + scopes: string[]; - getProjectId(): Promise; - getProjectId(callback?: (error: Error, id: string) => string): void; + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; - getAgent( - request: GetAgentRequest, - options?: gax.CallOptions, - cb?: (err?: Error, agent?: Agent) => void, - ): Promise<[Agent]>; - searchAgents( - request: SearchAgentRequest, - options?: gax.CallOptions, - cb?: (err?: Error, agents?: Agent[], arg3?: any, response?: any) => void, - ): Promise; - searchAgentsStream( - request: SearchAgentRequest, - options?: gax.CallOptions, - ): NodeJS.ReadableStream; - trainAgent( - request: TrainAgentRequest, - options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void, - ): Promise<[gax.Operation]>; - exportAgent( - request: ExportAgentRequest, - options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void, - ): Promise<[gax.Operation]>; - importAgent( - request: ImportAgentRequest, - options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void, - ): Promise<[gax.Operation]>; - restoreAgent( - request: RestoreAgentRequest, - options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void, - ): Promise<[gax.Operation]>; + getAgent( + request: GetAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, agent?: Agent) => void + ): Promise<[Agent]>; + searchAgents( + request: SearchAgentRequest, + options?: gax.CallOptions, + cb?: ( + err?: Error, + agents?: Agent[], + arg3?: any, + response?: any + ) => void + ): Promise; + searchAgentsStream( + request: SearchAgentRequest, + options?: gax.CallOptions + ): any; + trainAgent( + request: TrainAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void + ): Promise<[gax.Operation]>; + exportAgent( + request: ExportAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void + ): Promise<[gax.Operation]>; + importAgent( + request: ImportAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void + ): Promise<[gax.Operation]>; + restoreAgent( + request: RestoreAgentRequest, + options?: gax.CallOptions, + cb?: (err?: Error, operation?: gax.Operation) => void + ): Promise<[gax.Operation]>; } class ContextsClient { - constructor(options?: ClientOptions); + constructor(options?: ClientOptions); - servicePath: string; - port: number; - scopes: string[]; + servicePath: string; + port: number; + scopes: string[]; - getProjectId(): Promise; - getProjectId(callback?: (error: Error, id: string) => string): void; + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; - listContexts( - request: ListContextsRequest, - options?: gax.CallOptions, - ): Promise<[Context[]]>; - listContextsStream( - request: ListContextsRequest, - options?: gax.CallOptions, - ): NodeJS.ReadableStream; - getContext( - request: GetContextRequest, - options?: gax.CallOptions, - ): Promise<[Context]>; - createContext( - request: CreateContextReqeust, - options?: gax.CallOptions, - ): Promise<[Context]>; - updateContext( - request: UpdateContextRequest, - options?: gax.CallOptions, - ): Promise<[Context]>; - deleteContext( - request: DeleteContextRequest, - options?: gax.CallOptions, - ): Promise; - deleteAllContexts( - request: DeleteAllContextsRequest, - options?: gax.CallOptions, - ): Promise; + listContexts( + request: ListContextsRequest, + options?: gax.CallOptions + ): Promise<[Context[]]>; + listContextsStream( + request: ListContextsRequest, + options?: gax.CallOptions + ): any; + getContext( + request: GetContextRequest, + options?: gax.CallOptions + ): Promise<[Context]>; + createContext( + request: CreateContextReqeust, + options?: gax.CallOptions + ): Promise<[Context]>; + updateContext( + request: UpdateContextRequest, + options?: gax.CallOptions + ): Promise<[Context]>; + deleteContext( + request: DeleteContextRequest, + options?: gax.CallOptions + ): Promise; + deleteAllContexts( + request: DeleteAllContextsRequest, + options?: gax.CallOptions + ): Promise; - sessionPath(project: string, session: string): string; - contextPath(project: string, session: string, context: string): string; + sessionPath(project: string, session: string): string; + contextPath(project: string, session: string, context: string): string; - matchProjectFromContextName(name: string): string; - matchSessionFromContextName(name: string): string; - matchContextFromContextName(name: string): string; + matchProjectFromContextName(name: string): string; + matchSessionFromContextName(name: string): string; + matchContextFromContextName(name: string): string; - matchProjectFromSessionName(name: string): string; - matchSessionFromSessionName(name: string): string; + matchProjectFromSessionName(name: string): string; + matchSessionFromSessionName(name: string): string; } class EntityTypesClient { - constructor(options?: ClientOptions); + constructor(options?: ClientOptions); - servicePath: string; - port: number; - scopes: string[]; + servicePath: string; + port: number; + scopes: string[]; - getProjectId(): Promise; - getProjectId(callback?: (error: Error, id: string) => string): void; + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; - listEntityTypes( - request: ListEntityTypesRequest, - options?: gax.CallOptions, - ): Promise<[EntityType[]]>; + listEntityTypes( + request: ListEntityTypesRequest, + options?: gax.CallOptions + ): Promise<[EntityType[]]>; - listEntityTypesStream( - request: ListEntityTypesRequest, - options?: gax.CallOptions, - ): NodeJS.ReadableStream; + listEntityTypesStream( + request: ListEntityTypesRequest, + options?: gax.CallOptions + ): any; - getEntityType( - request: GetEntityTypeRequest, - options?: gax.CallOptions, - ): Promise<[EntityType]>; - createEntityType( - request: CreateEntityTypeRequest, - options?: gax.CallOptions, - ): Promise<[EntityType]>; - updateEntityType( - request: UpdateEntityTypeRequest, - options?: gax.CallOptions, - ): Promise<[EntityType]>; - deleteEntityType( - request: DeleteEntityTypeRequest, - options?: gax.CallOptions, - ): Promise; + getEntityType( + request: GetEntityTypeRequest, + options?: gax.CallOptions + ): Promise<[EntityType]>; + createEntityType( + request: CreateEntityTypeRequest, + options?: gax.CallOptions + ): Promise<[EntityType]>; + updateEntityType( + request: UpdateEntityTypeRequest, + options?: gax.CallOptions + ): Promise<[EntityType]>; + deleteEntityType( + request: DeleteEntityTypeRequest, + options?: gax.CallOptions + ): Promise; - // TODO: add batch style calls - // batchUpdateEntityTypes - // batchDeleteEntityTypes - // batchCreateEntities - // batchUpdateEntities - // batchDeleteEntities + // TODO: add batch style calls + // batchUpdateEntityTypes + // batchDeleteEntityTypes + // batchCreateEntities + // batchUpdateEntities + // batchDeleteEntities - projectAgentPath(project: string): string; - entityTypePath(project: string, entityType: string): string; - matchProjectFromProjectAgentName(entityTypeName: string): string; - matchProjectFromEntityTypeName(entityTypeName: string): string; - matchEntityTypeFromEntityTypeName(entityTypeName: string): string; + projectAgentPath(project: string): string; + entityTypePath(project: string, entityType: string): string; + matchProjectFromProjectAgentName(entityTypeName: string): string; + matchProjectFromEntityTypeName(entityTypeName: string): string; + matchEntityTypeFromEntityTypeName(entityTypeName: string): string; } class IntentsClient { - constructor(options?: ClientOptions); + constructor(options?: ClientOptions); - servicePath: string; - port: number; - scopes: string[]; + servicePath: string; + port: number; + scopes: string[]; - getProjectId(): Promise; - getProjectId(callback?: (error: Error, id: string) => string): void; + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; - listIntents( - request: ListIntentsRequest, - options?: gax.CallOptions, - ): Promise<[Intent[]]>; - getIntent( - request: GetIntentRequest, - options?: gax.CallOptions, - ): Promise<[Intent]>; - createIntent( - request: CreateIntentRequest, - options?: gax.CallOptions, - ): Promise<[Intent]>; - updateIntent( - request: UpdateIntentRequest, - options?: gax.CallOptions, - ): Promise<[Intent]>; - deleteIntent( - request: DeleteIntentRequest, - options?: gax.CallOptions, - ): Promise; + listIntents( + request: ListIntentsRequest, + options?: gax.CallOptions + ): Promise<[Intent[]]>; + getIntent( + request: GetIntentRequest, + options?: gax.CallOptions + ): Promise<[Intent]>; + createIntent( + request: CreateIntentRequest, + options?: gax.CallOptions + ): Promise<[Intent]>; + updateIntent( + request: UpdateIntentRequest, + options?: gax.CallOptions + ): Promise<[Intent]>; + deleteIntent( + request: DeleteIntentRequest, + options?: gax.CallOptions + ): Promise; - // TODO: add batch style calls - // batchUpdateIntents(request: BatchUpdateIntentsRequest): void; - // batchDeleteIntents(request: BatchDeleteIntentsRequest): void; + // TODO: add batch style calls + // batchUpdateIntents(request: BatchUpdateIntentsRequest): void; + // batchDeleteIntents(request: BatchDeleteIntentsRequest): void; - projectAgentPath(project: string): string; - intentPath(project: string, intent: string): string; - agentPath(project: string, agent: string): string; + projectAgentPath(project: string): string; + intentPath(project: string, intent: string): string; + agentPath(project: string, agent: string): string; - matchProjectFromProjectAgentName(projectAgentName: string): string; - matchProjectFromIntentName(intentName: string): string; - matchIntentFromIntentName(intentName: string): string; - matchProjectFromAgentName(agentName: string): string; - matchAgentFromAgentName(agentName: string): string; + matchProjectFromProjectAgentName(projectAgentName: string): string; + matchProjectFromIntentName(intentName: string): string; + matchIntentFromIntentName(intentName: string): string; + matchProjectFromAgentName(agentName: string): string; + matchAgentFromAgentName(agentName: string): string; } class SessionEntityTypesClient { - constructor(options?: ClientOptions); + constructor(options?: ClientOptions); - servicePath: string; - port: number; - scopes: string[]; + servicePath: string; + port: number; + scopes: string[]; - getProjectId(): Promise; - getProjectId(callback?: (error: Error, id: string) => string): void; + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; - // TODO: add Session Entity Types service methods + // TODO: add Session Entity Types service methods } class SessionsClient { - constructor(options?: ClientOptions); + constructor(options?: ClientOptions); - servicePath: string; - port: number; - scopes: string[]; + servicePath: string; + port: number; + scopes: string[]; - getProjectId(): Promise; - getProjectId(callback?: (error: Error, id: string) => string): void; + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; - detectIntent( - request: DetectIntentRequest, - options?: gax.CallOptions, - ): Promise; - streamingDetectIntent(options?: gax.CallOptions): Promise; + detectIntent( + request: DetectIntentRequest, + options?: gax.CallOptions + ): Promise; + streamingDetectIntent(options?: gax.CallOptions): Promise; - sessionPath(projectId: string, sessionId: string): string; + sessionPath(projectId: string, sessionId: string): string; } - } +} - export namespace v2beta1 { +export namespace v2beta1 { class AgentsClient extends v2.AgentsClient {} class ContextsClient extends v2.ContextsClient { - environmentSessionPath( - project: string, - environment: string, - user: string, - session: string, - ): string; + environmentSessionPath( + project: string, + environment: string, + user: string, + session: string + ): string; - environmentContextPath( - project: string, - environment: string, - user: string, - session: string, - context: string, - ): string; + environmentContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ): string; - matchProjectFromEnvironmentSessionName( - environmentSessionName: string, - ): string; - matchEnvironmentFromEnvironmentSessionName( - environmentSessionName: string, - ): string; - matchUserFromEnvironmentSessionName(environmentSessionName: string): string; - matchSessionFromEnvironmentSessionName( - environmentSessionName: string, - ): string; + matchProjectFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchEnvironmentFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchUserFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchSessionFromEnvironmentSessionName( + environmentSessionName: string + ): string; - matchProjectFromEnvironmentContextName( - environmentContextName: string, - ): string; - matchEnvironmentFromEnvironmentContextName( - environmentContextName: string, - ): string; - matchUserFromEnvironmentContextName(environmentContextName: string): string; - matchSessionFromEnvironmentContextName( - environmentContextName: string, - ): string; - matchContextFromEnvironmentContextName( - environmentContextName: string, - ): string; + matchProjectFromEnvironmentContextName( + environmentContextName: string + ): string; + matchEnvironmentFromEnvironmentContextName( + environmentContextName: string + ): string; + matchUserFromEnvironmentContextName( + environmentContextName: string + ): string; + matchSessionFromEnvironmentContextName( + environmentContextName: string + ): string; + matchContextFromEnvironmentContextName( + environmentContextName: string + ): string; } class EntityTypesClient extends v2.EntityTypesClient {} class IntentsClient extends v2.IntentsClient {} class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} class SessionsClient extends v2.SessionsClient { - environmentSessionPath( - project: string, - environment: string, - user: string, - session: string, - ): string; + environmentSessionPath( + project: string, + environment: string, + user: string, + session: string + ): string; - matchProjectFromEnvironmentSessionName( - environmentSessionName: string, - ): string; - matchEnvironmentFromEnvironmentSessionName( - environmentSessionName: string, - ): string; - matchUserFromEnvironmentSessionName(environmentSessionName: string): string; - matchSessionFromEnvironmentSessionName( - environmentSessionName: string, - ): string; + matchProjectFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchEnvironmentFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchUserFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchSessionFromEnvironmentSessionName( + environmentSessionName: string + ): string; } - } +} - export class AgentsClient extends v2.AgentsClient {} - export class ContextsClient extends v2.ContextsClient {} - export class EntityTypesClient extends v2.EntityTypesClient {} - export class IntentsClient extends v2.IntentsClient {} - export class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} - export class SessionsClient extends v2.SessionsClient {} +export class AgentsClient extends v2.AgentsClient {} +export class ContextsClient extends v2.ContextsClient {} +export class EntityTypesClient extends v2.EntityTypesClient {} +export class IntentsClient extends v2.IntentsClient {} +export class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} +export class SessionsClient extends v2.SessionsClient {} - export namespace entities { +export namespace entities { namespace DateTimeVariants { - type DateTime = { - date_time: string; - }; + interface DateTime { + date_time: string; + } - type DateTimePeriod = { - startDateTime: DateTime; - endDateTime: DateTime; - }; + interface DateTimePeriod { + startDateTime: DateTime; + endDateTime: DateTime; + } - type DatePeriod = { - startDate: Date; - endDate: Date; - }; - type TimePeriod = { - startTime: string; - endTime: string; - }; + interface DatePeriod { + startDate: Date; + endDate: Date; + } + interface TimePeriod { + startTime: string; + endTime: string; + } } type DateTime = - | string - | DateTimeVariants.DatePeriod - | DateTimeVariants.TimePeriod - | DateTimeVariants.DateTime - | DateTimeVariants.DateTimePeriod; + | string + | DateTimeVariants.DatePeriod + | DateTimeVariants.TimePeriod + | DateTimeVariants.DateTime + | DateTimeVariants.DateTimePeriod; - type Duration = { - unit: string; - amount: number; - }; + interface Duration { + unit: string; + amount: number; + } type Date = string; type Time = string; - } +} - export namespace gax { - export interface BackoffSettings { - initialRetryDelayMillis: number; - retryDelayMultiplier: number; - maxRetryDelayMillis: number; - initialRpcTimeoutMillis: number; - maxRpcTimeoutMillis: number; - totalTimeoutMillis: number; +export namespace gax { + interface BackoffSettings { + initialRetryDelayMillis: number; + retryDelayMultiplier: number; + maxRetryDelayMillis: number; + initialRpcTimeoutMillis: number; + maxRpcTimeoutMillis: number; + totalTimeoutMillis: number; } - export interface RetryOptions { - retryCodes: string[]; - backoffSettings: BackoffSettings; + interface RetryOptions { + retryCodes: string[]; + backoffSettings: BackoffSettings; } - export interface CallOptions { - timeout?: number; - retry?: RetryOptions; - autoPaginate?: boolean; - pageToken?: any; - isBundling?: boolean; - longrunning?: BackoffSettings; - promise?: PromiseConstructor; + interface CallOptions { + timeout?: number; + retry?: RetryOptions; + autoPaginate?: boolean; + pageToken?: any; + isBundling?: boolean; + longrunning?: BackoffSettings; + promise?: PromiseConstructor; } - export interface Operation { - grpcOp: longrunning.Operation; - longrunningDescriptor: any; - backoffSettings: BackoffSettings; - callOptions?: CallOptions; + interface Operation { + grpcOp: longrunning.Operation; + longrunningDescriptor: any; + backoffSettings: BackoffSettings; + callOptions?: CallOptions; } - } +} - export namespace longrunning { - export type Operation = - | UnfinishedOperation - | FailedOperation - | SuccessfulOperation; +export namespace longrunning { + type Operation = + | UnfinishedOperation + | FailedOperation + | SuccessfulOperation; - export interface BaseOperation { - name: string; - metadata: any; - done: boolean; + interface BaseOperation { + name: string; + metadata: any; + done: boolean; } - export interface UnfinishedOperation extends BaseOperation { - done: false; + interface UnfinishedOperation extends BaseOperation { + done: false; } - export interface FailedOperation extends BaseOperation { - done: true; - error: Status; + interface FailedOperation extends BaseOperation { + done: true; + error: Status; } - export interface SuccessfulOperation extends BaseOperation { - done: true; - response: any; + interface SuccessfulOperation extends BaseOperation { + done: true; + response: any; } - export interface Status { - code: number; - message: string; - details: any[]; + interface Status { + code: number; + message: string; + details: any[]; } - } +} - export interface GetAgentRequest { +export interface GetAgentRequest { parent: string; - } +} - export interface SearchAgentRequest { +export interface SearchAgentRequest { parent: string; pageSize?: number; - } +} - export interface TrainAgentRequest { +export interface TrainAgentRequest { parent: string; - } +} - export interface ExportAgentRequest { +export interface ExportAgentRequest { parent: string; agentUri?: string; - } +} - export interface ImportAgentRequest { +export interface ImportAgentRequest { parent: string; agentUri?: string; agentContent?: string; - } +} - export interface RestoreAgentRequest { +export interface RestoreAgentRequest { parent: string; agentUri?: string; agentContent?: string; - } +} - export interface ListContextsRequest { +export interface ListContextsRequest { parent: string; pageSize?: number; - } +} - export interface GetContextRequest { +export interface GetContextRequest { name: string; - } +} - export interface CreateContextReqeust { +export interface CreateContextReqeust { parent: string; context: Context; - } +} - export interface UpdateContextRequest { +export interface UpdateContextRequest { context: Context; updatemask?: any; - } +} - export interface DeleteContextRequest { +export interface DeleteContextRequest { name: string; - } +} - export interface DeleteAllContextsRequest { +export interface DeleteAllContextsRequest { parent: string; - } +} - export interface ListEntityTypesRequest { +export interface ListEntityTypesRequest { parent: string; languageCode?: string; pageSize?: number; - } +} - export interface GetEntityTypeRequest { +export interface GetEntityTypeRequest { name: string; languageCode?: string; - } +} - export interface CreateEntityTypeRequest { +export interface CreateEntityTypeRequest { parent: string; entityType: EntityType; - } +} - export interface UpdateEntityTypeRequest { +export interface UpdateEntityTypeRequest { entityType: EntityType; languageCode?: string; /** @link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto */ updateMask?: any; - } +} - export interface DeleteEntityTypeRequest { +export interface DeleteEntityTypeRequest { name: string; - } +} - export interface ListIntentsRequest { +export interface ListIntentsRequest { parent: string; languageCode?: string; intentView?: IntentView; pageSize?: number; - } +} - export interface GetIntentRequest { +export interface GetIntentRequest { name: string; languageCode?: string; intentView?: IntentView; - } +} - export interface CreateIntentRequest { +export interface CreateIntentRequest { parent: string; intent: Intent; languageCode?: string; intentView?: IntentView; - } +} - export interface UpdateIntentRequest { +export interface UpdateIntentRequest { intent: Intent; languageCode?: string; updateMask?: any; intentView?: IntentView; - } +} - export interface DeleteIntentRequest { +export interface DeleteIntentRequest { name: string; - } +} - export interface DetectIntentRequest { +export interface DetectIntentRequest { session: string; queryInput: QueryInput; queryParams?: QueryParams; - inputAudio?: Buffer; - } + inputAudio?: any; +} - export interface DetectIntentResponse { +export interface DetectIntentResponse { responseId: string; queryResult: QueryResult; webhookStatus: Status; - } +} - export interface QueryResult { +export interface QueryResult { queryText: string; laugnageCode: string; speechRecognitionConfidence: number; @@ -551,15 +563,15 @@ export namespace v2 { intent: Intent; intentDetectionConfidence: number; diagnosticInfo: any; - } +} - export interface Status { +export interface Status { code: StatusCode; message: string; details: any[]; - } +} - export enum StatusCode { +export enum StatusCode { // Not an error; returned on success // // HTTP Mapping: 200 OK @@ -711,10 +723,10 @@ export namespace v2 { // Unrecoverable data loss or corruption. // // HTTP Mapping: 500 Internal Server Error - DATA_LOSS = 15, - } + DATA_LOSS = 15 +} - export interface Agent { +export interface Agent { parent: string; displayName: string; defaultLanguageCode: string; @@ -725,34 +737,34 @@ export namespace v2 { enableLogging?: boolean; matchMode?: MatchMode; classificationThreshold?: number; - } +} - export interface Context { +export interface Context { name: string; lifespanCount?: number; parameters?: any; - } +} - export interface EntityType { +export interface EntityType { name: string; entities: EntitySynonyms[]; displayName: string; kind: EntityKind; autoExpansionMode: EntityAutoExpansionMode; - } +} - export enum MatchMode { +export enum MatchMode { MATCH_MODE_UNSPECIFIED = "MATCH_MODE_UNSPECIFIED", MATCH_MODE_HYBRID = "MATCH_MODE_HYBRID", - MATCH_MODE_ML_ONLY = "MATCH_MODE_ML_ONLY", - } + MATCH_MODE_ML_ONLY = "MATCH_MODE_ML_ONLY" +} - export interface Credentials { +export interface Credentials { clientEmail?: string; privateKey?: string; - } +} - export interface ClientOptions { +export interface ClientOptions { credentials?: Credentials; email?: string; keyFilename?: string; @@ -760,29 +772,29 @@ export namespace v2 { projectId?: string; promise?: PromiseConstructor; servicePath?: string; - } +} - export interface EntitySynonyms { +export interface EntitySynonyms { synonyms: string[]; value: string; - } +} - export enum EntityKind { +export enum EntityKind { KIND_MAP = "KIND_MAP", - KIND_LIST = "KIND_LIST", - } + KIND_LIST = "KIND_LIST" +} - export enum EntityAutoExpansionMode { +export enum EntityAutoExpansionMode { AUTO_EXPANSION_MODE_DEFAULT = "AUTO_EXPANSION_MODE_DEFAULT", - AUTO_EXPANSION_MODE_UNSPECIFIED = "AUTO_EXPANSION_MODE_UNSPECIFIED", - } + AUTO_EXPANSION_MODE_UNSPECIFIED = "AUTO_EXPANSION_MODE_UNSPECIFIED" +} - export enum IntentView { +export enum IntentView { INTENT_VIEW_UNSPECIFIED = "INTENT_VIEW_UNSPECIFIED", - INTENT_VIEW_FULL = "INTENT_VIEW_FULL", - } + INTENT_VIEW_FULL = "INTENT_VIEW_FULL" +} - export interface Intent { +export interface Intent { name: string; displayName: string; webhookState: string; @@ -801,23 +813,23 @@ export namespace v2 { rootFollowupIntentName: string; parentFollowupIntentName: string; followupIntentInfo?: FollowupIntentInfo[]; - } +} - export interface TrainingPhrase { +export interface TrainingPhrase { name: string; type: string; parts: Part[]; timesAddedCount?: number; - } +} - export interface Part { +export interface Part { text: string; entityType?: string; alias?: string; userDefined?: boolean; - } +} - export interface Parameter { +export interface Parameter { name: string; displayName: string; value?: string; @@ -826,90 +838,90 @@ export namespace v2 { mandatory?: boolean; prompts?: string[]; isList?: boolean; - } +} - export interface FollowupIntentInfo { +export interface FollowupIntentInfo { followupIntentName: string; parentFollowupIntentName: string; - } +} - export interface Message { +export interface Message { platform?: string; text?: Text; card?: Card; payload?: any; - } +} - export interface Text { +export interface Text { text: string[]; - } +} - export interface Card { +export interface Card { title?: string; subtitle?: string; imageUri?: string; buttons?: Button[]; - } +} - export interface Button { +export interface Button { text?: string; postback?: string; - } +} - export interface EventInput { +export interface EventInput { name: string; languageCode: string; parameters?: any; - } +} - export interface TextInput { +export interface TextInput { text: string; languageCode: string; - } +} - export interface QueryInput { +export interface QueryInput { text?: TextInput; event?: EventInput; - } +} - export interface QueryParams { +export interface QueryParams { timeZone?: string; geoLocation?: LatLong; contexts?: Context[]; resetContexts?: boolean; sessionEntityTypes?: SessionEntityType[]; payload?: any; - } +} - export interface LatLong { +export interface LatLong { latitude: number; longitude: number; - } +} - export interface SessionEntityType { +export interface SessionEntityType { name: string; entityOverrideMode: string; entities: Entity[]; - } +} - export interface Entity { +export interface Entity { value: string; synonyms: string[]; - } +} - export interface WebhookRequest { +export interface WebhookRequest { session: string; responseId: string; queryResult: QueryResult; originalDetectIntentRequest?: any; - } +} - export interface WebhookResponse { +export interface WebhookResponse { fulfillmentText?: string; fulfillmentMessages?: Message[]; source?: string; payload?: any; outputContexts?: Context[]; followupEventInput?: EventInput; - } +} diff --git a/types/dialogflow/tsconfig.json b/types/dialogflow/tsconfig.json index 3133bd6dcb..366cf28866 100644 --- a/types/dialogflow/tsconfig.json +++ b/types/dialogflow/tsconfig.json @@ -7,11 +7,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], - "types": ["node", "gax-nodejs"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From dcb8dc5ca2753474166f051ee6b0b407d1979f65 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 6 Aug 2018 10:36:53 -0700 Subject: [PATCH 039/346] polymer-ts: Ensure `PolymerBase#toggleAttribute` matches Element#toggleAttribute --- types/polymer-ts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/polymer-ts/index.d.ts b/types/polymer-ts/index.d.ts index bf7daf936f..7ab10afa47 100644 --- a/types/polymer-ts/index.d.ts +++ b/types/polymer-ts/index.d.ts @@ -58,7 +58,7 @@ declare namespace polymer { setScrollDirection(direction: string, node: HTMLElement): void; shift(path: string, value: any): any; splice(path: string, start: number, deleteCount: number, ...items: any[]): any; - toggleAttribute(name: string, bool: boolean, node?: HTMLElement): void; + toggleAttribute(name: string, force?: boolean, node?: HTMLElement): boolean; toggleClass(name: string, bool: boolean, node?: HTMLElement): void; transform(transform: string, node?: HTMLElement): void; translate3d(x: any, y: any, z: any, node?: HTMLElement): void; From 1fad4c8cbdf5650a33a6391e34ea9386b40ce6eb Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 6 Aug 2018 10:33:44 -0700 Subject: [PATCH 040/346] phonegap: Fix "Notification" conflict with global interface --- types/phonegap/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/phonegap/index.d.ts b/types/phonegap/index.d.ts index 60ad5d2fd9..926140c3f9 100644 --- a/types/phonegap/index.d.ts +++ b/types/phonegap/index.d.ts @@ -526,7 +526,7 @@ declare var Media: { new(src: string, onSuccess: (arg: any) => any, onError: (error: any) => any): Media; } -interface Notification { +interface PhonegapNotification { alert(message: string, alertCallback: Function, title?: string, buttonName?: string): void; confirm(message: string, confirmCallback: Function, title?: string, buttonLabels?: string): void; confirm(message: string, confirmCallback: Function, title?: string, buttonLabels?: string[]): void; @@ -614,7 +614,7 @@ interface /*PhoneGapNavigator extends*/ Navigator { contacts: Contacts; device: Device; globalization: Globalization; - notification: Notification; + notification: PhonegapNotification; splashscreen: Splashscreen; } From 965956065f09d11e8b8ccf5cdbb4899c56fbd32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Mon, 6 Aug 2018 17:41:20 +0100 Subject: [PATCH 041/346] [react-navigation] Fix return type when fallback provided --- types/react-navigation/index.d.ts | 4 +++- types/react-navigation/react-navigation-tests.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 2573315c09..1713cd7eee 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -19,6 +19,7 @@ // Jérémy Magrin // Luca Campana // Ullrich Schaefer +// Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -585,7 +586,8 @@ export interface NavigationScreenProp { openDrawer: () => any; closeDrawer: () => any; toggleDrawer: () => any; - getParam: (param: T, fallback?: P[T]) => P[T]; + getParam(param: T, fallback: NonNullable): NonNullable; + getParam(param: T): P[T]; setParams: (newParams: Partial

) => boolean; addListener: ( eventName: 'willBlur' | 'willFocus' | 'didFocus' | 'didBlur', diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 78e71fb746..1c7f7420d0 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -496,6 +496,7 @@ const CustomHeaderStack = createStackNavigator({ interface ScreenProps { name: string; + optionalAge?: number; onPlay(): void; } @@ -512,9 +513,16 @@ class SetParamsTest extends React.Component> render() { const name = this.props.navigation.getParam('name'); + const age = this.props.navigation.getParam('optionalAge'); + + // $ExpectType number | undefined + this.props.navigation.getParam('optionalAge'); + + // $ExpectType number + this.props.navigation.getParam('optionalAge', 0); return ( - My name is {name} + My name is {name} and I am {age} years old. ); } } From ebb16b2d2dc68178d68e33b341044646f62dfc6c Mon Sep 17 00:00:00 2001 From: Frank Li Date: Mon, 6 Aug 2018 15:13:23 -0700 Subject: [PATCH 042/346] Pass any as the state type to ComponentClass Pass any as the state type to ComponentClass from ComponentType. --- types/react/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 2c7110237c..1a63b221bf 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -18,6 +18,7 @@ // Johann Rakotoharisoa // Olivier Pascal // Martin Hochel +// Frank Li // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -49,7 +50,7 @@ declare namespace React { // ---------------------------------------------------------------------- type ReactType

= string | ComponentType

; - type ComponentType

= ComponentClass

| StatelessComponent

; + type ComponentType

= ComponentClass | StatelessComponent

; type Key = string | number; From 21cfc7d247a9b2fd534d82342bd7598c6a83e993 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Mon, 6 Aug 2018 15:36:22 -0700 Subject: [PATCH 043/346] Update index.d.ts --- types/react/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 1a63b221bf..40198d1a16 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -50,7 +50,7 @@ declare namespace React { // ---------------------------------------------------------------------- type ReactType

= string | ComponentType

; - type ComponentType

= ComponentClass | StatelessComponent

; + type ComponentType

= ComponentClass

| StatelessComponent

; type Key = string | number; @@ -356,7 +356,7 @@ declare namespace React { displayName?: string; } - interface ComponentClass

extends StaticLifecycle { + interface ComponentClass

extends StaticLifecycle { new (props: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; From 29b6ccff019e7652a060defe1c2bd3377af1a98e Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Tue, 7 Aug 2018 13:34:22 +1000 Subject: [PATCH 044/346] react sortable tree missing prop --- types/react-sortable-tree/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 0415db0414..3d0a7aa196 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -70,6 +70,12 @@ export interface OnDragPreviousAndNextLocation extends PreviousAndNextLocation { nextParent: TreeItem | null; } +export interface ShouldCopyData { + node: TreeItem, + prevPath: NumberArrayOrStringArray, + prevTreeIndex: number +} + export interface OnMovePreviousAndNextLocation extends PreviousAndNextLocation { nextParentNode: TreeItem | null; } @@ -186,6 +192,7 @@ export interface ReactSortableTreeProps { dndType?: string; placeholderRenderer?: PlaceholderRenderer; theme?: ThemeProps; + shouldCopyOnOutsideDrop?: boolean | ((data: ShouldCopyData) => boolean); } declare const SortableTree: React.ComponentClass; From f0d9be2343c4b9e499b9f618f6693cfcabdf4d0e Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Tue, 7 Aug 2018 13:36:39 +1000 Subject: [PATCH 045/346] Added myself! --- types/react-sortable-tree/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 3d0a7aa196..765cecf6c4 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Wouter Hardeman // Jovica Zoric // Kevin Perrine +// Alex Maclean // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 From b9cffcee563009ba1cad2fcf8e94432fc65b6abd Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Tue, 7 Aug 2018 14:27:33 +1000 Subject: [PATCH 046/346] semicolons? --- types/react-sortable-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 765cecf6c4..e4678b399c 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -72,9 +72,9 @@ export interface OnDragPreviousAndNextLocation extends PreviousAndNextLocation { } export interface ShouldCopyData { - node: TreeItem, - prevPath: NumberArrayOrStringArray, - prevTreeIndex: number + node: TreeItem; + prevPath: NumberArrayOrStringArray; + prevTreeIndex: number; } export interface OnMovePreviousAndNextLocation extends PreviousAndNextLocation { From 4d292f7efdbd9ed8625bb52fd2117456fa0162b5 Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Tue, 7 Aug 2018 14:50:36 +1000 Subject: [PATCH 047/346] Fixed type --- types/react-sortable-tree/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index e4678b399c..257e3aedf9 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -72,7 +72,7 @@ export interface OnDragPreviousAndNextLocation extends PreviousAndNextLocation { } export interface ShouldCopyData { - node: TreeItem; + node: TreeNode; prevPath: NumberArrayOrStringArray; prevTreeIndex: number; } From 9a2ef63a1e5fe4c1c7d3b75ea098402b88bc4977 Mon Sep 17 00:00:00 2001 From: Tyrone Dougherty Date: Tue, 7 Aug 2018 15:24:16 +1000 Subject: [PATCH 048/346] @types/highcharts - Add animation boolean parameter to the Chart#update method --- types/highcharts/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index f24004fadb..afe1e51a98 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -6487,9 +6487,10 @@ declare namespace Highcharts { * @param [boolean] redraw Whether to redraw the chart. Defaults to true. * @param [boolean] oneToOne When true, the series, xAxis and yAxis collections will be updated one to one, and * items will be either added or removed to match the new updated options. Defaults to false. + * @param [boolean] animation Whether to apply animation, and optionally animation configuration. * @since 5.0.0 */ - update(options: Options, redraw?: boolean, oneToOne?: boolean): void; + update(options: Options, redraw?: boolean, oneToOne?: boolean, animation?: boolean): void; /** * This method is deprecated as of 2.0.1. Updating the chart position after a move operation is no longer necessary. * @since 1.2.5 From 60506f9f3359c570891bfcc5c7d4419280826629 Mon Sep 17 00:00:00 2001 From: denis Date: Tue, 7 Aug 2018 10:27:40 +0200 Subject: [PATCH 049/346] `document.body` is not 'null' anymore in TypeScript@next --- types/d3kit/d3kit-tests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/d3kit/d3kit-tests.ts b/types/d3kit/d3kit-tests.ts index e8f66c71f2..ec3b2de1ce 100644 --- a/types/d3kit/d3kit-tests.ts +++ b/types/d3kit/d3kit-tests.ts @@ -64,7 +64,7 @@ function test_abstract_plate() { let sel: d3.Selection; // create a div, append to body, return Node as type Element - el = document.body!.appendChild(document.createElement('div')) as Element; + el = document.body.appendChild(document.createElement('div')) as Element; // create example of options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -193,7 +193,7 @@ function test_abstract_chart() { let plate: d3kit.AbstractPlate; // create a div, append to body, return Node as type Element - el = document.body!.appendChild(document.createElement('div')) as Element; + el = document.body.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -285,7 +285,7 @@ function test_svg_chart() { let plate: d3kit.SvgPlate; // create a div, append to body, return Node as type Element - el = document.body!.appendChild(document.createElement('div')) as Element; + el = document.body.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -326,7 +326,7 @@ function test_canvas_chart() { let context: CanvasRenderingContext2D; // create a div, append to body, return Node as type Element - el = document.body!.appendChild(document.createElement('div')) as Element; + el = document.body.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; @@ -362,7 +362,7 @@ function test_hybrid_chart() { let context: CanvasRenderingContext2D; // create a div, append to body, return Node as type Element - el = document.body!.appendChild(document.createElement('div')) as Element; + el = document.body.appendChild(document.createElement('div')) as Element; // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; From f3f66431049fbed21e647bde04ee9fb45111b768 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Tue, 7 Aug 2018 18:43:34 +0800 Subject: [PATCH 050/346] add maxPayload property to clientOptions in @types/ws --- types/ws/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ws/index.d.ts b/types/ws/index.d.ts index 3667941753..1231d5af97 100644 --- a/types/ws/index.d.ts +++ b/types/ws/index.d.ts @@ -141,6 +141,7 @@ declare namespace WebSocket { key?: CertMeta; pfx?: string | Buffer; ca?: CertMeta; + maxPayload?: number; } interface PerMessageDeflateOptions { From 8dc60fa7a71aa438d72a78fae8d153642d098de9 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Tue, 7 Aug 2018 18:50:35 +0800 Subject: [PATCH 051/346] add test for maxPayload in @types/ws --- types/ws/ws-tests.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/ws/ws-tests.ts b/types/ws/ws-tests.ts index 51d37bea9c..1b30da48ed 100644 --- a/types/ws/ws-tests.ts +++ b/types/ws/ws-tests.ts @@ -92,3 +92,10 @@ import * as https from 'https'; } }); } + +{ + const ws = new WebSocket('ws://www.host.com/path', { + maxPayload: 10 * 1024 * 1024 + }); + ws.on('open', () => ws.send('something assume to be really long')); +} From ca6cf73a8effbc0b0d731442d86b71ddaaaf99d7 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Tue, 7 Aug 2018 19:41:38 +0800 Subject: [PATCH 052/346] add more typings between 5.1 and 6.0 --- types/ws/index.d.ts | 17 +++++++++++++---- types/ws/ws-tests.ts | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/types/ws/index.d.ts b/types/ws/index.d.ts index 1231d5af97..b99f9e4d88 100644 --- a/types/ws/index.d.ts +++ b/types/ws/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ws 5.1 +// Type definitions for ws 6.0 // Project: https://github.com/websockets/ws // Definitions by: Paul Loyd // Matt Silverlock @@ -120,7 +120,7 @@ declare namespace WebSocket { * whether or not to accept the handshake. */ type VerifyClientCallbackAsync = (info: { origin: string; secure: boolean; req: http.IncomingMessage } - , callback: (res: boolean, code?: number, message?: string) => void) => void; + , callback: (res: boolean, code?: number, message?: string, headers?: http.OutgoingHttpHeaders) => void) => void; interface ClientOptions { protocol?: string; @@ -149,8 +149,17 @@ declare namespace WebSocket { clientNoContextTakeover?: boolean; serverMaxWindowBits?: number; clientMaxWindowBits?: number; - level?: number; - memLevel?: number; + zlibDeflateOptions?: { + flush?: number; + finishFlush?: number; + chunkSize?: number; + windowBits?: number; + level?: number; + memLevel?: number; + strategy?: number; + dictionary?: Buffer | Buffer[] | DataView; + info?: boolean; + }; threshold?: number; concurrencyLimit?: number; } diff --git a/types/ws/ws-tests.ts b/types/ws/ws-tests.ts index 1b30da48ed..bc62d9de98 100644 --- a/types/ws/ws-tests.ts +++ b/types/ws/ws-tests.ts @@ -88,7 +88,20 @@ import * as https from 'https'; clientNoContextTakeover: true, serverMaxWindowBits: 0, clientMaxWindowBits: 0, - memLevel: 0 + zlibDeflateOptions: { + flush: 0, + finishFlush: 0, + chunkSize: 0, + windowBits: 0, + level: 0, + memLevel: 0, + strategy: 0, + dictionary: new Buffer('test'), + info: false + } + }, + verifyClient: (info: any, cb: any) => { + cb(true, 123, 'message', { Upgrade: "websocket" }); } }); } From 0453260aef435a6b27221a2981f458ab5a52f291 Mon Sep 17 00:00:00 2001 From: Fabio Berta Date: Tue, 7 Aug 2018 15:05:30 +0200 Subject: [PATCH 053/346] add missing class properties --- types/viewport-mercator-project/index.d.ts | 58 +++++++++++++------ .../viewport-mercator-project-tests.ts | 2 + 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/types/viewport-mercator-project/index.d.ts b/types/viewport-mercator-project/index.d.ts index 4d93d755bd..1dd897229d 100644 --- a/types/viewport-mercator-project/index.d.ts +++ b/types/viewport-mercator-project/index.d.ts @@ -16,20 +16,26 @@ export type Coordinates = [number, number]; export type CoordinatesZ = [number, number, number]; +export type ViewMatrix = number[]; + +export type ProjectionMatrix = number[]; + export interface ViewportOptions { - width?: number; - height?: number; - longitude?: number; - latitude?: number; - zoom?: number; - pitch?: number; - bearing?: number; - altitude?: number; - farZMultiplier?: number; + width: number; + height: number; + viewMatrix?: ViewMatrix; + projectionMatrix?: ProjectionMatrix; } export class Viewport { + width: number; + height: number; + scale: number; + viewMatrix: ViewMatrix; + projectionMatrix: ProjectionMatrix; + constructor(opts?: ViewportOptions); + equals(viewport: Viewport): boolean; project(lngLat: Coordinates, opts?: ProjectOptions): Coordinates; project(lngLatZ: CoordinatesZ, opts?: ProjectOptions): CoordinatesZ; @@ -41,7 +47,32 @@ export type Padding = number | { top: number; right: number; bottom: number; lef export type Bounds = [Coordinates, Coordinates]; +export interface WebMercatorViewportOptions { + width?: number; + height?: number; + longitude?: number; + latitude?: number; + zoom?: number; + pitch?: number; + bearing?: number; + altitude?: number; + farZMultiplier?: number; +} + +// Type comes from https://github.com/uber-web/math.gl +export class Vector3 extends Array {} + export class WebMercatorViewport extends Viewport { + latitude: number; + longitude: number; + zoom: number; + pitch: number; + bearing: number; + altitude: number; + center: Vector3; + + constructor(opts?: WebMercatorViewportOptions); + projectFlat(lngLat: Coordinates, scale?: number): Coordinates; unprojectFlat(xy: Coordinates, scale?: number): Coordinates; getMapCenterByLngLatPosition(opts: { lngLat: Coordinates; pos: Coordinates }): Coordinates; @@ -78,14 +109,12 @@ export interface NormalizedViewportProps extends BaseViewportProps { export function normalizeViewportProps(props: ViewportProps): NormalizedViewportProps; -export function flyToViewport(startProps: BaseViewportProps, endProps: BaseViewportProps): BaseViewportProps; +export function flyToViewport(startProps: BaseViewportProps, endProps: BaseViewportProps, t: number): BaseViewportProps; export function lngLatToWorld(lngLat: Coordinates, scale: number): Coordinates; export function worldToLngLat(point: Coordinates, scale: number): Coordinates; -export type ProjectionMatrix = number[]; - export function worldToPixels(coordinates: Coordinates | CoordinatesZ, pixelProjectionMatrix: ProjectionMatrix): CoordinatesZ; export function pixelsToWorld(pixels: Coordinates | CoordinatesZ, pixelUnprojectionMatrix: ProjectionMatrix, targetZ?: number): CoordinatesZ; @@ -121,13 +150,8 @@ export function getDistanceScales(input: DistanceScalesInput): DistanceScales; export function getDistanceScales(input: HighPrecisionDistanceScalesInput): HighPrecisionDistanceScales; -// Type comes from https://github.com/uber-web/math.gl -export class Vector3 extends Array {} - export function getWorldPosition(input: { longitude: number; latitude: number; zoom: number; scale: number; meterOffset?: number; distanceScales?: DistanceScales }): Vector3; -export type ViewMatrix = number[]; - export function getViewMatrix(input: { height: number; pitch: number; bearing: number; altitude: number; center?: CoordinatesZ; flipY?: boolean }): ViewMatrix; export interface ProjectionParametersInput { diff --git a/types/viewport-mercator-project/viewport-mercator-project-tests.ts b/types/viewport-mercator-project/viewport-mercator-project-tests.ts index 5f2cc346b3..26fc54d466 100644 --- a/types/viewport-mercator-project/viewport-mercator-project-tests.ts +++ b/types/viewport-mercator-project/viewport-mercator-project-tests.ts @@ -6,6 +6,8 @@ import WebMercatorViewport, { const mercator = new WebMercatorViewport(); +const { width, height, scale, latitude, longitude, altitude, zoom, pitch, bearing, center, viewMatrix, projectionMatrix } = mercator; + const xy = mercator.project([0, 1]); const xyz = mercator.project([0, 1, 2]); From 29c908d7ad5fbbe1a5d0d807b2a86364a7977c94 Mon Sep 17 00:00:00 2001 From: Fabio Berta Date: Tue, 7 Aug 2018 15:08:43 +0200 Subject: [PATCH 054/346] width and height are optional --- types/viewport-mercator-project/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/viewport-mercator-project/index.d.ts b/types/viewport-mercator-project/index.d.ts index 1dd897229d..15b9fc373a 100644 --- a/types/viewport-mercator-project/index.d.ts +++ b/types/viewport-mercator-project/index.d.ts @@ -21,8 +21,8 @@ export type ViewMatrix = number[]; export type ProjectionMatrix = number[]; export interface ViewportOptions { - width: number; - height: number; + width?: number; + height?: number; viewMatrix?: ViewMatrix; projectionMatrix?: ProjectionMatrix; } From 98aaf81b5fdf6a2f7b3f1d719332740217f08381 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Tue, 7 Aug 2018 15:06:35 +0100 Subject: [PATCH 055/346] [page] add `decodeURLComponents` option --- types/page/index.d.ts | 18 ++++++++++++------ types/page/page-tests.ts | 12 +++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/types/page/index.d.ts b/types/page/index.d.ts index 0f9317c6a4..ef56afdc9b 100644 --- a/types/page/index.d.ts +++ b/types/page/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for page v1.5.0 // Project: http://visionmedia.github.io/page.js/ // Definitions by: Alan Norbauer +// James Garbutt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 declare namespace PageJS { interface Static { @@ -64,7 +66,7 @@ declare namespace PageJS { * * If you wish to load serve initial content from the server you likely will want to set dispatch to false. */ - (options: Options): void; + (options: Partial): void; /** * Register page's popstate / click bindings. If you're doing selective binding you'll like want to pass { click: false } to specify this yourself. The following options are available: * @@ -125,7 +127,7 @@ declare namespace PageJS { * * Identical to page([options]). */ - start(options: Options): void; + start(options: Partial): void; /** * Register page's popstate / click bindings. If you're doing selective binding you'll like want to pass { click: false } to specify this yourself. The following options are available: * @@ -205,19 +207,23 @@ declare namespace PageJS { /** * bind to click events (default = true) */ - click?: boolean; + click: boolean; /** * bind to popstate (default = true) */ - popstate?: boolean; + popstate: boolean; /** * perform initial dispatch (default = true) */ - dispatch?: boolean; + dispatch: boolean; /** * add #!before urls (default = false) */ - hashbang?: boolean; + hashbang: boolean; + /** + * remove URL encoding frfrom path components + */ + decodeURLComponents: boolean; } interface Callback { diff --git a/types/page/page-tests.ts b/types/page/page-tests.ts index 9d78998672..5d5b421d7e 100644 --- a/types/page/page-tests.ts +++ b/types/page/page-tests.ts @@ -13,6 +13,16 @@ page('/contact', contact); page('/contact/:contactName', contact); page('/contact/inline/:contactName', ctx => { }); page(); +page({ + click: false, + popstate: true, + dispatch: false, + hashbang: true, + decodeURLComponents: false +}); +page({ + hashbang: true +}); var index: PageJS.Callback = function() { document.querySelector('p') @@ -82,4 +92,4 @@ var show: PageJS.Callback = function (ctx) { function notfound() { document.querySelector('p') .textContent = 'not found'; -} \ No newline at end of file +} From eb256ce0e8b2d325f5770e0d304b32d22e0d11bb Mon Sep 17 00:00:00 2001 From: Thomas den Hollander Date: Tue, 7 Aug 2018 16:38:15 +0200 Subject: [PATCH 056/346] google-cloud__storage: Add examples to tests --- .../google-cloud__storage-tests.ts | 331 +++++++++++++++++- types/google-cloud__storage/index.d.ts | 36 +- 2 files changed, 348 insertions(+), 19 deletions(-) diff --git a/types/google-cloud__storage/google-cloud__storage-tests.ts b/types/google-cloud__storage/google-cloud__storage-tests.ts index cd0bcaaab2..1db3e73284 100644 --- a/types/google-cloud__storage/google-cloud__storage-tests.ts +++ b/types/google-cloud__storage/google-cloud__storage-tests.ts @@ -26,7 +26,7 @@ import { WriteStreamOptions, UploadOptions } from "@google-cloud/storage"; -import CloudStorage = require("@google-cloud/storage"); +import Storage = require("@google-cloud/storage"); /** * Test the storage service. @@ -38,7 +38,7 @@ export class TestStorage { }; // import Storage class - static gcs = CloudStorage(); + static gcs = new Storage(); constructor() { // nothing to do @@ -263,3 +263,330 @@ testStorage.iam.setPolicy({ testStorage.iam.testPermissions('storage.buckets.delete'); testStorage.iam.testPermissions(['storage.buckets.delete', 'storage.buckets.get']); + +// Example from https://cloud.google.com/storage/docs/creating-buckets#storage-create-bucket-code_samples +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + + // Creates a new bucket + storage + .createBucket(bucketName, { + location: 'ASIA', + storageClass: 'COLDLINE', + }) + .then(() => { + console.log(`Bucket ${bucketName} created.`); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/listing-buckets#storage-list-buckets-nodejs +{ + // Creates a client + const storage = new Storage(); + + // Lists all buckets in the current project + storage + .getBuckets() + .then(results => { + const buckets = results[0]; + + console.log('Buckets:'); + buckets.forEach(bucket => { + console.log(bucket.name); + }); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/moving-buckets#storage-create-bucket-nodejs +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + + // Creates a new bucket + storage + .createBucket(bucketName, { + location: 'ASIA', + storageClass: 'COLDLINE', + }) + .then(() => { + console.log(`Bucket ${bucketName} created.`); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/deleting-buckets +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + + // Deletes the bucket + storage + .bucket(bucketName) + .delete() + .then(() => { + console.log(`Bucket ${bucketName} deleted.`); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/uploading-objects +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + const filename = 'Local file to upload, e.g. ./local/path/to/file.txt'; + + // Uploads a local file to the bucket + storage + .bucket(bucketName) + .upload(filename, { + // Support for HTTP requests made with `Accept-Encoding: gzip` + gzip: true, + metadata: { + // Enable long-lived HTTP caching headers + // Use only if the contents of the file will never change + // (If the contents will change, use cacheControl: 'no-cache') + cacheControl: 'public, max-age=31536000', + }, + }) + .then(() => { + console.log(`${filename} uploaded to ${bucketName}.`); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/listing-objects +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + + // Lists files in the bucket + storage + .bucket(bucketName) + .getFiles() + .then(results => { + const files = results[0]; + + console.log('Files:'); + files.forEach(file => { + console.log(file.name); + }); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/listing-objects +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + const prefix = 'Prefix by which to filter, e.g. public/'; + const delimiter = 'Delimiter to use, e.g. /'; + + /** + * This can be used to list all blobs in a "folder", e.g. "public/". + * + * The delimiter argument can be used to restrict the results to only the + * "files" in the given "folder". Without the delimiter, the entire tree under + * the prefix is returned. For example, given these blobs: + * + * /a/1.txt + * /a/b/2.txt + * + * If you just specify prefix = '/a', you'll get back: + * + * /a/1.txt + * /a/b/2.txt + * + * However, if you specify prefix='/a' and delimiter='/', you'll get back: + * + * /a/1.txt + */ + const options = { + prefix, + delimiter + }; + + // Lists files in the bucket, filtered by a prefix + storage + .bucket(bucketName) + .getFiles(options) + .then(results => { + const files = results[0]; + + console.log('Files:'); + files.forEach(file => { + console.log(file.name); + }); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/downloading-objects#storage-download-object-nodejs +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + const srcFilename = 'Remote file to download, e.g. file.txt'; + const destFilename = 'Local destination for file, e.g. ./local/path/to/file.txt'; + + const options = { + // The path to which the file should be downloaded, e.g. "./file.txt" + destination: destFilename, + }; + + // Downloads the file + storage + .bucket(bucketName) + .file(srcFilename) + .download(options) + .then(() => { + console.log( + `gs://${bucketName}/${srcFilename} downloaded to ${destFilename}.` + ); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/renaming-copying-moving-objects +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + const srcFilename = 'File to move, e.g. file.txt'; + const destFilename = 'Destination for file, e.g. moved.txt'; + + // Moves the file within the bucket + storage + .bucket(bucketName) + .file(srcFilename) + .move(destFilename) + .then(() => { + console.log( + `gs://${bucketName}/${srcFilename} moved to gs://${bucketName}/${destFilename}.` + ); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/renaming-copying-moving-objects +{ + // Creates a client + const storage = new Storage(); + + const srcBucketName = 'Name of the source bucket, e.g. my-bucket'; + const srcFilename = 'Name of the source file, e.g. file.txt'; + const destBucketName = 'Name of the destination bucket, e.g. my-other-bucket'; + const destFilename = 'Destination name of file, e.g. file.txt'; + + // Copies the file to the other bucket + storage + .bucket(srcBucketName) + .file(srcFilename) + .copy(storage.bucket(destBucketName).file(destFilename)) + .then(() => { + console.log( + `gs://${srcBucketName}/${srcFilename} copied to gs://${destBucketName}/${destFilename}.` + ); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/viewing-editing-metadata +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + const filename = 'File to access, e.g. file.txt'; + + // Gets the metadata for the file + storage + .bucket(bucketName) + .file(filename) + .getMetadata() + .then(results => { + const metadata = results[0]; + + console.log(`File: ${metadata.name}`); + console.log(`Bucket: ${metadata.bucket}`); + console.log(`Storage class: ${metadata.storageClass}`); + console.log(`Self link: ${metadata.selfLink}`); + console.log(`ID: ${metadata.id}`); + console.log(`Size: ${metadata.size}`); + console.log(`Updated: ${metadata.updated}`); + console.log(`Generation: ${metadata.generation}`); + console.log(`Metageneration: ${metadata.metageneration}`); + console.log(`Etag: ${metadata.etag}`); + console.log(`Owner: ${metadata.owner}`); + console.log(`Component count: ${metadata.component_count}`); + console.log(`Crc32c: ${metadata.crc32c}`); + console.log(`md5Hash: ${metadata.md5Hash}`); + console.log(`Cache-control: ${metadata.cacheControl}`); + console.log(`Content-type: ${metadata.contentType}`); + console.log(`Content-disposition: ${metadata.contentDisposition}`); + console.log(`Content-encoding: ${metadata.contentEncoding}`); + console.log(`Content-language: ${metadata.contentLanguage}`); + console.log(`Metadata: ${metadata.metadata}`); + console.log(`Media link: ${metadata.mediaLink}`); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} + +// Example from https://cloud.google.com/storage/docs/deleting-objects +{ + // Creates a client + const storage = new Storage(); + + const bucketName = 'Name of a bucket, e.g. my-bucket'; + const filename = 'File to delete, e.g. file.txt'; + + // Deletes the file from the bucket + storage + .bucket(bucketName) + .file(filename) + .delete() + .then(() => { + console.log(`gs://${bucketName}/${filename} deleted.`); + }) + .catch(err => { + console.error('ERROR:', err); + }); +} diff --git a/types/google-cloud__storage/index.d.ts b/types/google-cloud__storage/index.d.ts index 8d7cf6c45d..18ac093c5d 100644 --- a/types/google-cloud__storage/index.d.ts +++ b/types/google-cloud__storage/index.d.ts @@ -55,6 +55,8 @@ declare namespace Storage { versioning?: { enabled?: boolean }; + // Note: This is not documented, but it is used in examples (https://cloud.google.com/nodejs/docs/reference/storage/1.7.x/Storage) + storageClass?: 'COLDLINE' | 'DURABLE_REDUCED_AVAILABILITY' | 'MULTI_REGIONAL' | 'NEARLINE' | 'REGIONAL'; } /** @@ -202,6 +204,8 @@ declare namespace Storage { bucket?: string; cacheControl?: string; componentCount?: number; + // Note: this property is accessed in one of the examples + component_count?: number; contentDisposition?: string; contentEncoding?: string; contentLanguage?: string; @@ -407,22 +411,6 @@ declare namespace Storage { validation?: string | boolean; } - /** - * The Storage class allows you interact with Google Cloud Storage. - */ - class Storage { - constructor(config?: ConfigurationObject); - acl: Acl; - bucket(name: string | Bucket): Bucket; - channel(id: string, resourceId: string): Channel; - createBucket(name: string, metadata?: BucketConfig): Promise<[Bucket, ApiResponse]>; - getBuckets(query?: BucketQuery): Promise<[Bucket[]]>; - getBucketsStream(query?: BucketQuery): Promise<[ReadStream]>; - Channel: (storage: Storage, id: string, resourceId: string) => Channel; - File: (bucket: Bucket, name: string, opts: BucketFileOptions) => File; - Bucket: (storage: Storage, name: string) => Bucket; - } - /** * This class allows you interact with Google Cloud Storage. */ @@ -460,6 +448,20 @@ declare namespace Storage { } } -declare function Storage(config?: Storage.ConfigurationObject): Storage.Storage; +/** + * The Storage class allows you interact with Google Cloud Storage. + */ +declare class Storage { + constructor(config?: Storage.ConfigurationObject); + acl: Storage.Acl; + bucket(name: string | Storage.Bucket): Storage.Bucket; + channel(id: string, resourceId: string): Storage.Channel; + createBucket(name: string, metadata?: Storage.BucketConfig): Promise<[Storage.Bucket, Storage.ApiResponse]>; + getBuckets(query?: Storage.BucketQuery): Promise<[Storage.Bucket[]]>; + getBucketsStream(query?: Storage.BucketQuery): Promise<[ReadStream]>; + Channel: (storage: Storage, id: string, resourceId: string) => Storage.Channel; + File: (bucket: Storage.Bucket, name: string, opts: Storage.BucketFileOptions) => Storage.File; + Bucket: (storage: Storage, name: string) => Storage.Bucket; +} export = Storage; From 496621c80d1dea2ba5671edfde3397cb42f9a0fa Mon Sep 17 00:00:00 2001 From: Shalom Peles Date: Tue, 7 Aug 2018 19:10:51 +0300 Subject: [PATCH 057/346] add types for intrinsic-scale --- types/intrinsic-scale/index.d.ts | 15 ++++++++++++ .../intrinsic-scale/intrinsic-scale-tests.ts | 4 ++++ types/intrinsic-scale/tsconfig.json | 23 +++++++++++++++++++ types/intrinsic-scale/tslint.json | 1 + 4 files changed, 43 insertions(+) create mode 100644 types/intrinsic-scale/index.d.ts create mode 100644 types/intrinsic-scale/intrinsic-scale-tests.ts create mode 100644 types/intrinsic-scale/tsconfig.json create mode 100644 types/intrinsic-scale/tslint.json diff --git a/types/intrinsic-scale/index.d.ts b/types/intrinsic-scale/index.d.ts new file mode 100644 index 0000000000..7d61d2135e --- /dev/null +++ b/types/intrinsic-scale/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for intrinsic-scale 3.0 +// Project: https://github.com/bfred-it/intrinsic-scale#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +export function contain(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; +export function cover(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; + +export interface IntrinsicScale { + width: number, + height: number, + x: number, + y: number +} diff --git a/types/intrinsic-scale/intrinsic-scale-tests.ts b/types/intrinsic-scale/intrinsic-scale-tests.ts new file mode 100644 index 0000000000..714620478d --- /dev/null +++ b/types/intrinsic-scale/intrinsic-scale-tests.ts @@ -0,0 +1,4 @@ +import { cover, contain } from "."; + +const intrinsicScale = cover(100, 100, 50, 50); +const { x, y, width, height } = contain(1,2,3,4); diff --git a/types/intrinsic-scale/tsconfig.json b/types/intrinsic-scale/tsconfig.json new file mode 100644 index 0000000000..8fcff6913d --- /dev/null +++ b/types/intrinsic-scale/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", + "intrinsic-scale-tests.ts" + ] +} \ No newline at end of file diff --git a/types/intrinsic-scale/tslint.json b/types/intrinsic-scale/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/intrinsic-scale/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a247b4cbcaf17d88d9201ecffba3aecbb7aa2264 Mon Sep 17 00:00:00 2001 From: Shalom Peles Date: Tue, 7 Aug 2018 19:15:42 +0300 Subject: [PATCH 058/346] fix lint errors --- types/intrinsic-scale/index.d.ts | 9 ++++----- types/intrinsic-scale/intrinsic-scale-tests.ts | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/types/intrinsic-scale/index.d.ts b/types/intrinsic-scale/index.d.ts index 7d61d2135e..a2233cf69b 100644 --- a/types/intrinsic-scale/index.d.ts +++ b/types/intrinsic-scale/index.d.ts @@ -3,13 +3,12 @@ // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - export function contain(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; export function cover(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; export interface IntrinsicScale { - width: number, - height: number, - x: number, - y: number + width: number; + height: number; + x: number; + y: number; } diff --git a/types/intrinsic-scale/intrinsic-scale-tests.ts b/types/intrinsic-scale/intrinsic-scale-tests.ts index 714620478d..23c450572b 100644 --- a/types/intrinsic-scale/intrinsic-scale-tests.ts +++ b/types/intrinsic-scale/intrinsic-scale-tests.ts @@ -1,4 +1,4 @@ -import { cover, contain } from "."; +import { cover, contain } from "intrinsic-scale"; const intrinsicScale = cover(100, 100, 50, 50); -const { x, y, width, height } = contain(1,2,3,4); +const { x, y, width, height } = contain(1, 2, 3, 4); From d7ecdccc2a0650377dd105a4c2f0c2220ea57198 Mon Sep 17 00:00:00 2001 From: Gregory Ristow Date: Tue, 7 Aug 2018 13:16:42 -0400 Subject: [PATCH 059/346] feat(rethinkdb): Add sequence.merge and sequence.coerceTo support --- types/rethinkdb/index.d.ts | 19 +++++++++++++++++++ types/rethinkdb/rethinkdb-tests.ts | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index eb0e30b058..0045d3ddbc 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -277,6 +277,25 @@ declare module "rethinkdb" { interface Sequence extends Operation, Writeable { between(lower: any, upper: any, index?: Index): Sequence; + /** + * Turn a sequence into an array or object, necessary when merging a sequence. + * + * See: https://www.rethinkdb.com/api/javascript/coerce_to/ + */ + coerceTo(key: 'array'): Expression; + coerceTo(key: 'object'): Expression; + + merge(object: Object): Sequence; + merge(cb: ExpressionFunction>): Sequence; + + /** + * Turn a sequence into an array or object, necessary when merging a sequence. + * + * See: https://www.rethinkdb.com/api/javascript/coerce_to/ + */ + coerceTo(key: 'array'): Expression; + coerceTo(key: 'object'): Expression; + filter(rql: ExpressionFunction): Sequence; filter(rql: Expression): Sequence; filter(obj: { [key: string]: any }): Sequence; diff --git a/types/rethinkdb/rethinkdb-tests.ts b/types/rethinkdb/rethinkdb-tests.ts index fb129b94a5..b70de79297 100644 --- a/types/rethinkdb/rethinkdb-tests.ts +++ b/types/rethinkdb/rethinkdb-tests.ts @@ -22,6 +22,13 @@ r.connect({ host: "localhost", port: 28015 }, function(err: Error, conn: r.Conne ) .run(conn, errorAndCursorCallback); + r.table("players").merge((player: r.Expression) => { + return { + teams: r.table("games").getAll(player('teamIds')).coerceTo('array'), + } + }) + .run(conn, errorAndCursorCallback); + const center = r.point(123, 456); r.table("geo") .getIntersecting(r.circle(center, 1000, { unit: "m" }), { index: "location" }) From 67f9f9048d142394f055d8b5290003398acf9ce3 Mon Sep 17 00:00:00 2001 From: Gregory Ristow Date: Tue, 7 Aug 2018 13:29:22 -0400 Subject: [PATCH 060/346] fix(rethinkdb): remove extra coerceTo --- types/rethinkdb/index.d.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index 0045d3ddbc..0f0358cb32 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -270,6 +270,10 @@ declare module "rethinkdb" { get(key: string): Operation & Writeable; getAll(key: string, index?: Index): Sequence; // without index defaults to primary key getAll(...keys: string[]): Sequence; + getAll(...keys: string[]): Sequence; + getAll(keys: Expression): Sequence; + getAll(key: Expression): Sequence; + getIntersecting(geometry: Geometry, index: Index): Sequence; wait(WaitOptions?: WaitOptions): Operation; } @@ -288,14 +292,6 @@ declare module "rethinkdb" { merge(object: Object): Sequence; merge(cb: ExpressionFunction>): Sequence; - /** - * Turn a sequence into an array or object, necessary when merging a sequence. - * - * See: https://www.rethinkdb.com/api/javascript/coerce_to/ - */ - coerceTo(key: 'array'): Expression; - coerceTo(key: 'object'): Expression; - filter(rql: ExpressionFunction): Sequence; filter(rql: Expression): Sequence; filter(obj: { [key: string]: any }): Sequence; From 26fb039b45d56ba247efe8c1e114eb5f80b4b6fe Mon Sep 17 00:00:00 2001 From: Dima Danyliuk Date: Tue, 7 Aug 2018 21:38:31 +0300 Subject: [PATCH 061/346] Update types for "react-input-mask" v2.0.3 --- types/react-input-mask/v2/index.d.ts | 75 +++++++++++++++++++ .../v2/react-input-mask-tests.tsx | 13 ++++ types/react-input-mask/v2/tsconfig.json | 28 +++++++ types/react-input-mask/v2/tslint.json | 3 + 4 files changed, 119 insertions(+) create mode 100644 types/react-input-mask/v2/index.d.ts create mode 100644 types/react-input-mask/v2/react-input-mask-tests.tsx create mode 100644 types/react-input-mask/v2/tsconfig.json create mode 100644 types/react-input-mask/v2/tslint.json diff --git a/types/react-input-mask/v2/index.d.ts b/types/react-input-mask/v2/index.d.ts new file mode 100644 index 0000000000..5f36857eac --- /dev/null +++ b/types/react-input-mask/v2/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for react-input-mask 2.0.3 +// Project: https://github.com/sanniassin/react-input-mask +// Definitions by: Alexandre Paré +// Dima Danylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9.2 + +declare module 'react-input-mask' { + import * as React from 'react'; + + export interface InputState { + value: string; + selection: Selection; + } + + export interface MaskOptions { + mask: string; + maskChar: string; + alwaysShowMask: boolean; + formatChars: Record; + permanents: number[]; + } + + interface Props extends React.InputHTMLAttributes { + /** + * Mask string. Format characters are: + * * `9`: `0-9` + * * `a`: `A-Z, a-z` + * * `\*`: `A-Z, a-z, 0-9` + * + * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. + * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` + */ + mask: string; + /** + * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input. + */ + maskChar?: string | null; + /** + * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones: + * ``` + * { + * "9": "[0-9]", + * "a": "[A-Za-z]", + * "*": "[A-Za-z0-9]" + * }``` + */ + formatChars?: { [key: string]: string }; + /** + * Show mask even in empty input without focus. + */ + alwaysShowMask?: boolean; + /** + * Use inputRef instead of ref if you need input node to manage focus, selection, etc. + */ + inputRef?: React.Ref; + + /** + * In case you need to implement more complex masking behavior, you can provide + * beforeMaskedValueChange function to change masked value and cursor position + * before it will be applied to the input. + */ + beforeMaskedValueChange?( + newState: InputState, + oldState: InputState, + userInput: string, + maskOptions: MaskOptions, + ): InputState; + } + + class ReactInputMask extends React.Component { + } + + export default ReactInputMask; +} diff --git a/types/react-input-mask/v2/react-input-mask-tests.tsx b/types/react-input-mask/v2/react-input-mask-tests.tsx new file mode 100644 index 0000000000..93c6b1f638 --- /dev/null +++ b/types/react-input-mask/v2/react-input-mask-tests.tsx @@ -0,0 +1,13 @@ +import ReactInputMask from 'react-input-mask'; +import * as React from 'react'; + +let ref: HTMLInputElement | null = null; + +
+ + + + + + ref = node} /> +
; diff --git a/types/react-input-mask/v2/tsconfig.json b/types/react-input-mask/v2/tsconfig.json new file mode 100644 index 0000000000..8b19948640 --- /dev/null +++ b/types/react-input-mask/v2/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "react-input-mask": ["react-input-mask/v2"] + } + }, + "files": [ + "index.d.ts", + "react-input-mask-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-input-mask/v2/tslint.json b/types/react-input-mask/v2/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-input-mask/v2/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 2d432d65822d8dda8d8fe6bc8527ac2de764a704 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Tue, 7 Aug 2018 17:23:35 -0400 Subject: [PATCH 062/346] codemirror: Enable strictNullChecks so I can test typing changes that are only relevant with strictNullChecks enabled. --- types/codemirror/test/index.ts | 4 ++-- types/codemirror/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index 39c601f159..9b9231b25c 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -13,9 +13,9 @@ var head = range.head; var from = range.from(); var to = range.to(); -var myTextArea: HTMLTextAreaElement; +var myTextArea: HTMLTextAreaElement = undefined!; var myCodeMirror3: CodeMirror.Editor = CodeMirror(function (elt) { - myTextArea.parentNode.replaceChild(elt, myTextArea); + myTextArea.parentNode!.replaceChild(elt, myTextArea); }, { value: myTextArea.value }); var myCodeMirror4: CodeMirror.Editor = CodeMirror.fromTextArea(myTextArea); diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index 2ff349d98e..a2c6a52430 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From e9928ee53e6bd74af37e90acc57087bbdac412ba Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Tue, 7 Aug 2018 17:24:10 -0400 Subject: [PATCH 063/346] codemirror: EditorChangeCancellable.update is undefined for changes coming from undo/redo. --- types/codemirror/index.d.ts | 5 +++-- types/codemirror/test/index.ts | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 6dbfef6e60..f71f741659 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -716,8 +716,9 @@ declare namespace CodeMirror { } interface EditorChangeCancellable extends CodeMirror.EditorChange { - /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */ - update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; + /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. + If the change came from undo/redo, `update` is undefined and the change cannot be modified. */ + update?(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; cancel(): void; } diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index 9b9231b25c..431a20efb6 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -67,6 +67,15 @@ myCodeMirror.on( (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => { } ); +myCodeMirror.on( + "beforeChange", + (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => { + // $ExpectError + change.update(); + if (change.update != null) change.update(); + } +); + CodeMirror.registerHelper("lint", "javascript", {}); myCodeMirror.isReadOnly(); From 100efe4dde38a89bf3201250fb0fb39eeb27e68c Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Tue, 7 Aug 2018 17:24:40 -0400 Subject: [PATCH 064/346] codemirror: Define the type of keymaps. --- types/codemirror/index.d.ts | 12 ++++++++---- types/codemirror/test/index.ts | 13 ++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index f71f741659..5ece4f497e 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -15,7 +15,7 @@ declare function CodeMirror(callback: (host: HTMLElement) => void , options?: Co declare namespace CodeMirror { export var Doc : CodeMirror.DocConstructor; export var Pos: CodeMirror.PositionConstructor; - export var Pass: any; + export var Pass: {toString(): "CodeMirror.PASS"}; function countColumn(line: string, index: number | null, tabSize: number): number; function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea; @@ -129,6 +129,10 @@ declare namespace CodeMirror { state: any; } + interface KeyMap { + [keyName: string]: false | string | ((instance: Editor) => void | typeof Pass); + } + interface Editor { /** Tells you whether the editor currently has focus. */ @@ -159,11 +163,11 @@ declare namespace CodeMirror { Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them, the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed, in which case they end up below other keymaps added with this method. */ - addKeyMap(map: any, bottom?: boolean): void; + addKeyMap(map: string | KeyMap, bottom?: boolean): void; /** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string, which will be compared against the name property of the active keymaps. */ - removeKeyMap(map: any): void; + removeKeyMap(map: string | KeyMap): void; /** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting. For example, the search add - on uses it to highlight the term that's currently being searched. @@ -781,7 +785,7 @@ declare namespace CodeMirror { keyMap?: string; /** Can be used to specify extra keybindings for the editor, alongside the ones defined by keyMap. Should be either null, or a valid keymap value. */ - extraKeys?: any; + extraKeys?: string | KeyMap; /** Whether CodeMirror should scroll or wrap for long lines. Defaults to false (scroll). */ lineWrapping?: boolean; diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index 431a20efb6..bd2aefac88 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -4,7 +4,18 @@ var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body); var myCodeMirror2: CodeMirror.Editor = CodeMirror(document.body, { value: "function myScript(){return 100;}\n", - mode: "javascript" + mode: "javascript", + extraKeys: { + Enter: (cm) => { console.log("save"); }, + Esc: (cm) => { return CodeMirror.Pass; } + } +}); + +// $ExpectError +var myCodeMirror2_1: CodeMirror.Editor = CodeMirror(document.body, { + extraKeys: { + "Shift-Enter": (cm) => { return 42; } // not a valid return value + } }); var range = myCodeMirror2.findWordAt(CodeMirror.Pos(0, 2)); From b037ef15f334efb5da0b5d51e2eb85e3fc199bda Mon Sep 17 00:00:00 2001 From: Frank Li Date: Tue, 7 Aug 2018 16:59:25 -0700 Subject: [PATCH 065/346] Made `ComponentState` type to point to `any` --- types/react/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 40198d1a16..e6b6c2dbc9 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -61,7 +61,7 @@ declare namespace React { type Ref = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject; // tslint:disable-next-line:interface-over-type-literal - type ComponentState = {}; + type ComponentState = any; interface Attributes { key?: Key; @@ -356,7 +356,7 @@ declare namespace React { displayName?: string; } - interface ComponentClass

extends StaticLifecycle { + interface ComponentClass

extends StaticLifecycle { new (props: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; From 653ac8f1f7c0c53d9dca00ee59ea6259780fc736 Mon Sep 17 00:00:00 2001 From: shalomdotnet Date: Wed, 8 Aug 2018 05:20:30 +0300 Subject: [PATCH 066/346] add my github account --- types/intrinsic-scale/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/intrinsic-scale/index.d.ts b/types/intrinsic-scale/index.d.ts index a2233cf69b..56100aeb25 100644 --- a/types/intrinsic-scale/index.d.ts +++ b/types/intrinsic-scale/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for intrinsic-scale 3.0 // Project: https://github.com/bfred-it/intrinsic-scale#readme -// Definitions by: My Self +// Definitions by: shalomdotnet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export function contain(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; From 89eff5086697c1a254da6e0fe63aa46f8d61b543 Mon Sep 17 00:00:00 2001 From: Confusus Date: Wed, 8 Aug 2018 09:14:15 +0200 Subject: [PATCH 067/346] Changed pairs of chain from any to [string, any] --- types/underscore/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 95ff48eddc..72498e3591 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -7,7 +7,7 @@ declare var _: _.UnderscoreStatic; export = _; export as namespace _; -// The DOM is not required to be present, but these definitions reference type Element for the +// The DOM is not required to be present, but these definitions reference type Element for the // isElement check. If the DOM is present, this declaration will merge. declare global { interface Element { } @@ -5704,7 +5704,7 @@ declare module _ { * Wrapped type `object`. * @see _.pairs **/ - pairs(): _Chain; + pairs(): _Chain<[string, any]>; /** * Wrapped type `object`. From bc0d108148258976cdc404b4eb6d2bf83bf6c5da Mon Sep 17 00:00:00 2001 From: taoqf Date: Wed, 8 Aug 2018 15:23:50 +0800 Subject: [PATCH 068/346] add type defination qiniu-js --- types/qiniu-js/index.d.ts | 371 +++++++++++++++++++++++++++++++ types/qiniu-js/qiniu-js-tests.ts | 50 +++++ types/qiniu-js/tsconfig.json | 24 ++ types/qiniu-js/tslint.json | 1 + 4 files changed, 446 insertions(+) create mode 100644 types/qiniu-js/index.d.ts create mode 100644 types/qiniu-js/qiniu-js-tests.ts create mode 100644 types/qiniu-js/tsconfig.json create mode 100644 types/qiniu-js/tslint.json diff --git a/types/qiniu-js/index.d.ts b/types/qiniu-js/index.d.ts new file mode 100644 index 0000000000..b47bc0528e --- /dev/null +++ b/types/qiniu-js/index.d.ts @@ -0,0 +1,371 @@ +// Type definitions for qiniu-js 2.4 +// Project: https://github.com/qiniu/js-sdk#readme +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export as namespace qiniu; + +export interface Next { + total: { + loaded: number; // 已上传大小,单位为字节。 + total: number; // 本次上传的总量控制信息,单位为字节,注意这里的 total 跟文件大小并不一致。 + percent: number; // 当前上传进度,范围:0~100。 + }; +} + +export interface Error { + code: number; // 请求错误状态码,只有在 err.isRequestError 为 true 的时候才有效。可查阅码值对应说明。 + message: string; // 错误信息,包含错误码,当后端返回提示信息时也会有相应的错误信息。 + isRequestError: true | undefined; // 用于区分是否 xhr 请求错误;当 xhr 请求出现错误并且后端通过 HTTP 状态码返回了错误信息时,该参数为 true;否则为 undefined 。 + reqId: string; // xhr请求错误的 X-Reqid。 +} + +export interface AudioInfo { + bit_rate: string; + channels: number; + codec_name: string; + codec_type: string; + duration: string; + index: number; + nb_frames: string; + r_frame_rate: string; + sample_fmt: string; + sample_rate: string; + start_time: string; + tags: { + creation_time: string; + [key: string]: string; + }; +} + +export interface AvFormat { + bit_rate: string; + duration: string; + format_long_name: string; + format_name: string; + nb_streams: number; + size: string; + start_time: string; + tags: { + creation_time: string; + [key: string]: string; + }; +} + +export interface VideoInfo { + bit_rate: string; + codec_name: string; + codec_type: string; + display_aspect_ratio: string; + duration: string; + height: number; + index: number; + nb_frames: string; + pix_fmt: string; + r_frame_rate: string; + sample_aspect_ratio: string; + start_time: string; + tags: { + creation_time: string; + [key: string]: string; + }; + width: number; +} + +export interface AvAudioInfo { + audio: AudioInfo; + format: AvFormat; + video: VideoInfo; +} + +export interface AvImageInfo { + format: string; + width: number; + height: number; + colorModel: string; +} + +export interface CompletedResult { + avinfo?: AvAudioInfo; + imageInfo?: AvImageInfo; + key: string; + name: string; + size: number; + persistentid: string; + sec: string; + ext: string; + bucket: string; +} + +export interface Observer { + next(res: Next): void; + error(err: Error | string): void; + complete(res: CompletedResult): void; +} + +export interface Subscription { + unsubscribe(): void; +} + +export interface Observable { + subscribe(options: Observer): Subscription; + /** + * 订阅 + * + * @param next 接收上传进度信息 + * @param error 上传错误后触发;自动重试本身并不会触发该错误,而当重试次数到达上限后则可以触发。当不是 xhr 请求错误时,会把当前错误产生原因直接抛出,诸如 JSON 解析异常等;当产生 xhr 请求错误时,参数 err 为一个包含 code、message、isRequestError 三个属性的 object + * @param complete 接收上传完成后的后端返回信息,具体返回结构取决于后端sdk的配置,可参考[上传策略](https://developer.qiniu.com/kodo/manual/1206/put-policy)。 + * @returns + */ + subscribe(next: (obj: Next) => void, error?: (err: Error | string) => void, complete?: (obj: CompletedResult) => void): Subscription; +} + +export interface Extra { + fname: string; // 文件原文件名 + params: any; // 用来放置自定义变量 + mimeType: string[] | null; // 用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"] +} + +export interface Config { + useCdnDomain: boolean; + region: Region | string; +} + +/** + * 上传文件 + * @param file Blob 对象,上传的文件 + * @param key 文件资源名 + * @param token 上传验证信息,前端通过接口请求后端获得 + * @param putExtra + * @param config + */ +export function upload(file: Blob, key: string | null | undefined, token: string, putExtra: Partial, config: Partial): Observable; + +/** + * 返回创建文件的 url;当分片上传时,我们需要把分片返回的 ctx 信息拼接后通过该 url 上传给七牛以创建文件。 + * + * @param url 上传域名,可以通过qiniu.getUploadUrl()获得 + * @param size 文件大小 + * @param key 文件资源名 + * @param putExtra + * @returns + */ +export function createMkFileUrl(url: string, size: number, key: string, putExtra: Partial): string; + +export enum Region { + z0, // 代表华东区域 + z1, // 代表华北区域 + z2, // 代表华南区域 + na0, // 代表北美区域 + as0 // 代表新加坡区域 +} + +export namespace region { + const z0: Region; + const z1: Region; + const z2: Region; + const na0: Region; + const as0: Region; +} + +/** + * 接收参数为 config 对象,返回根据 config 里所配置信息的上传域名 + * + * @param config + * @param token + * @returns + */ +export function getUploadUrl(config: Partial, token: string): Promise; + +export interface Headers { + [key: string]: string; +} + +/** + * 返回 object,包含用来获得分片上传设置的头信息,参数为 token 字符串;当分片上传时,请求需要带该函数返回的头信息 + * + * @param token + * @returns + */ +export function getHeadersForChunkUpload(token: string): Headers; + +/** + * 返回 object,包含用来获得文件创建的头信息,参数为 token 字符串;当分片上传完需要把 ctx 信息传给七牛用来创建文件时,请求需要带该函数返回的头信息 + * + * @param token + * @returns + */ +export function getHeadersForMkFile(token: string): Headers; + +/** + * 返回[[k, v],...]格式的数组,k 为自定义变量 key 名,v 为自定义变量值,用来提取 putExtra.params 包含的自定义变量 + * + * @param params + * @returns + */ +export function filterParams(params: any): Array<[string, any]>; + +export interface CompressOptions { + quality: number; // 图片压缩质量,在图片格式为 image/jpeg 或 image/webp 的情况下生效,其他格式不会生效,可以从 0 到 1 的区间内选择图片的质量。默认值 0.92 + maxWidh: number; // 压缩图片的最大宽度值 + maxHeight: number; // 压缩图片的最大高度值 (注意:当 maxWidth 和 maxHeight 都不设置时,则采用原图尺寸大小) + noCompressIfLarger: boolean; // 为 true 时如果发现压缩后图片大小比原来还大,则返回源图片(即输出的 dist 直接返回了输入的 file);默认 false,即保证图片尺寸符合要求,但不保证压缩后的图片体积一定变小 +} + +/** + * 上传前图片压缩 + * + * @param file 要压缩的源图片,为 blob 对象,支持 image/png、image/jpeg、image/bmp、image/webp 这几种图片类型 + * @param options + * @returns + */ +export function compressImage(file: Blob, options: Partial): Promise<{ + dist: Blob; // 压缩后输出的 blob 对象,或原始的 file,具体看下面的 options 配置 + width: number; // 压缩后的图片宽度 + height: number; // 压缩后的图片高度 +}>; + +export interface WaterMarkOptions1 { + mode: 1; // 图片水印 + image: string; // 图片水印的Url,mode = 1 时 **必需** + dissolve: number; // 透明度,取值范围1-100,非必需,下同 + gravity: 'NorthWest' | 'North' | 'NorthEast' | 'West' | 'Center' | 'East' | 'SouthWest' | 'South' | 'SouthEast'; // 水印位置 + dx: number; // 横轴边距,单位:像素(px) + dy: number; // 纵轴边距,单位:像素(px) +} + +export interface WaterMarkOptions2 { + mode: 2; // 文字水印 + text: string; // 水印文字,mode = 2 时 **必需** + dissolve: number; // 透明度,取值范围1-100,非必需,下同 + gravity: 'NorthWest' | 'North' | 'NorthEast' | 'West' | 'Center' | 'East' | 'SouthWest' | 'South' | 'SouthEast'; // 水印位置 + fontsize: number; // 字体大小,单位: 缇 + font: string; // 水印文字字体 + dx: number; // 横轴边距,单位:像素(px) + dy: number; // 纵轴边距,单位:像素(px) + fill: string; // 水印文字颜色,RGB格式,可以是颜色名称 +} + +/** + * 水印 + * + * @param options 包含的具体水印参数解释见水印([watermark](https://developer.qiniu.com/dora/manual/1316/image-watermarking-processing-watermark)) + * @param key 文件资源名 + * @param domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取,前端可以通过接口请求后端得到 + * @returns 返回添加水印后的图片地址,可以赋值给 html 的 img 元素的 src 属性, 若未指定key,可以通过以下方式获得完整的 imgLink + * `imgLink = '/?' + imgLink` + * 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 + */ +export function watermark(options: WaterMarkOptions1 | WaterMarkOptions2, key?: string, domain?: string): string; + +export interface ImageView2Options { + mode: 0 | 1 | 2 | 3 | 4 | 5; // 缩略模式,共6种[0-5] + w: number; // 具体含义由缩略模式决定 + h: number; // 具体含义由缩略模式决定 + q: number; // 新图的图像质量,取值范围:1-100 + format: 'jpg' | 'gif' | 'png' | 'webp' | string; // 新图的输出格式,取值范围:jpg,gif,png,webp等 +} + +/** + * 缩略 + * + * @param options 具体缩略参数解释见[图片基本处理(imageView2)](https://developer.qiniu.com/dora/manual/1279/basic-processing-images-imageview2) + * @param key + * @param domain + * @returns 返回处理后的图片url + */ +export function imageView2(options: Partial, key: string, domain: string): string; + +export interface ImageMogr2Options { + 'auto-orient': boolean; // 布尔值,是否根据原图EXIF信息自动旋正,便于后续处理,建议放在首位。 + strip: boolean; // 布尔值,是否去除图片中的元信息 + thumbnail: string; // 缩放操作参数 + crop: string; // 裁剪操作参数 + gravity: string; // 裁剪锚点参数 + quality: number; // 图片质量,取值范围1-100 + rotate: number; // 旋转角度,取值范围1-360,缺省为不旋转。 + format: string; // 新图的输出格式,取值范围:jpg,gif,png,webp等 + blur: string; // 高斯模糊参数 +} + +/** + * 返回处理后的图片url + * + * @param optoins 具体高级图像处理参数解释见[图像高级处理(imageMogr2)](https://developer.qiniu.com/dora/manual/1270/the-advanced-treatment-of-images-imagemogr2) + * @param key + * @param domain + * @returns 返回处理后的图片url + */ +export function imageMogr2(optoins: Partial, key: string, domain: string): string; + +export interface ImageInfo { + size: number; // 文件大小,单位:Bytes + format: 'png' | 'jpeg' | 'gif' | 'bmp'; // 图片类型,如png、jpeg、gif、bmp等。 + width: number; // 图片宽度,单位:像素(px) 。 + height: number; // 图片高度,单位:像素(px) 。 + colorModel: string; // 彩色空间,如palette16、ycbcr等。 + frameNumber: number; // 帧数,gif 图片会返回此项。 +} + +/** + * + * 图片基本信息 + * 具体 imageInfo 解释见[图片基本信息(imageInfo)](https://developer.qiniu.com/dora/manual/1269/pictures-basic-information-imageinfo) + * + * @param key + * @param domain + * @returns + */ +export function imageInfo(key: string, domain: string): Promise; + +export interface ExtendedInfo { + code: number; + error: string; + [key: string]: { + type: number; + val: string; + } | number | string; +} + +export interface ExtentInfoValue { + type: number; + val: string; +} + +export interface ExtentInfo { + [key: string]: ExtentInfoValue; + DateTime: ExtentInfoValue; + ExposureBiasValue: ExtentInfoValue; + ExposureTime: ExtentInfoValue; + Model: ExtentInfoValue; + ISOSpeedRatings: ExtentInfoValue; + ResolutionUnit: ExtentInfoValue; +} + +/** + * EXIF 信息 + * 具体 exif 解释见[图片 EXIF 信息(exif)](https://developer.qiniu.com/dora/manual/1260/photo-exif-information-exif) + * @param key + * @param domain + * @returns + */ +export function exif(key: string, domain: string): Promise; + +export interface WaterMarkFopOptions1 extends WaterMarkOptions1 { + fop: 'watermark'; +} + +export interface WaterMarkFopOptions2 extends WaterMarkOptions2 { + fop: 'watermark'; +} + +export interface ImageView2FopOptions extends ImageView2Options { + fop: 'imageView2'; +} + +export interface ImageMogr2FopOptions extends ImageMogr2Options { + fop: 'imageMogr2'; +} + +export function pipeline(fos: Array<(WaterMarkFopOptions1 | WaterMarkFopOptions2 | ImageView2FopOptions | ImageMogr2FopOptions)>, key: string, domain: string): string; diff --git a/types/qiniu-js/qiniu-js-tests.ts b/types/qiniu-js/qiniu-js-tests.ts new file mode 100644 index 0000000000..344f38b195 --- /dev/null +++ b/types/qiniu-js/qiniu-js-tests.ts @@ -0,0 +1,50 @@ +import { compressImage, region, upload } from 'qiniu-js'; + +const file: Blob = null as any; + +const config = { + useCdnDomain: true, + region: region.z2 +}; + +const key = 'key'; +const token = 'token'; + +const putExtra = { + fname: "", + params: {}, + mimeType: [] || null +}; + +(() => { + const observable = upload(file, key, token, putExtra, config); + + const subscription = observable.subscribe({ + next(res) { }, + complete(res) { }, + error(err) { } + }); // 上传开始 + subscription.unsubscribe(); // 上传取消 +})(); + +(() => { + const observable = upload(file, key, token, putExtra, config); + const subscription = observable.subscribe((res) => { }, (err) => { }, (res) => { }); // 这样传参形式也可以 +})(); + +(async () => { + // 图片上传前压缩: + const options = { + quality: 0.92, + noCompressIfLarger: true + // maxWidth: 1000, + // maxHeight: 618 + }; + const data = await compressImage(file, options); + const observable = upload(data.dist, key, token, putExtra, config); + const subscription = observable.subscribe({ + next(res) { }, + complete(res) { }, + error(err) { } + }); // 上传开始 +})(); diff --git a/types/qiniu-js/tsconfig.json b/types/qiniu-js/tsconfig.json new file mode 100644 index 0000000000..f8bc0667b7 --- /dev/null +++ b/types/qiniu-js/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "strictFunctionTypes": true, + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "qiniu-js-tests.ts" + ] +} \ No newline at end of file diff --git a/types/qiniu-js/tslint.json b/types/qiniu-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/qiniu-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b42b620eab47bddd3dfaf66a3f0c36afe6c27736 Mon Sep 17 00:00:00 2001 From: Hassansin Date: Wed, 8 Aug 2018 14:35:24 +0600 Subject: [PATCH 069/346] Added definitions for `chartmogul-node` package * Added definitions for chartmogul-node [ch3038] * Added arpa [ch3038] * Added error definitions [ch3038] --- .../chartmogul-node/chartmogul-node-tests.ts | 277 ++++++++++++ types/chartmogul-node/common.d.ts | 28 ++ types/chartmogul-node/index.d.ts | 410 ++++++++++++++++++ types/chartmogul-node/tsconfig.json | 23 + types/chartmogul-node/tslint.json | 1 + 5 files changed, 739 insertions(+) create mode 100644 types/chartmogul-node/chartmogul-node-tests.ts create mode 100644 types/chartmogul-node/common.d.ts create mode 100644 types/chartmogul-node/index.d.ts create mode 100644 types/chartmogul-node/tsconfig.json create mode 100644 types/chartmogul-node/tslint.json diff --git a/types/chartmogul-node/chartmogul-node-tests.ts b/types/chartmogul-node/chartmogul-node-tests.ts new file mode 100644 index 0000000000..3a09a7597c --- /dev/null +++ b/types/chartmogul-node/chartmogul-node-tests.ts @@ -0,0 +1,277 @@ +import * as ChartMogul from 'chartmogul-node'; + +const config = new ChartMogul.Config("token", "secret", "baseURL"); +config.retries = 10; +config.getAccountToken(); // $ExpectType string +config.getSecretKey(); // $ExpectType string +config.VERSION; // $ExpectType string + +ChartMogul.Ping.ping(config); // $ExpectType Promise + +// $ExpectType Promise +ChartMogul.DataSource.create(config, { + name: "" +}); + +// $ExpectType Promise +ChartMogul.DataSource.retrieve(config, ""); + +// $ExpectType Promise<{}> +ChartMogul.DataSource.destroy(config, ""); + +// $ExpectType Promise +ChartMogul.DataSource.all(config, { + name: "" +}); + +ChartMogul.DataSource.all(config).then(data => { + data.data_sources[0]; // $ExpectType DataSource + data.data_sources[0].name; // $ExpectType string +}); + +// $ExpectType Promise +ChartMogul.Customer.create(config, { + data_source_uuid: "", + name: "", + external_id: "", + attributes: { + tags: ["important", "Prio1"], + custom: [ + {type: "String", key: "channel", value: "Facebook", source: "integration"}, + {type: "Integer", key: "age", value: 18} + ] + } +}); + +// $ExpectType Promise +ChartMogul.Customer.retrieve(config, ""); + +// $ExpectType Promise +ChartMogul.Customer.modify(config, "", {}); + +// $ExpectType Promise<{}> +ChartMogul.Customer.destroy(config, ""); + +// $ExpectType Promise> +ChartMogul.Customer.all(config, { + data_source_uuid: "" +}); + +ChartMogul.Customer.all(config).then(data => { + data.entries[0]; // $ExpectType Customer + data.entries[0].attributes!.stripe!['something']; // $ExpectType any + data.page!; // $ExpectType number +}); + +// $ExpectType Promise> +ChartMogul.Customer.search(config, { + email: "" +}); +// $ExpectType Promise<{}> +ChartMogul.Customer.merge(config, { + from: {customer_uuid: ""}, + into: {customer_uuid: ""} +}); +// $ExpectType Promise +ChartMogul.Customer.attributes(config, ""); + +// $ExpectType Promise +ChartMogul.Plan.create(config, { + data_source_uuid: "", + name: "", + interval_count: 1, + interval_unit: "", + external_id: "" +}); + +// $ExpectType Promise +ChartMogul.Plan.retrieve(config, ""); + +// $ExpectType Promise +ChartMogul.Plan.modify(config, "", { + name: "" +}); + +// $ExpectType Promise<{}> +ChartMogul.Plan.destroy(config, ""); + +ChartMogul.Plan.all(config, { + page: 1 +}).then(data => { + data.plans[0]; // $ExpectType Plan + data.plans[0].name!; // $ExpectType string + data.page!; // $ExpectType number +}); + +// $ExpectType Promise +ChartMogul.Invoice.retrieve(config, ""); + +// $ExpectType Promise +ChartMogul.Invoice.create(config, "", { + invoices: [ + { + external_id: "" + } + ] +}); + +// $ExpectType Promise<{}> +ChartMogul.Invoice.destroy(config, ""); +ChartMogul.Invoice.all(config, { + external_id: "" +}).then(data => { + data.invoices[0]; // $ExpectType Invoice + data.invoices[0].uuid!; // $ExpectType string + data.page!; // $ExpectType number +}); + +ChartMogul.Invoice.all(config, "", { + page: 1 +}).then(data => { + data.customer_uuid!; // $ExpectType string + data.invoices[0]; // $ExpectType Invoice + data.invoices[0].uuid!; // $ExpectType string + data.page!; // $ExpectType number +}); + +// $ExpectType Promise +ChartMogul.Transaction.create(config, "", { + type: "", + date: "", + result: "" +}); + +ChartMogul.Subscription.all(config, "", { + page: 1 +}).then(data => { + data.customer_uuid!; // $ExpectType string + data.subscriptions[0]; // $ExpectType Subscription + data.subscriptions[0].uuid; // $ExpectType string + data.current_page!; // $ExpectType number +}); + +ChartMogul.Subscription.cancel(config, "", { + cancelled_at: "" +}).then(data => { + data.customer_uuid; // $ExpectType string +}); + +// $ExpectType Promise> +ChartMogul.Tag.add(config, "", { + email: "", + tags: [""] +}); + +// $ExpectType Promise +ChartMogul.Tag.add(config, "", { + tags: [""] +}); + +// $ExpectType Promise +ChartMogul.Tag.remove(config, "", { + tags: [""] +}); + +// $ExpectType Promise +ChartMogul.CustomAttribute.add(config, "", { + custom: [ + {type: "", key: "", value: 0} + ] +}); +// $ExpectType Promise> +ChartMogul.CustomAttribute.add(config, "", { + email: "", + custom: [ + {type: "", key: "", value: 0} + ] +}); + +// $ExpectType Promise +ChartMogul.CustomAttribute.update(config, "", { + custom: { + pro: true, + channel: "" + } +}); + +ChartMogul.CustomAttribute.remove(config, "", { + custom: [""] +}).then(data => { + data.custom["key"]; // $ExpectType any +}); + +// $ExpectType Promise +ChartMogul.Metrics.all(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-24', + interval: '', + geo: '', + plans: '' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.mrr(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.arr(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.arpa(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.asp(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.customerCount(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.customerChurnRate(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01', + geo: '', + plans: '' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.mrrChurnRate(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +ChartMogul.Metrics.ltv(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}).then(data => { + data.entries[0].ltv; // $ExpectType number + data.summary; // $ExpectType Summary + data.summary.current; // $ExpectType number +}); + +// $ExpectType Promise> +ChartMogul.Metrics.Customer.subscriptions(config, "", { + page: 1 +}); + +ChartMogul.Metrics.Customer.activities(config, "", { + page: 1 +}).then(data => { + data.entries; // $ExpectType MetricsActivity[] + data.entries[0]; // $ExpectType MetricsActivity + data.entries[0]['activity-mrr']; // $ExpectType number + data.page!; // $ExpectType number +}); diff --git a/types/chartmogul-node/common.d.ts b/types/chartmogul-node/common.d.ts new file mode 100644 index 0000000000..ced10f98d7 --- /dev/null +++ b/types/chartmogul-node/common.d.ts @@ -0,0 +1,28 @@ +export interface Map { + [key: string]: any +} +export interface CursorParams { + page?: number; + per_page?: number; +} +export type Strings = string[]; + +export interface Cursor { + page?: number; + per_page?: number; + has_more?: boolean; + current_page?: number; + total_pages?: number; +} +export interface Entries extends Cursor { + entries: T[] +} +interface Summary { + current: number; + previous: number; + ['percentage-change']: number; +} +export interface EntriesSummary { + entries: T[]; + summary: Summary; +} \ No newline at end of file diff --git a/types/chartmogul-node/index.d.ts b/types/chartmogul-node/index.d.ts new file mode 100644 index 0000000000..c4bdce5aca --- /dev/null +++ b/types/chartmogul-node/index.d.ts @@ -0,0 +1,410 @@ +// Type definitions for chartmogul-node 1.0 +// Project: https://github.com/chartmogul/chartmogul-node +// Definitions by: ChartMogul +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Map, Cursor, CursorParams, Strings, Entries, EntriesSummary } from './common'; + +export class Config { + VERSION: string; + API_BASE: string; + retries: number; + + constructor(token: string, secret: string, base?: string); + getAccountToken(): string; + getSecretKey(): string; +} + +export namespace Ping { + function ping(config: Config): Promise; +} + +export namespace DataSource { + interface DataSource { + uuid?: string; + name: string; + created_at?: string; + status?: string; + system?: string; + } + interface DataSources { + data_sources: DataSource[]; + } + interface ListDataSourcesParams { + name?: string; + system?: string; + } + + function create(config: Config, data: DataSource): Promise; + function retrieve(config: Config, uuid: string): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, params?: ListDataSourcesParams): Promise; +} + +export namespace Customer { + interface Customer { + id?: number; + data_source_uuid?: string; + data_source_uuids?: Strings; + uuid?: string; + external_id?: string; + external_ids?: Strings; + name?: string; + email?: string; + status?: string; + ['customer-since']?: string; + attributes?: Attributes; + address?: { + address_zip?: string; + city?: string; + state?: string; + country?: string; + }; + mrr?: number; + arr?: number; + ['billing-system-url']?: string; + ['chartmogul-url']?: string; + ['billing-system-type']?: string; + currency?: string; + ['currency-sign']?: string; + company?: string; + country?: string; + state?: string; + city?: string; + zip?: string; + lead_created_at?: string; + free_trial_started_at?: string; + } + interface NewCustomer { + data_source_uuid: string; + external_id: string; + name: string; + email?: string; + company?: string; + country?: string; + state?: string; + city?: string; + zip?: string; + lead_created_at?: string; + free_trial_started_at?: string; + attributes?: NewAttributes; + } + interface UpdateCustomer { + name?: string; + email?: string; + company?: string; + country?: string; + state?: string; + city?: string; + zip?: string; + lead_created_at?: string; + free_trial_started_at?: string; + attributes?: NewAttributes; + } + interface NewAttributes { + tags?: Strings; + custom?: NewCustomAttributes[]; + } + interface NewCustomAttributes { + type?: string; + key: string; + value: any; + source?: string; + } + interface Attributes { + tags?: Strings; + stripe?: Map; + clearbit?: Map; + custom?: Map; + } + interface ListCustomersParams extends CursorParams { + data_source_uuid?: string; + status?: string; + system?: string; + external_id?: string; + } + interface SearchCustomersParams extends CursorParams { + email: string; + } + interface MergeID { + customer_uuid?: string; + external_id?: string; + } + interface MergeCustomersParams { + from: MergeID; + into: MergeID; + } + + function create(config: Config, data: NewCustomer): Promise; + function retrieve(config: Config, uuid: string): Promise; + function modify(config: Config, uuid: string, data: UpdateCustomer): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, params?: ListCustomersParams): Promise>; + function search(config: Config, params?: SearchCustomersParams): Promise>; + function merge(config: Config, params?: MergeCustomersParams): Promise<{}>; + function attributes(config: Config, uuid: string): Promise; +} + +export namespace Plan { + interface Plan { + uuid?: string; + data_source_uuid?: string; + external_id?: string; + name?: string; + interval_count?: number; + interval_unit?: string; + } + interface ListPlansParams extends CursorParams { + data_source_uuid?: string; + system?: string; + external_id?: string; + } + interface Plans extends Cursor { + plans: Plan[]; + } + + function create(config: Config, data: Plan): Promise; + function retrieve(config: Config, uuid: string): Promise; + function modify(config: Config, uuid: string, data: Plan): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, params?: ListPlansParams): Promise; +} + +export namespace Invoice { + interface Invoice { + uuid?: string; + customer_uuid?: string; + currency?: string; + data_source_uuid?: string; + date?: string; + due_date?: string; + external_id?: string; + line_items?: LineItem[]; + transactions?: Transaction[]; + } + interface LineItem { + uuid?: string; + account_code?: string; + amount_in_cents?: number; + cancelled_at?: string; + description?: string; + discount_amount_in_cents?: number; + discount_code?: string; + external_id?: string; + plan_uuid?: string; + prorated?: boolean; + quantity?: number; + service_period_end?: string; + service_period_start?: string; + subscription_external_id?: string; + subscription_uuid?: string; + tax_amount_in_cents?: number; + transaction_fees_in_cents?: number; + type?: string; + } + interface Transaction { + uuid?: string; + date?: string; + external_id?: string; + result?: string; + type?: string; + } + interface ListInvoicesParams extends CursorParams { + data_source_uuid?: string; + customer_uuid?: string; + external_id?: string; + } + interface Invoices extends Cursor { + customer_uuid?: string; + invoices: Invoice[]; + } + + function create(config: Config, uuid: string, data: { + invoices: Invoice[] + }): Promise; + function retrieve(config: Config, uuid: string): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, uuid: string, params?: ListInvoicesParams): Promise; + function all(config: Config, params?: ListInvoicesParams): Promise; +} + +export namespace Transaction { + interface Transaction { + uuid?: string; + date: string; + external_id?: string; + result: string; + type: string; + } + + function create(config: Config, uuid: string, data: Transaction): Promise; +} + +export namespace Subscription { + interface Subscription { + uuid: string; + external_id: string; + customer_uuid: string; + plan_uuid: string; + cancellation_dates: Strings; + data_source_uuid: string; + } + interface CancelSubscriptionParams { + cancelled_at?: string; + cancellation_dates?: Strings; + } + interface Subscriptions extends Cursor { + customer_uuid?: string; + subscriptions: Subscription[]; + } + + function all(config: Config, uuid: string, data: CursorParams): Promise; + function cancel(config: Config, uuid: string, data: CancelSubscriptionParams): Promise; +} + +export namespace Tag { + interface Tags { + tags: Strings; + } + interface TagsWithEmail { + email: string; + tags: Strings; + } + function add(config: Config, uuid: string, data: TagsWithEmail): Promise>; + function add(config: Config, uuid: string, data: Tags): Promise; + function remove(config: Config, uuid: string, data: Tags): Promise; +} + +export namespace CustomAttribute { + import NewCustomAttributes = Customer.NewCustomAttributes; + + interface CustomAttributes { + custom: Map; + } + function add(config: Config, uuid: string, data: { + email: string; + custom: NewCustomAttributes[]; + }): Promise>; + function add(config: Config, uuid: string, data: { + custom: NewCustomAttributes[]; + }): Promise; + function update(config: Config, uuid: string, data: CustomAttributes): Promise; + function remove(config: Config, uuid: string, data: { + custom: Strings; + }): Promise; +} + +export namespace Metrics { + interface Params extends ParamsNoInterval { + interval?: string; + } + interface ParamsNoInterval { + ['start-date']: string; + ['end-date']: string; + geo?: string; + plans?: string; + } + interface All { + entries: { + date: string; + ['customer-churn-rate']: number; + ['mrr-churn-rate']: number; + ltv: number; + customers: number; + asp: number; + arpa: number; + arr: number; + mrr: number; + }; + } + + interface MRR { + date: string; + mrr: number; + ['mrr-new-business']: number; + ['mrr-expansion']: number; + ['mrr-contraction']: number; + ['mrr-churn']: number; + ['mrr-reactivation']: number; + } + interface ARR { + date: string; + arr: number; + } + interface ARPA { + date: string; + arpa: number; + } + interface ASP { + date: string; + asp: number; + } + interface CustomerCount { + date: string; + customers: number; + } + interface CustomerChurnRate { + date: string; + ['customer-churn-rate']: number; + } + interface MRRChurnRate { + date: string; + ['mrr-churn-rate']: number; + } + interface LTV { + date: string; + ltv: number; + } + + function all(config: Config, params: Params): Promise; + function mrr(config: Config, params: Params): Promise>; + function arr(config: Config, params: Params): Promise>; + function asp(config: Config, params: Params): Promise>; + function arpa(config: Config, params: Params): Promise>; + function customerCount(config: Config, params: Params): Promise>; + function customerChurnRate(config: Config, params: ParamsNoInterval): Promise>; + function mrrChurnRate(config: Config, params: ParamsNoInterval): Promise>; + function ltv(config: Config, params: ParamsNoInterval): Promise>; + + namespace Customer { + interface MetricsSubscription { + id: number; + external_id: string; + plan: string; + quantity: number; + mrr: number; + arr: number; + status: string; + ['billing-cycle']: string; + ['billing-cycle-count']: number; + ['start-date']: string; + ['end-date']: string; + currency: string; + ['currency-sign']: string; + } + interface MetricsActivity { + id: number; + date: string; + ['activity-arr']: number; + ['activity-mrr']: number; + ['activity-mrr-movement']: number; + currency: string; + ['currency-sign']: string; + description: string; + type: string; + } + + function subscriptions(config: Config, uuid: string, params?: CursorParams): Promise>; + function activities(config: Config, uuid: string, params?: CursorParams): Promise>; + } +} + +export class ChartMogulError extends Error { + response: any; + httpStatus: number; +} +export class ConfigurationError extends ChartMogulError {} +export class ForbiddenError extends ChartMogulError {} +export class NotFoundError extends ChartMogulError {} +export class ResourceInvalidError extends ChartMogulError {} +export class SchemaInvalidError extends ChartMogulError {} diff --git a/types/chartmogul-node/tsconfig.json b/types/chartmogul-node/tsconfig.json new file mode 100644 index 0000000000..3b24d48da8 --- /dev/null +++ b/types/chartmogul-node/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", + "chartmogul-node-tests.ts" + ] +} diff --git a/types/chartmogul-node/tslint.json b/types/chartmogul-node/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chartmogul-node/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a4956b02df1620315c0246ebfde78796d9d262e9 Mon Sep 17 00:00:00 2001 From: Junyoung Clare Jang Date: Wed, 8 Aug 2018 05:30:42 -0400 Subject: [PATCH 070/346] Update inquirer filter and validate to use any --- types/inquirer/index.d.ts | 5 +++-- types/inquirer/inquirer-tests.ts | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index d00c037c71..5d976e896d 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -8,6 +8,7 @@ // Synarque // Justin Rockwood // Keith Kelly +// Junyoung Clare Jang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -116,12 +117,12 @@ declare namespace inquirer { * Receive the user input and should return true if the value is valid, and an error message (String) * otherwise. If false is returned, a default error message is provided. */ - validate?(input: string, answers?: T): boolean | string | Promise; + validate?(input: any, answers?: T): boolean | string | Promise; /** * Receive the user input and return the filtered value to be used inside the program. * The value returned will be added to the Answers hash. */ - filter?(input: string): string | Promise; + filter?(input: string): any; /** * Receive the user input and return the transformed value to be displayed to the user. The * transformation only impacts what is shown while editing. It does not impact the answers diff --git a/types/inquirer/inquirer-tests.ts b/types/inquirer/inquirer-tests.ts index 85a81d761e..4c8ba9491f 100644 --- a/types/inquirer/inquirer-tests.ts +++ b/types/inquirer/inquirer-tests.ts @@ -670,3 +670,17 @@ var questions = [ inquirer.createPromptModule({ output: process.stderr })(questions, function(answers) { console.log(JSON.stringify(answers, null, " ")); }); + +// Work with JS inquirer but rejected by typing. +inquirer.prompt([ + { + type: "input", + name: "listOfThings", + filter(value: string): string[] { + return ["abc", "def"]; + }, + validate(value: string[]): boolean { + return value.length > 0; + } + } +]); From d0a82b0046a144c21fc8ab465f015be288e3b7d7 Mon Sep 17 00:00:00 2001 From: NoxWings Date: Wed, 8 Aug 2018 11:53:46 +0200 Subject: [PATCH 071/346] Update get-port types to 4.0 version --- types/get-port/get-port-tests.ts | 4 ++++ types/get-port/index.d.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/get-port/get-port-tests.ts b/types/get-port/get-port-tests.ts index b6e59890d6..53a9e8e69b 100644 --- a/types/get-port/get-port-tests.ts +++ b/types/get-port/get-port-tests.ts @@ -7,3 +7,7 @@ getPort().then(port => { getPort({ port: 3000 }).then(port => { console.log(port); }); + +getPort({ port: [3000, 3001] }).then(port => { + console.log(port); +}); diff --git a/types/get-port/index.d.ts b/types/get-port/index.d.ts index 3f62b90c86..f8adb4851e 100644 --- a/types/get-port/index.d.ts +++ b/types/get-port/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for get-port 3.2 +// Type definitions for get-port 4.0 // Project: https://github.com/sindresorhus/get-port // Definitions by: York Yao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "get-port" { - var getPort: (options?: { port?: number, host?: string }) => PromiseLike + var getPort: (options?: { port?: number | ReadonlyArray, host?: string }) => PromiseLike export = getPort; } From 18e0d40fbdf4b40bee636043d6aab4753f39267e Mon Sep 17 00:00:00 2001 From: Eugene Kulabuhov Date: Thu, 9 Aug 2018 00:00:13 +0300 Subject: [PATCH 072/346] Changed to UMD module https://www.typescriptlang.org/docs/handbook/modules.html#umd-modules Please check related issue: https://github.com/Microsoft/TypeScript/issues/26309 With this change using mapbox-gl without import in a module will throw an error: `[ts] 'mapboxgl' refers to a UMD global, but the current file is a module. Consider adding an import instead.` --- types/mapbox-gl/index.d.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index d85af4fd5a..78ce94cb56 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -6,6 +6,9 @@ /// +export = mapboxgl; +export as namespace mapboxgl; + declare namespace mapboxgl { let accessToken: string; let version: string; @@ -1286,11 +1289,3 @@ declare namespace mapboxgl { 'hillshade-accent-color-transition'?: Transition; } } - -declare module 'mapbox-gl' { - export = mapboxgl; -} - -declare module 'mapbox-gl/dist/mapbox-gl' { - export = mapboxgl; -} From 7406afd1ff686e845b932de889f5066dd5d2e74d Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 8 Aug 2018 15:00:23 -0700 Subject: [PATCH 073/346] Passing `any` to `StaticLifecycle` Passing `any` to `StaticLifecycle` to prevent `{}` type locking on state param of `getDerivedStateFromProps` when using `ComponentType

` --- types/react/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index e6b6c2dbc9..0c64e9fc72 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -60,8 +60,7 @@ declare namespace React { type Ref = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject; - // tslint:disable-next-line:interface-over-type-literal - type ComponentState = any; + type ComponentState = {}; interface Attributes { key?: Key; @@ -356,7 +355,7 @@ declare namespace React { displayName?: string; } - interface ComponentClass

extends StaticLifecycle { + interface ComponentClass

extends StaticLifecycle { new (props: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; From 364acc11c0564c295a0e165d959d30a9a41d7c4c Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 8 Aug 2018 15:01:49 -0700 Subject: [PATCH 074/346] Added back the lint error suppressor --- types/react/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 0c64e9fc72..55ff10f464 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -60,6 +60,7 @@ declare namespace React { type Ref = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject; + // tslint:disable-next-line:interface-over-type-literal type ComponentState = {}; interface Attributes { From 45b4987c5df66270edc88d69f016e9de5642c6e4 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 8 Aug 2018 15:43:43 -0700 Subject: [PATCH 075/346] Revert back to previous commit --- types/react/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 55ff10f464..e6b6c2dbc9 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -61,7 +61,7 @@ declare namespace React { type Ref = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject; // tslint:disable-next-line:interface-over-type-literal - type ComponentState = {}; + type ComponentState = any; interface Attributes { key?: Key; @@ -356,7 +356,7 @@ declare namespace React { displayName?: string; } - interface ComponentClass

extends StaticLifecycle { + interface ComponentClass

extends StaticLifecycle { new (props: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; From 321d420029e1fab488a582432607a858437b6af6 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 8 Aug 2018 15:45:30 -0700 Subject: [PATCH 076/346] Update index.d.ts --- types/react/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index e6b6c2dbc9..5d8233a663 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -60,7 +60,6 @@ declare namespace React { type Ref = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject; - // tslint:disable-next-line:interface-over-type-literal type ComponentState = any; interface Attributes { From a4b70cd857a7181c3cb98920c26ae127111d0450 Mon Sep 17 00:00:00 2001 From: taoqf Date: Thu, 9 Aug 2018 09:51:12 +0800 Subject: [PATCH 077/346] add tests for qiniu-js --- types/qiniu-js/qiniu-js-tests-global.ts | 48 +++++++++++++++++++++++++ types/qiniu-js/tsconfig.json | 3 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 types/qiniu-js/qiniu-js-tests-global.ts diff --git a/types/qiniu-js/qiniu-js-tests-global.ts b/types/qiniu-js/qiniu-js-tests-global.ts new file mode 100644 index 0000000000..e3820d1438 --- /dev/null +++ b/types/qiniu-js/qiniu-js-tests-global.ts @@ -0,0 +1,48 @@ +const file: Blob = null as any; + +const config = { + useCdnDomain: true, + region: qiniu.region.z2 +}; + +const key = 'key'; +const token = 'token'; + +const putExtra = { + fname: "", + params: {}, + mimeType: [] || null +}; + +(() => { + const observable = qiniu.upload(file, key, token, putExtra, config); + + const subscription = observable.subscribe({ + next(res) { }, + complete(res) { }, + error(err) { } + }); // 上传开始 + subscription.unsubscribe(); // 上传取消 +})(); + +(() => { + const observable = qiniu.upload(file, key, token, putExtra, config); + const subscription = observable.subscribe((res) => { }, (err) => { }, (res) => { }); // 这样传参形式也可以 +})(); + +(async () => { + // 图片上传前压缩: + const options = { + quality: 0.92, + noCompressIfLarger: true + // maxWidth: 1000, + // maxHeight: 618 + }; + const data = await qiniu.compressImage(file, options); + const observable = qiniu.upload(data.dist, key, token, putExtra, config); + const subscription = observable.subscribe({ + next(res) { }, + complete(res) { }, + error(err) { } + }); // 上传开始 +})(); diff --git a/types/qiniu-js/tsconfig.json b/types/qiniu-js/tsconfig.json index f8bc0667b7..06bcf7058b 100644 --- a/types/qiniu-js/tsconfig.json +++ b/types/qiniu-js/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "qiniu-js-tests.ts" + "qiniu-js-tests.ts", + "qiniu-js-tests-global.ts" ] } \ No newline at end of file From c87bd1cf77fec8e6613f70374b5d3933be1304c0 Mon Sep 17 00:00:00 2001 From: taoqf Date: Thu, 9 Aug 2018 10:40:32 +0800 Subject: [PATCH 078/346] rename --- .../{qiniu-js-tests-global.ts => qiniu-js-global-tests.ts} | 0 types/qiniu-js/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/qiniu-js/{qiniu-js-tests-global.ts => qiniu-js-global-tests.ts} (100%) diff --git a/types/qiniu-js/qiniu-js-tests-global.ts b/types/qiniu-js/qiniu-js-global-tests.ts similarity index 100% rename from types/qiniu-js/qiniu-js-tests-global.ts rename to types/qiniu-js/qiniu-js-global-tests.ts diff --git a/types/qiniu-js/tsconfig.json b/types/qiniu-js/tsconfig.json index 06bcf7058b..fad7f8fa9b 100644 --- a/types/qiniu-js/tsconfig.json +++ b/types/qiniu-js/tsconfig.json @@ -20,6 +20,6 @@ "files": [ "index.d.ts", "qiniu-js-tests.ts", - "qiniu-js-tests-global.ts" + "qiniu-js-global-tests.ts" ] } \ No newline at end of file From 73218af4d743f14effb770d6d0be9ffa24f2b547 Mon Sep 17 00:00:00 2001 From: taoqf Date: Thu, 9 Aug 2018 10:58:21 +0800 Subject: [PATCH 079/346] move test file --- types/qiniu-js/{ => test}/qiniu-js-global-tests.ts | 0 types/qiniu-js/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/qiniu-js/{ => test}/qiniu-js-global-tests.ts (100%) diff --git a/types/qiniu-js/qiniu-js-global-tests.ts b/types/qiniu-js/test/qiniu-js-global-tests.ts similarity index 100% rename from types/qiniu-js/qiniu-js-global-tests.ts rename to types/qiniu-js/test/qiniu-js-global-tests.ts diff --git a/types/qiniu-js/tsconfig.json b/types/qiniu-js/tsconfig.json index fad7f8fa9b..15efaa0a4c 100644 --- a/types/qiniu-js/tsconfig.json +++ b/types/qiniu-js/tsconfig.json @@ -20,6 +20,6 @@ "files": [ "index.d.ts", "qiniu-js-tests.ts", - "qiniu-js-global-tests.ts" + "test/qiniu-js-global-tests.ts" ] } \ No newline at end of file From f239ccde3717c2b9e24034f91d883ff15d231564 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Fri, 8 Jun 2018 14:14:34 +0200 Subject: [PATCH 080/346] Update N3 typings to n3 1.0.0-beta1 --- types/n3/index.d.ts | 50 ++++++++++++++++++++++++++++------------ types/n3/n3-tests.ts | 54 +++++++++++++++++++++++++------------------- 2 files changed, 66 insertions(+), 38 deletions(-) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 2e038f0878..dd2d5ca394 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -13,7 +13,7 @@ import * as RDF from "rdf-js"; import { EventEmitter } from "events"; export interface Prefixes { - [key: string]: string; + [key: string]: RDF.NamedNode; } export class Term implements RDF.Term { @@ -24,8 +24,6 @@ export class Term implements RDF.Term { toJSON(): string; equals(other: RDF.Term): boolean; static subclass(type: any): void; - static fromId(id: string): NamedNode | BlankNode | Variable | Literal; - static toId(term: string | null | RDF.Term): string; } export class NamedNode extends Term implements RDF.NamedNode { @@ -107,6 +105,8 @@ export const Parser: ParserConstructor; export interface ParserOptions { format?: string; prefixes?: string[]; + factory?: RDF.DataFactory; + baseIRI?: string; } export type ParseCallback = (error: Error, quad: Quad, prefixes: Prefixes) => void; @@ -121,8 +121,20 @@ export interface StreamParserConstructor { } export const StreamParser: StreamParserConstructor; -export interface N3StreamParser extends N3Parser, fs.WriteStream { - pipe(consumer: T): T; +export interface N3StreamParser extends RDF.Stream, NodeJS.WritableStream, RDF.Sink { + // Below are the NodeJS.ReadableStream methods, + // we can not extend the interface directly, + // as `read` clashes with RDF.Sink. + readable: boolean; + // read(size?: number): string | Buffer; // Overwritten by RDF.Stream + setEncoding(encoding: string | null): void; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: NodeJS.WritableStream | RDF.Stream): void; + unshift(chunk: string | Buffer): void; + wrap(oldStream: NodeJS.ReadableStream | RDF.Stream): NodeJS.ReadableStream; } export interface WriterOptions { @@ -144,17 +156,21 @@ export interface N3Writer { addQuad(subject: RDF.Term, predicate: RDF.Term, object: RDF.Term | RDF.Term[], graph?: RDF.Term, done?: () => void): void; addQuad(quad: RDF.Quad): void; addQuads(quads: RDF.Quad[]): void; - end(err?: ErrorCallback, result?: any): void; + end(err?: ErrorCallback, result?: string): void; blank(predicate: RDF.Term, object: RDF.Term): RDF.Term; blank(triple: BlankTriple | RDF.Quad | BlankTriple[] | RDF.Quad[]): RDF.Term; list(triple: RDF.Term[]): RDF.Term[]; } -export function StreamWriter(options: WriterOptions): N3StreamWriter; - -export interface N3StreamWriter extends N3Writer { - pipe(consumer: NodeJS.WritableStream | stream.Writable): void; +export interface StreamWriterConstructor { + new (options?: WriterOptions): N3StreamWriter; + new (fd: any, options?: WriterOptions): N3StreamWriter; + (options?: WriterOptions): N3StreamWriter; + (fd: any, options?: WriterOptions): N3StreamWriter; } +export const StreamWriter: StreamWriterConstructor; + +export interface N3StreamWriter extends NodeJS.ReadWriteStream, RDF.Source {} export interface N3Store extends RDF.Sink { readonly size: number; @@ -177,15 +193,19 @@ export interface N3Store extends RDF.Sink { forObjects(callback: QuadCallback, subject: OTerm, predicate: OTerm, graph: OTerm): void; getGraphs(subject: OTerm, predicate: OTerm, object: OTerm): RDF.Term[]; forGraphs(callback: QuadCallback, subject: OTerm, predicate: OTerm, object: OTerm): void; - createBlankNode(suggestedName: string): BlankNode; + createBlankNode(suggestedName?: string): BlankNode; // match, removeMatches and deleteGraph are missing for full RDF.Store adherence remove(stream: stream.Stream): EventEmitter; } -export function Store(triples?: RDF.Quad[], options?: StoreOptions): N3Store; +export interface StoreConstructor { + new (triples?: RDF.Quad[], options?: StoreOptions): N3Store; + (triples?: RDF.Quad[], options?: StoreOptions): N3Store; +} +export const Store: StoreConstructor; export interface StoreOptions { - prefixes?: Prefixes; + factory?: RDF.DataFactory; } export namespace Util { @@ -195,6 +215,6 @@ export namespace Util { function isVariable(value: RDF.Term | null): boolean; function isDefaultGraph(value: RDF.Term | null): boolean; function inDefaultGraph(value: RDF.Quad): boolean; - function prefix(iri: string): (suffix: string) => RDF.NamedNode; - function prefixes(defaultPrefixes: Prefixes): (iri: string) => (suffix: string) => RDF.NamedNode; + function prefix(iri: string, factory?: RDF.DataFactory): (suffix: string) => RDF.NamedNode; + function prefixes(defaultPrefixes: Prefixes, factory?: RDF.DataFactory): (iri: string) => (suffix: string) => RDF.NamedNode; } diff --git a/types/n3/n3-tests.ts b/types/n3/n3-tests.ts index cdca08b99f..367b602c8a 100644 --- a/types/n3/n3-tests.ts +++ b/types/n3/n3-tests.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import * as stream from "stream"; function test_serialize() { - const writer: N3.N3Writer = N3.Writer( + const writer: N3.N3Writer = new N3.Writer( { format: "ttl", prefixes: { @@ -30,12 +30,12 @@ https://github.com/RubenVerborgh/N3.js/blob/master/README.md */ function test_doc_rdf_to_triples_1() { - const parser = N3.Parser(); + const parser: N3.N3Parser = new N3.Parser(); parser.parse(`@prefix c: . c:Tom a c:Cat. c:Jerry a c:Mouse; c:smarterThan c:Tom.`, - (error: Error, quad: N3.Quad, prefixes: N3.Prefixes) => { + (error: Error, quad: RDF.Quad, prefixes: N3.Prefixes) => { if (quad) console.log(quad.subject, quad.predicate, quad.object, quad.graph, '.'); else @@ -44,22 +44,23 @@ function test_doc_rdf_to_triples_1() { } function test_doc_rdf_to_triples_2() { - const parser1 = N3.Parser({ format: 'N-Triples' }); - const parser2 = N3.Parser({ format: 'application/trig' }); + const parser1: N3.N3Parser = new N3.Parser({ format: 'N-Triples' }); + const parser2: N3.N3Parser = new N3.Parser({ format: 'application/trig' }); // Notation3 (N3) is supported only through the format argument: - const parser3 = N3.Parser({ format: 'N3' }); - const parser4 = N3.Parser({ format: 'Notation3' }); - const parser5 = N3.Parser({ format: 'text/n3' }); + const parser3: N3.N3Parser = N3.Parser({ format: 'N3' }); + const parser4: N3.N3Parser = N3.Parser({ format: 'Notation3' }); + const parser5: N3.N3Parser = N3.Parser({ format: 'text/n3' }); } function test_doc_rdf_stream_to_triples_1() { - const parser = N3.Parser(); + const parser: N3.N3Parser = new N3.Parser(); parser.parse('abc', console.log); - const streamParser = N3.StreamParser(); + const streamParser: N3.N3StreamParser = N3.StreamParser(); + const quad: RDF.Quad = streamParser.read(); const rdfStream = fs.createReadStream('cartoons.ttl'); - rdfStream.pipe(streamParser); + const pipedStreamParser: N3.N3StreamParser = rdfStream.pipe(streamParser); streamParser.pipe(new class SlowConsumer extends stream.Writable { constructor() { super({ objectMode: true }); @@ -72,7 +73,7 @@ function test_doc_rdf_stream_to_triples_1() { } function test_doc_from_triples_to_string() { - const writer = N3.Writer({ prefixes: { c: 'http://example.org/cartoons#' } }); + const writer: N3.N3Writer = new N3.Writer({ prefixes: { c: 'http://example.org/cartoons#' } }); writer.addQuad(N3.DataFactory.quad( N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), @@ -83,14 +84,14 @@ function test_doc_from_triples_to_string() { N3.DataFactory.namedNode('http://example.org/cartoons#name'), N3.DataFactory.literal('Tom'), )); - writer.end((error, result) => { console.log(result); }); + writer.end((error, result: string) => { console.log(result); }); - const writer1 = N3.Writer({ format: 'N-Triples' }); - const writer2 = N3.Writer({ format: 'application/trig' }); + const writer1: N3.N3Writer = N3.Writer({ format: 'N-Triples' }); + const writer2: N3.N3Writer = N3.Writer({ format: 'application/trig' }); } function test_doc_from_triples_to_rdf_stream() { - const writer = N3.Writer(process.stdout, { prefixes: { c: 'http://example.org/cartoons#' } }); + const writer: N3.N3Writer = new N3.Writer(process.stdout, { prefixes: { c: N3.DataFactory.namedNode('http://example.org/cartoons#') } }); writer.addQuad(N3.DataFactory.quad( N3.DataFactory.namedNode('http://example.org/cartoons#Tom'), N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), @@ -105,16 +106,16 @@ function test_doc_from_triples_to_rdf_stream() { } function test_doc_from_triple_stream_to_rdf_stream() { - const streamParser = new N3.StreamParser(); + const streamParser: N3.N3StreamParser = new N3.StreamParser(); const inputStream = fs.createReadStream('cartoons.ttl'); - const streamWriter = /* new */ N3.StreamWriter({ prefixes: { c: 'http://example.org/cartoons#' } }); + const streamWriter: N3.N3StreamWriter = new N3.StreamWriter({ prefixes: { c: N3.DataFactory.namedNode('http://example.org/cartoons#') } }); inputStream.pipe(streamParser); streamParser.pipe(streamWriter); streamWriter.pipe(process.stdout); } function test_doc_blank_nodes_and_lists() { - const writer = N3.Writer({ + const writer: N3.N3Writer = new N3.Writer({ prefixes: { c: 'http://example.org/cartoons#', foaf: 'http://xmlns.com/foaf/0.1/' @@ -142,11 +143,18 @@ function test_doc_blank_nodes_and_lists() { } function test_doc_storing() { - const store = N3.Store(); + const store: N3.N3Store = new N3.Store(); store.addQuad(N3.DataFactory.namedNode('http://ex.org/Pluto'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Dog')); - store.addQuad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse')); + store.addQuad(N3.DataFactory.quad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse'))); + store.addQuads([N3.DataFactory.quad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse'))]); + store.removeQuad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse')); + store.removeQuad(N3.DataFactory.quad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse'))); + store.removeQuads([N3.DataFactory.quad(N3.DataFactory.namedNode('http://ex.org/Mickey'), N3.DataFactory.namedNode('http://ex.org/type'), N3.DataFactory.namedNode('http://ex.org/Mouse'))]); - const mickey = store.getQuads(N3.DataFactory.namedNode('http://ex.org/Mickey'), null, null, null)[0]; + const bnode1: RDF.BlankNode = store.createBlankNode(); + const bnode2: RDF.BlankNode = store.createBlankNode('abc'); + + const mickey: RDF.Quad = store.getQuads(N3.DataFactory.namedNode('http://ex.org/Mickey'), null, null, null)[0]; console.log(mickey.subject, mickey.predicate, mickey.object, '.'); } @@ -169,7 +177,7 @@ function test_doc_utility() { N3Util.isNamedNode(N3.DataFactory.blankNode('b1')); // false N3Util.isLiteral(N3.DataFactory.blankNode('b1')); // false - const prefixes: N3.Prefixes = { rdfs: 'http://www.w3.org/2000/01/rdf-schema#' }; + const prefixes: N3.Prefixes = { rdfs: N3.DataFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#') }; const namedNode1: RDF.NamedNode = N3Util.prefix('http://www.w3.org/2000/01/rdf-schema#')('label'); const namedNode2: RDF.NamedNode = N3Util.prefixes(prefixes)('rdfs')('label'); } From 094f7394b1506af12d18a777b879b07c0f00405c Mon Sep 17 00:00:00 2001 From: mail6543210 Date: Fri, 3 Aug 2018 21:07:41 +0800 Subject: [PATCH 081/346] CopyWebpackPlugin accepts string[] too --- types/copy-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/copy-webpack-plugin/index.d.ts b/types/copy-webpack-plugin/index.d.ts index eedf42f450..59c1b8d0cb 100644 --- a/types/copy-webpack-plugin/index.d.ts +++ b/types/copy-webpack-plugin/index.d.ts @@ -61,7 +61,7 @@ interface CopyWebpackPluginConfiguration { } interface CopyWebpackPlugin { - new (patterns?: CopyPattern[], options?: CopyWebpackPluginConfiguration): Plugin + new (patterns?: (string | CopyPattern)[], options?: CopyWebpackPluginConfiguration): Plugin } declare const copyWebpackPlugin: CopyWebpackPlugin From 641c48d48e5cbe1b9fd22cb3677c32eddf275ad7 Mon Sep 17 00:00:00 2001 From: Thomas den Hollander Date: Thu, 9 Aug 2018 11:55:41 +0200 Subject: [PATCH 082/346] Add types for ttf2woff2 --- types/ttf2woff2/index.d.ts | 10 ++++++++++ types/ttf2woff2/tsconfig.json | 23 +++++++++++++++++++++++ types/ttf2woff2/tslint.json | 1 + types/ttf2woff2/ttf2woff2-tests.ts | 4 ++++ 4 files changed, 38 insertions(+) create mode 100644 types/ttf2woff2/index.d.ts create mode 100644 types/ttf2woff2/tsconfig.json create mode 100644 types/ttf2woff2/tslint.json create mode 100644 types/ttf2woff2/ttf2woff2-tests.ts diff --git a/types/ttf2woff2/index.d.ts b/types/ttf2woff2/index.d.ts new file mode 100644 index 0000000000..be49b9099d --- /dev/null +++ b/types/ttf2woff2/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for ttf2woff2 2.0 +// Project: https://github.com/nfroidure/ttf2woff2 +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function ttf2woff2(inputContent: Buffer): Buffer; + +export = ttf2woff2; diff --git a/types/ttf2woff2/tsconfig.json b/types/ttf2woff2/tsconfig.json new file mode 100644 index 0000000000..0b6fc9778b --- /dev/null +++ b/types/ttf2woff2/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "ttf2woff2-tests.ts" + ] +} diff --git a/types/ttf2woff2/tslint.json b/types/ttf2woff2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ttf2woff2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ttf2woff2/ttf2woff2-tests.ts b/types/ttf2woff2/ttf2woff2-tests.ts new file mode 100644 index 0000000000..71b5a16d65 --- /dev/null +++ b/types/ttf2woff2/ttf2woff2-tests.ts @@ -0,0 +1,4 @@ +import ttf2woff2 = require('ttf2woff2'); + +const input = Buffer.alloc(10); +const result: Buffer = ttf2woff2(input); From 9b8b697b902638e8bc8a4b88b3e557d3b048dfdb Mon Sep 17 00:00:00 2001 From: yasupeke Date: Thu, 9 Aug 2018 21:30:43 +0900 Subject: [PATCH 083/346] update react-paginate --- types/react-paginate/index.d.ts | 13 +- types/react-paginate/react-paginate-tests.tsx | 4 +- types/react-paginate/tsconfig.json | 12 +- types/react-paginate/v4/index.d.ts | 125 ++++++++++++++++++ .../v4/react-paginate-tests.tsx | 33 +++++ types/react-paginate/v4/tsconfig.json | 30 +++++ types/react-paginate/v4/tslint.json | 1 + 7 files changed, 202 insertions(+), 16 deletions(-) create mode 100644 types/react-paginate/v4/index.d.ts create mode 100644 types/react-paginate/v4/react-paginate-tests.tsx create mode 100644 types/react-paginate/v4/tsconfig.json create mode 100644 types/react-paginate/v4/tslint.json diff --git a/types/react-paginate/index.d.ts b/types/react-paginate/index.d.ts index 83d8c476c9..0e0daa376a 100644 --- a/types/react-paginate/index.d.ts +++ b/types/react-paginate/index.d.ts @@ -1,11 +1,8 @@ -// Type definitions for react-paginate 4.3 +// Type definitions for react-paginate 5.2 // Project: https://github.com/AdeleD/react-paginate -// Definitions by: Simon Hartcher -// Wouter Hardeman -// pegel03 -// Simon Archer +// Definitions by: Yasunori Ohoka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import * as React from 'react'; @@ -48,7 +45,7 @@ interface ReactPaginateProps { /** * The method to call when a page is clicked. Exposes the current page object as an argument. */ - onPageChange?(selectedItem: {selected: number}): void; + onPageChange?(selectedItem: { selected: number }): void; /** * The initial page selected. @@ -122,4 +119,4 @@ interface ReactPaginateProps { } declare const ReactPaginate: React.ComponentClass; -export = ReactPaginate; +export default ReactPaginate; diff --git a/types/react-paginate/react-paginate-tests.tsx b/types/react-paginate/react-paginate-tests.tsx index 92d8659c0c..a98e8702a4 100644 --- a/types/react-paginate/react-paginate-tests.tsx +++ b/types/react-paginate/react-paginate-tests.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; -import ReactPaginate = require("react-paginate"); +import * as React from 'react'; +import ReactPaginate from 'react-paginate'; class Test extends React.Component { render() { diff --git a/types/react-paginate/tsconfig.json b/types/react-paginate/tsconfig.json index 5653cee275..5c49c56d9e 100644 --- a/types/react-paginate/tsconfig.json +++ b/types/react-paginate/tsconfig.json @@ -1,8 +1,4 @@ { - "files": [ - "index.d.ts", - "react-paginate-tests.tsx" - ], "compilerOptions": { "module": "commonjs", "lib": [ @@ -21,5 +17,9 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "jsx": "react" - } -} \ No newline at end of file + }, + "files": [ + "index.d.ts", + "react-paginate-tests.tsx" + ] + } diff --git a/types/react-paginate/v4/index.d.ts b/types/react-paginate/v4/index.d.ts new file mode 100644 index 0000000000..736455f60f --- /dev/null +++ b/types/react-paginate/v4/index.d.ts @@ -0,0 +1,125 @@ +// Type definitions for react-paginate 4.3 +// Project: https://github.com/AdeleD/react-paginate +// Definitions by: Simon Hartcher +// Wouter Hardeman +// pegel03 +// Simon Archer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +interface ReactPaginateProps { + /** + * The total number of pages. + */ + pageCount: number; + + /** + * The range of pages displayed. + */ + pageRangeDisplayed: number; + + /** + * The number of pages to display for margins. + */ + marginPagesDisplayed: number; + + /** + * Label for the `previous` button. + */ + previousLabel?: string | JSX.Element; + + /** + * Label for the `next` button. + */ + nextLabel?: string | JSX.Element; + + /** + * Label for ellipsis. + */ + breakLabel?: string | JSX.Element; + + /** + * The classname on tag `li` of the ellipsis element. + */ + breakClassName?: string | JSX.Element; + + /** + * The method to call when a page is clicked. Exposes the current page object as an argument. + */ + onPageChange?(selectedItem: { selected: number }): void; + + /** + * The initial page selected. + */ + initialPage?: number; + + /** + * To override selected page with parent prop. + */ + forcePage?: number; + + /** + * Disable onPageChange callback with initial page. Default: false + */ + disableInitialCallback?: boolean; + + /** + * The classname of the pagination container. + */ + containerClassName?: string; + + /** + * The classname on tag `li` of each page element. + */ + pageClassName?: string; + + /** + * The classname on tag `a` of each page element. + */ + pageLinkClassName?: string; + + /** + * The classname for the active page. + */ + activeClassName?: string; + + /** + * The classname on tag `li` of the `previous` button. + */ + previousClassName?: string; + + /** + * The classname on tag `li` of the `next` button. + */ + nextClassName?: string; + + /** + * The classname on tag `a` of the `previous` button. + */ + previousLinkClassName?: string; + + /** + * The classname on tag `a` of the `next` button. + */ + nextLinkClassName?: string; + + /** + * The classname for disabled `previous` and `next` buttons. + */ + disabledClassName?: string; + + /** + * The method is called to generate the href attribute value on tag a of each page element. + */ + hrefBuilder?(pageIndex: number): void; + + /** + * Extra context to add to the aria-label HTML attribute. + */ + extraAriaContext?: string; +} + +declare const ReactPaginate: React.ComponentClass; +export = ReactPaginate; diff --git a/types/react-paginate/v4/react-paginate-tests.tsx b/types/react-paginate/v4/react-paginate-tests.tsx new file mode 100644 index 0000000000..130db0248c --- /dev/null +++ b/types/react-paginate/v4/react-paginate-tests.tsx @@ -0,0 +1,33 @@ +import * as React from 'react'; +import ReactPaginate = require('react-paginate'); + +class Test extends React.Component { + render() { + return ( + null} + initialPage={2} + forcePage={3} + disableInitialCallback={false} + containerClassName={'container'} + pageClassName={'page-li'} + pageLinkClassName={'page-a'} + activeClassName={'active'} + previousClassName={'previous-li'} + nextClassName={'next-li'} + previousLinkClassName={'previous-a'} + nextLinkClassName={'next-a'} + disabledClassName={'disabled'} + hrefBuilder={(pageIndex: number) => null} + extraAriaContext={'aria'} + /> + ); + } +} diff --git a/types/react-paginate/v4/tsconfig.json b/types/react-paginate/v4/tsconfig.json new file mode 100644 index 0000000000..d6ee7a0357 --- /dev/null +++ b/types/react-paginate/v4/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "react-paginate": [ + "react-paginate/v4" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-paginate-tests.tsx" + ] +} diff --git a/types/react-paginate/v4/tslint.json b/types/react-paginate/v4/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-paginate/v4/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9afc9e1cdd15d3b8278929858de0b4f44149afd8 Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 16:41:45 +0300 Subject: [PATCH 084/346] Added vue-select support. --- types/vue-select/index.d.ts | 98 ++++++++++++++++++++++++++++ types/vue-select/package.json | 6 ++ types/vue-select/tsconfig.json | 22 +++++++ types/vue-select/tslint.json | 1 + types/vue-select/vue-select-tests.ts | 11 ++++ types/vue2-datepicker/package.json | 3 +- 6 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 types/vue-select/index.d.ts create mode 100644 types/vue-select/package.json create mode 100644 types/vue-select/tsconfig.json create mode 100644 types/vue-select/tslint.json create mode 100644 types/vue-select/vue-select-tests.ts diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts new file mode 100644 index 0000000000..f43da99cf1 --- /dev/null +++ b/types/vue-select/index.d.ts @@ -0,0 +1,98 @@ +// Type definitions for vue-select 2.4.0 +// Project: https://github.com/sagalbot/vue-select#readme +// Definitions by: Ilia Beliaev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Typescript version: 2.4.0 + +export default VueSelect; + +export type Option = string | any | null; + +export type OptionConsumer = (option: Option) => void; + +export interface VueSelectProps { + value: Option; + options: Option[]; + disabled: boolean; + maxHeight: string; + searchable: boolean; + multiple: boolean; + placeholder: string; + transition: string; + clearSearchOnSelect: boolean; + closeOnSelect: boolean; + label: boolean; + getOptionLabel: (option: Option) => string; + onChange: OptionConsumer; + taggable: boolean; + tabindex: number | null; + pushTags: boolean; + filterable: boolean; + createOption: (option: Option) => Option; + resetOnOptionsChange: boolean; + noDrop: boolean; + inputId: string | null; + dir: string; +} + +export interface VueSelectData { + search: string; + open: boolean; + mutableValue: Option; + mutableOptions: Option[]; +} + +export interface VueSelectWatch { + value: (val: Option) => void; + mutableValue: (val: Option, old: Option) => void; + options: (val: Option) => void; + mutableOptions: () => void; + multiple: (reset: boolean) => void; + created: () => void; +} + +export interface VueSelectMethods { + select: OptionConsumer; + deselect: OptionConsumer; + clearSelection: () => void; + onAfterSelect: OptionConsumer; + toggleDropdown: (e: Event) => void; + isOptionSelected: (option: Option) => boolean; + onEscape: () => void; + onSearchBlur: () => void; + onSearchFocus: () => void; + maybeDeleteValue: () => void; + optionExists: (option: Option) => boolean; + maybePushTag: OptionConsumer; +} + +export interface VueSelectComputed { + dropdownClasses: () => DropdownClasses; + clearSearchOnBlur: () => boolean; + searching: () => boolean; + dropdownOpen: () => boolean; + searchPlaceholder: () => boolean; + filteredOptions: () => Option[]; + isValueEmpty: () => boolean; + valueAsArray: () => Option[]; + showClearButton: () => boolean; +} + +export interface DropdownClasses { + open: boolean; + single: boolean; + searching: boolean; + searchable: boolean; + unsearchable: boolean; + loading: boolean; + rtl: boolean; + disabled: boolean; +} + +export const VueSelect: { + props: VueSelectProps, + data: () => VueSelectData, + watch: VueSelectWatch, + methods: VueSelectMethods, + computed: VueSelectComputed, +} diff --git a/types/vue-select/package.json b/types/vue-select/package.json new file mode 100644 index 0000000000..faefc1b2f7 --- /dev/null +++ b/types/vue-select/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "vue": ">=2.0.0" + } +} diff --git a/types/vue-select/tsconfig.json b/types/vue-select/tsconfig.json new file mode 100644 index 0000000000..c757293eec --- /dev/null +++ b/types/vue-select/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "vue-select-tests.ts" + ] +} diff --git a/types/vue-select/tslint.json b/types/vue-select/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/vue-select/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/vue-select/vue-select-tests.ts b/types/vue-select/vue-select-tests.ts new file mode 100644 index 0000000000..fd4374b9cd --- /dev/null +++ b/types/vue-select/vue-select-tests.ts @@ -0,0 +1,11 @@ +import Vue from 'vue'; + +new Vue({ + el: '#app', + components: { + 'vue-select': VueSelect + }, + template: { + '' + } +}); diff --git a/types/vue2-datepicker/package.json b/types/vue2-datepicker/package.json index faefc1b2f7..5453d4179e 100644 --- a/types/vue2-datepicker/package.json +++ b/types/vue2-datepicker/package.json @@ -2,5 +2,6 @@ "private": true, "dependencies": { "vue": ">=2.0.0" - } + }, + "typeScriptVersion": "2.4.0" } From a4f1fac64bd1f745c2729ea1fc3f3cfe6406eb7c Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 16:54:32 +0300 Subject: [PATCH 085/346] Fixed to work properly with lint. --- types/vue-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts index f43da99cf1..5934393505 100644 --- a/types/vue-select/index.d.ts +++ b/types/vue-select/index.d.ts @@ -94,5 +94,5 @@ export const VueSelect: { data: () => VueSelectData, watch: VueSelectWatch, methods: VueSelectMethods, - computed: VueSelectComputed, + computed: VueSelectComputed } From 1ff7ad1434054de6fd4d95e408cb4b6e1f6850b1 Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 16:54:57 +0300 Subject: [PATCH 086/346] Fixed to work properly with lint. --- types/vue-select/index.d.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts index 5934393505..9a4e81d4f2 100644 --- a/types/vue-select/index.d.ts +++ b/types/vue-select/index.d.ts @@ -4,8 +4,12 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Typescript version: 2.4.0 +import {VueConstructor} from 'vue'; + export default VueSelect; +export const VueSelect: VueSelectConstructor; + export type Option = string | any | null; export type OptionConsumer = (option: Option) => void; @@ -89,10 +93,10 @@ export interface DropdownClasses { disabled: boolean; } -export const VueSelect: { - props: VueSelectProps, - data: () => VueSelectData, - watch: VueSelectWatch, - methods: VueSelectMethods, - computed: VueSelectComputed +export interface VueSelectConstructor extends VueConstructor{ + props: VueSelectProps; + data: () => VueSelectData; + watch: VueSelectWatch; + methods: VueSelectMethods; + computed: VueSelectComputed; } From a85aec2a7afb85edb9b163e6368b6dc2092ef344 Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 17:14:22 +0300 Subject: [PATCH 087/346] Changed type from string | any to any. --- types/vue-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts index 9a4e81d4f2..a718686d26 100644 --- a/types/vue-select/index.d.ts +++ b/types/vue-select/index.d.ts @@ -10,7 +10,7 @@ export default VueSelect; export const VueSelect: VueSelectConstructor; -export type Option = string | any | null; +export type Option = any | null; export type OptionConsumer = (option: Option) => void; From cf0e059ca109cfefecdfca2e68ca9d4efafdc8ea Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 18:43:52 +0300 Subject: [PATCH 088/346] Fixed label type. Added tests. --- types/vue-select/index.d.ts | 2 +- types/vue-select/vue-select-tests.ts | 62 ++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts index a718686d26..51ae9e4d56 100644 --- a/types/vue-select/index.d.ts +++ b/types/vue-select/index.d.ts @@ -25,7 +25,7 @@ export interface VueSelectProps { transition: string; clearSearchOnSelect: boolean; closeOnSelect: boolean; - label: boolean; + label: string; getOptionLabel: (option: Option) => string; onChange: OptionConsumer; taggable: boolean; diff --git a/types/vue-select/vue-select-tests.ts b/types/vue-select/vue-select-tests.ts index fd4374b9cd..17cf97b2be 100644 --- a/types/vue-select/vue-select-tests.ts +++ b/types/vue-select/vue-select-tests.ts @@ -1,11 +1,67 @@ import Vue from 'vue'; +import VueSelect, {Option} from 'vue-select'; + +const options = [ + { + name: 'SomeName' + }, + { + name: 'SomeName2' + } +] new Vue({ + el: '#app', + data: { + options, + value: null, + + }, components: { 'vue-select': VueSelect }, - template: { - '' - } + methods: { + getOptionLabel(option: Option) { + if (option && option.name) { + return option.name; + } + return ''; + }, + optionConsumer(option: Option) { + }, + optionToOption(option: Option) { + return option; + }, + onSearch(search: string, loading: (b: boolean) => void) { + loading(true); + } + }, + template: ` + + +` }); From e5d5e3587ce0b67f462ff8d450697ce14baee894 Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 18:48:34 +0300 Subject: [PATCH 089/346] Linting. --- types/vue-select/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts index 51ae9e4d56..331fa7ec92 100644 --- a/types/vue-select/index.d.ts +++ b/types/vue-select/index.d.ts @@ -93,10 +93,10 @@ export interface DropdownClasses { disabled: boolean; } -export interface VueSelectConstructor extends VueConstructor{ - props: VueSelectProps; - data: () => VueSelectData; - watch: VueSelectWatch; - methods: VueSelectMethods; - computed: VueSelectComputed; +export interface VueSelectConstructor extends VueConstructor { + props: VueSelectProps; + data: () => VueSelectData; + watch: VueSelectWatch; + methods: VueSelectMethods; + computed: VueSelectComputed; } From 4804bb8762075ade689322260fd9f3d9a656ccb1 Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Thu, 9 Aug 2018 18:51:03 +0300 Subject: [PATCH 090/346] Reverted accidental change. --- types/vue2-datepicker/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/vue2-datepicker/package.json b/types/vue2-datepicker/package.json index 5453d4179e..faefc1b2f7 100644 --- a/types/vue2-datepicker/package.json +++ b/types/vue2-datepicker/package.json @@ -2,6 +2,5 @@ "private": true, "dependencies": { "vue": ">=2.0.0" - }, - "typeScriptVersion": "2.4.0" + } } From 21df98f98ff0385b3253641150e604c6ccbe80c1 Mon Sep 17 00:00:00 2001 From: Viktor Taranenko Date: Thu, 9 Aug 2018 17:55:39 +0100 Subject: [PATCH 091/346] Added forEach variant returning promise According to line 731 in [source](http://mongodb.github.io/node-mongodb-native/3.1/api/lib_cursor.js.html), callback is optional and if not provided, the fuction returns Promise --- types/mongodb/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index cba04cb046..5791b906f1 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1268,6 +1268,7 @@ export class Cursor extends Readable { filter(filter: Object): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#forEach */ forEach(iterator: IteratorCallback, callback: EndCallback): void; + forEach(iterator: IteratorCallback): Promise; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#hasNext */ hasNext(): Promise; hasNext(callback: MongoCallback): void; From c6192b5b9452356c48127438bfe73372028c699b Mon Sep 17 00:00:00 2001 From: Dima Danyliuk Date: Thu, 9 Aug 2018 20:52:49 +0300 Subject: [PATCH 092/346] Improve declaration file for "react-input-mask" - move declaration for previous major version into v1 folder - remove module declaration construction --- types/react-input-mask/index.d.ts | 102 +++++++++++------- .../react-input-mask-tests.tsx | 12 +-- types/react-input-mask/tslint.json | 4 +- types/react-input-mask/v1/index.d.ts | 49 +++++++++ .../v1/react-input-mask-tests.tsx | 13 +++ .../react-input-mask/{v2 => v1}/tsconfig.json | 2 +- types/react-input-mask/v1/tslint.json | 1 + types/react-input-mask/v2/index.d.ts | 75 ------------- .../v2/react-input-mask-tests.tsx | 13 --- types/react-input-mask/v2/tslint.json | 3 - 10 files changed, 136 insertions(+), 138 deletions(-) create mode 100644 types/react-input-mask/v1/index.d.ts create mode 100644 types/react-input-mask/v1/react-input-mask-tests.tsx rename types/react-input-mask/{v2 => v1}/tsconfig.json (91%) create mode 100644 types/react-input-mask/v1/tslint.json delete mode 100644 types/react-input-mask/v2/index.d.ts delete mode 100644 types/react-input-mask/v2/react-input-mask-tests.tsx delete mode 100644 types/react-input-mask/v2/tslint.json diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index c09719f871..ff618e8749 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -1,49 +1,73 @@ -// Type definitions for react-input-mask 1.2 +// Type definitions for react-input-mask 2.0 // Project: https://github.com/sanniassin/react-input-mask // Definitions by: Alexandre Paré +// Dima Danylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 -import * as React from "react"; +import * as React from 'react'; -declare namespace ReactInputMask { - interface Props extends React.InputHTMLAttributes { - /** - * Mask string. Format characters are: - * * `9`: `0-9` - * * `a`: `A-Z, a-z` - * * `\*`: `A-Z, a-z, 0-9` - * - * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. - * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` - */ - mask: string; - /** - * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input. - */ - maskChar?: string | null; - /** - * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones: - * ``` - * { - * "9": "[0-9]", - * "a": "[A-Za-z]", - * "*": "[A-Za-z0-9]" - * }``` - */ - formatChars?: { [key: string]: string }; - /** - * Show mask even in empty input without focus. - */ - alwaysShowMask?: boolean; - /** - * Use inputRef instead of ref if you need input node to manage focus, selection, etc. - */ - inputRef?: React.Ref; - } +export interface InputState { + value: string; + selection: Selection; } -declare class ReactInputMask extends React.Component { +export interface MaskOptions { + mask: string; + maskChar: string; + alwaysShowMask: boolean; + formatChars: Record; + permanents: number[]; +} + +interface Props extends React.InputHTMLAttributes { + /** + * Mask string. Format characters are: + * * `9`: `0-9` + * * `a`: `A-Z, a-z` + * * `\*`: `A-Z, a-z, 0-9` + * + * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. + * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` + */ + mask: string; + /** + * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input. + */ + maskChar?: string | null; + /** + * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones: + * ``` + * { + * "9": "[0-9]", + * "a": "[A-Za-z]", + * "*": "[A-Za-z0-9]" + * }``` + */ + formatChars?: { [key: string]: string }; + /** + * Show mask even in empty input without focus. + */ + alwaysShowMask?: boolean; + /** + * Use inputRef instead of ref if you need input node to manage focus, selection, etc. + */ + inputRef?: React.Ref; + + /** + * In case you need to implement more complex masking behavior, you can provide + * beforeMaskedValueChange function to change masked value and cursor position + * before it will be applied to the input. + */ + beforeMaskedValueChange?( + newState: InputState, + oldState: InputState, + userInput: string, + maskOptions: MaskOptions, + ): InputState; +} + +export class ReactInputMask extends React.Component { } export default ReactInputMask; diff --git a/types/react-input-mask/react-input-mask-tests.tsx b/types/react-input-mask/react-input-mask-tests.tsx index a34b15ac99..93c6b1f638 100644 --- a/types/react-input-mask/react-input-mask-tests.tsx +++ b/types/react-input-mask/react-input-mask-tests.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; let ref: HTMLInputElement | null = null;

- - - - - - ref = node} /> + + + + + + ref = node} />
; diff --git a/types/react-input-mask/tslint.json b/types/react-input-mask/tslint.json index 3db14f85ea..f93cf8562a 100644 --- a/types/react-input-mask/tslint.json +++ b/types/react-input-mask/tslint.json @@ -1 +1,3 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json" +} diff --git a/types/react-input-mask/v1/index.d.ts b/types/react-input-mask/v1/index.d.ts new file mode 100644 index 0000000000..c09719f871 --- /dev/null +++ b/types/react-input-mask/v1/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for react-input-mask 1.2 +// Project: https://github.com/sanniassin/react-input-mask +// Definitions by: Alexandre Paré +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +declare namespace ReactInputMask { + interface Props extends React.InputHTMLAttributes { + /** + * Mask string. Format characters are: + * * `9`: `0-9` + * * `a`: `A-Z, a-z` + * * `\*`: `A-Z, a-z, 0-9` + * + * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. + * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` + */ + mask: string; + /** + * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input. + */ + maskChar?: string | null; + /** + * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones: + * ``` + * { + * "9": "[0-9]", + * "a": "[A-Za-z]", + * "*": "[A-Za-z0-9]" + * }``` + */ + formatChars?: { [key: string]: string }; + /** + * Show mask even in empty input without focus. + */ + alwaysShowMask?: boolean; + /** + * Use inputRef instead of ref if you need input node to manage focus, selection, etc. + */ + inputRef?: React.Ref; + } +} + +declare class ReactInputMask extends React.Component { +} + +export default ReactInputMask; diff --git a/types/react-input-mask/v1/react-input-mask-tests.tsx b/types/react-input-mask/v1/react-input-mask-tests.tsx new file mode 100644 index 0000000000..a34b15ac99 --- /dev/null +++ b/types/react-input-mask/v1/react-input-mask-tests.tsx @@ -0,0 +1,13 @@ +import ReactInputMask from 'react-input-mask'; +import * as React from 'react'; + +let ref: HTMLInputElement | null = null; + +
+ + + + + + ref = node} /> +
; diff --git a/types/react-input-mask/v2/tsconfig.json b/types/react-input-mask/v1/tsconfig.json similarity index 91% rename from types/react-input-mask/v2/tsconfig.json rename to types/react-input-mask/v1/tsconfig.json index 8b19948640..fddba7dc87 100644 --- a/types/react-input-mask/v2/tsconfig.json +++ b/types/react-input-mask/v1/tsconfig.json @@ -18,7 +18,7 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": { - "react-input-mask": ["react-input-mask/v2"] + "react-input-mask": ["react-input-mask/v1"] } }, "files": [ diff --git a/types/react-input-mask/v1/tslint.json b/types/react-input-mask/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-input-mask/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-input-mask/v2/index.d.ts b/types/react-input-mask/v2/index.d.ts deleted file mode 100644 index 5f36857eac..0000000000 --- a/types/react-input-mask/v2/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Type definitions for react-input-mask 2.0.3 -// Project: https://github.com/sanniassin/react-input-mask -// Definitions by: Alexandre Paré -// Dima Danylyuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.9.2 - -declare module 'react-input-mask' { - import * as React from 'react'; - - export interface InputState { - value: string; - selection: Selection; - } - - export interface MaskOptions { - mask: string; - maskChar: string; - alwaysShowMask: boolean; - formatChars: Record; - permanents: number[]; - } - - interface Props extends React.InputHTMLAttributes { - /** - * Mask string. Format characters are: - * * `9`: `0-9` - * * `a`: `A-Z, a-z` - * * `\*`: `A-Z, a-z, 0-9` - * - * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. - * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` - */ - mask: string; - /** - * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input. - */ - maskChar?: string | null; - /** - * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones: - * ``` - * { - * "9": "[0-9]", - * "a": "[A-Za-z]", - * "*": "[A-Za-z0-9]" - * }``` - */ - formatChars?: { [key: string]: string }; - /** - * Show mask even in empty input without focus. - */ - alwaysShowMask?: boolean; - /** - * Use inputRef instead of ref if you need input node to manage focus, selection, etc. - */ - inputRef?: React.Ref; - - /** - * In case you need to implement more complex masking behavior, you can provide - * beforeMaskedValueChange function to change masked value and cursor position - * before it will be applied to the input. - */ - beforeMaskedValueChange?( - newState: InputState, - oldState: InputState, - userInput: string, - maskOptions: MaskOptions, - ): InputState; - } - - class ReactInputMask extends React.Component { - } - - export default ReactInputMask; -} diff --git a/types/react-input-mask/v2/react-input-mask-tests.tsx b/types/react-input-mask/v2/react-input-mask-tests.tsx deleted file mode 100644 index 93c6b1f638..0000000000 --- a/types/react-input-mask/v2/react-input-mask-tests.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import ReactInputMask from 'react-input-mask'; -import * as React from 'react'; - -let ref: HTMLInputElement | null = null; - -
- - - - - - ref = node} /> -
; diff --git a/types/react-input-mask/v2/tslint.json b/types/react-input-mask/v2/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/react-input-mask/v2/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} From bd9ef16dc64641c01241e2800959d10e40b3fc2b Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:00:34 -0600 Subject: [PATCH 093/346] Fix return types for SObject.delete --- types/jsforce/salesforce-object.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index ab3e398891..1c79b367eb 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -43,9 +43,9 @@ export class SObject { count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Promise; create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; createBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - del(ids: string | string[], callback?: (err: Error, ret: any) => void): void; - destroy(ids: string | string[], callback?: (err: Error, ret: any) => void): void; - delete(ids: string | string[], callback?: (err: Error, ret: any) => void): void; + del(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; + destroy(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; + delete(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; deleteBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; destroyBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; destroyHardBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; From 5cab80238224c47376e329a93d307f3763164349 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:01:37 -0600 Subject: [PATCH 094/346] Fix return type for SObject.find --- types/jsforce/salesforce-object.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 1c79b367eb..e3e91e11b9 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -19,9 +19,9 @@ export class SObject { upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; upsertBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult[] | BatchResultInfo[]) => void): Batch; - find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; findOne(query?: any, callback?: (err: Error, ret: T) => void): Query; findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): Query; From 6000babd03674f891b4eb3f4b64b2e7674c0a080 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:10:28 -0600 Subject: [PATCH 095/346] Add SObject.updated --- types/jsforce/salesforce-object.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index e3e91e11b9..1f5d9fe691 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -15,6 +15,7 @@ export class SObject { retrieve(ids: SalesforceId[], options?: Object, callback?: (err: Error, ret: Array>) => void): Promise>>; update(record: Partial, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; update(records: Array>, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; + updated(start: string | Date, end: string | Date, callback?: (err: Error, ret: UpdatedRecordsInfo) => void): Promise; upsert(records: Record, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; upsertBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult[] | BatchResultInfo[]) => void): Batch; @@ -75,6 +76,11 @@ export class SObject { select(fields?: {[P in keyof T]: boolean} | Array<(keyof T)> | (keyof T), callback?: (err: Error, ret: Array>) => void): Query>>; } +export interface UpdatedRecordsInfo { + latestDateCovered: string; + ids: string[]; +} + export interface ApprovalLayoutInfo { approvalLayouts: Object[]; } From 5435c92c4e3166b261e6043dd6d41887c22867d1 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:17:09 -0600 Subject: [PATCH 096/346] Fix callback types for SObject cached calls --- types/jsforce/salesforce-object.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 1f5d9fe691..b440f35ffb 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -30,14 +30,14 @@ export class SObject { approvalLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.approvalLayouts */ - (callback?: (layoutInfo: ApprovalLayoutInfo) => void): ApprovalLayoutInfo; + (callback?: (err: Error, layoutInfo: ApprovalLayoutInfo) => void): ApprovalLayoutInfo; clear(): void; } approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream[] | string[], callback?: (err: Error, ret: RecordResult) => void): Batch; compactLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.compactLayouts */ - (callback?: CompactLayoutInfo): CompactLayoutInfo; + (callback?: (err: Error, layoutInfo: CompactLayoutInfo) => void): CompactLayoutInfo; clear(): void; } compactLayouts(callback?: CompactLayoutInfo): Promise; From f8e512b1a58be12c3dc33ac2523b22899a381aae Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:25:18 -0600 Subject: [PATCH 097/346] Add SObject.updateBulk --- types/jsforce/salesforce-object.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index b440f35ffb..3927633ab4 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -15,6 +15,7 @@ export class SObject { retrieve(ids: SalesforceId[], options?: Object, callback?: (err: Error, ret: Array>) => void): Promise>>; update(record: Partial, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; update(records: Array>, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; + updateBulk(input?: Record[] | stream.Stream | string, callback?: (err: Error, ret: RecordResult[]) => void): Batch; updated(start: string | Date, end: string | Date, callback?: (err: Error, ret: UpdatedRecordsInfo) => void): Promise; upsert(records: Record, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; From 6c3c77049cadebd2474379ef41b843f66e582039 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:29:47 -0600 Subject: [PATCH 098/346] Update SObject.bulkload signature --- types/jsforce/salesforce-object.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 3927633ab4..4664846033 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -35,7 +35,7 @@ export class SObject { clear(): void; } approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; - bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream[] | string[], callback?: (err: Error, ret: RecordResult) => void): Batch; + bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult[]) => void): Batch; compactLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.compactLayouts */ (callback?: (err: Error, layoutInfo: CompactLayoutInfo) => void): CompactLayoutInfo; From d8bb141cf5fa85fd8378f965b1ae0d6a7b477599 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:32:13 -0600 Subject: [PATCH 099/346] Update return type for SObject.count --- types/jsforce/salesforce-object.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 4664846033..96dd3258f9 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -42,7 +42,7 @@ export class SObject { clear(): void; } compactLayouts(callback?: CompactLayoutInfo): Promise; - count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Promise; + count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Query; create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; createBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; del(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; From 5710e1b5c8bdb88f28895101a7d5887078acdf32 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 12:50:52 -0600 Subject: [PATCH 100/346] Update SObject.destroy methods --- types/jsforce/salesforce-object.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 96dd3258f9..560a16bffd 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -45,9 +45,12 @@ export class SObject { count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Query; create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; createBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - del(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; - destroy(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; - delete(ids: string | string[], callback?: (err: Error, ret: any) => void): Promise; + del(id: string, callback?: (err: Error, ret: RecordResult) => void): Promise; + del(ids: string[], callback?: (err: Error, ret: RecordResult[]) => void): Promise; + destroy(id: string, callback?: (err: Error, ret: RecordResult) => void): Promise; + destroy(ids: string[], callback?: (err: Error, ret: RecordResult[]) => void): Promise; + delete(id: string, callback?: (err: Error, ret: RecordResult) => void): Promise; + delete(ids: string[], callback?: (err: Error, ret: RecordResult[]) => void): Promise; deleteBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; destroyBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; destroyHardBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; From 97c858eb3695351848eac3073df8bc7e457bd8d2 Mon Sep 17 00:00:00 2001 From: Igor Belagorudsky Date: Thu, 9 Aug 2018 15:04:34 -0400 Subject: [PATCH 101/346] auth0-js: added mode to AuthorizeOptions --- types/auth0-js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index e66cd5f712..033a4bcbde 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -762,6 +762,7 @@ export interface AuthorizeOptions { audience?: string; language?: string; prompt?: string; + mode?: "login" | "signUp"; } export interface CheckSessionOptions extends AuthorizeOptions { From f7b8364e3cdc8b8c60aea9bf01de429e839ee779 Mon Sep 17 00:00:00 2001 From: Gregory Ristow Date: Thu, 9 Aug 2018 15:38:10 -0400 Subject: [PATCH 102/346] fix(rethinkdb): Add getAll overloads for compound-index keys --- types/rethinkdb/index.d.ts | 102 +++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 4 deletions(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index 0f0358cb32..820c1b5f11 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -268,11 +268,105 @@ declare module "rethinkdb" { insert(obj: any, options?: InsertOptions): Operation; get(key: string): Operation & Writeable; + + /** + * Get all documents matching one or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(...keys: string[]): Sequence; + /** + * Get all documents matching a key on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ getAll(key: string, index?: Index): Sequence; // without index defaults to primary key - getAll(...keys: string[]): Sequence; - getAll(...keys: string[]): Sequence; - getAll(keys: Expression): Sequence; - getAll(key: Expression): Sequence; + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(key: string, key2: string, index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(key: string, key2: string, key3: string, index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(key: string, key2: string, key3: string, key4: string, index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll( + key: string, + key2: string, + key3: string, + key4: string, + key5: string, + index?: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching a compound index key. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(compoundKey: string[], index: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(compoundKey: string[], compoundKey2: string[], index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll( + compoundKey: string[], + compoundKey2: string[], + compoundKey3: string[], + index: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll( + compoundKey: string[], + compoundKey2: string[], + compoundKey3: string[], + compoundKey4: string[], + index: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll( + compoundKey: string[], + compoundKey2: string[], + compoundKey3: string[], + compoundKey4: string[], + compoundKey5: string[], + index: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching a key on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(key: Expression, index?: Index): Sequence; + /** + * Get all documents matching a key on a compound index; index must be provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(keys: Expression, index: Index): Sequence; + getIntersecting(geometry: Geometry, index: Index): Sequence; wait(WaitOptions?: WaitOptions): Operation; From 534d41d8624ec4431ed990e3bb1a5d1923d80a3a Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 14:12:15 -0600 Subject: [PATCH 103/346] Add QuickAction class and use Callback type The callback definitions for all of these methods were a mess. I created a Callback type and had every callback parameter use this type for consistency. I also went through and added comments for places where the types do not match the documentation --- types/jsforce/global.d.ts | 1 + types/jsforce/quick-action.d.ts | 52 ++++++++++++ types/jsforce/salesforce-object.d.ts | 113 ++++++++++++++++----------- 3 files changed, 119 insertions(+), 47 deletions(-) create mode 100644 types/jsforce/global.d.ts create mode 100644 types/jsforce/quick-action.d.ts diff --git a/types/jsforce/global.d.ts b/types/jsforce/global.d.ts new file mode 100644 index 0000000000..2c30ae64bb --- /dev/null +++ b/types/jsforce/global.d.ts @@ -0,0 +1 @@ +export type Callback = (err: Error | null, ret: T) => void; diff --git a/types/jsforce/quick-action.d.ts b/types/jsforce/quick-action.d.ts new file mode 100644 index 0000000000..aa6036993a --- /dev/null +++ b/types/jsforce/quick-action.d.ts @@ -0,0 +1,52 @@ +import { Callback } from './global'; +import { Record } from './record'; + +export class QuickAction { + /** + * Retrieve default field values in the action for the given record + * @param contextId Id of record + * @param callback Callback function + */ + defaultValues(contextId: string, callback?: Callback): Promise; + /** Retrieve default field values in the action */ + defaultValues(callback?: Callback): Promise; + /** + * Describe the action's information (including layout, etc.) + * @param callback Callback function + */ + describe(callback?: Callback): Promise; + /** + * Execute the action for given context id and record information + * @param contextId Context record ID of the action + * @param record Input record information for the action + * @param callback Callback function + */ + execute(contextId: string, record: Record, callback?: Callback): Promise; +} + +// TODO: figure out the actual shape of this. the docs don't have it +export type QuickActionResult = object; + +export interface QuickActionInfo { + /** Type of the action (e.g. Create, Update, Post, LogACall) */ + type: string; + /** Name of the action */ + name: string; + /** Label of the action */ + label: string; + /** Endpoint URL information of the action */ + urls: object; +} + +export interface QuickActionDescribeInfo { + /** Object type used for the action */ + contextSobjectType: string; + /** Object type of the action to target */ + targetSobjectType: string; + /** Field name in the target object which refers parent(context) object record ID */ + targetParentField: string; + /** Record type of the targeted record */ + targetRecordTypeId: string; + /** Layout sections that comprise an action */ + layout: object; +} diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 560a16bffd..262788de29 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -5,79 +5,97 @@ import { DescribeSObjectResult } from './describe-result'; import { Query } from './query'; import { Record, RecordReference } from './record'; import { RecordResult } from './record-result'; -import { Connection } from './connection'; +import { Connection, Callback } from './connection'; import { SalesforceId } from './salesforce-id'; import { Batch, BatchResultInfo } from './batch'; +import { QuickAction, QuickActionInfo } from './quick-action'; export class SObject { record(id: SalesforceId): RecordReference; - retrieve(id: SalesforceId, options?: Object, callback?: (err: Error, record: Record) => void): Promise>; - retrieve(ids: SalesforceId[], options?: Object, callback?: (err: Error, ret: Array>) => void): Promise>>; - update(record: Partial, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; - update(records: Array>, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; - updateBulk(input?: Record[] | stream.Stream | string, callback?: (err: Error, ret: RecordResult[]) => void): Batch; - updated(start: string | Date, end: string | Date, callback?: (err: Error, ret: UpdatedRecordsInfo) => void): Promise; - upsert(records: Record, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult) => void): Promise; - upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: (err: Error, ret: RecordResult[]) => void): Promise; - upsertBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult[] | BatchResultInfo[]) => void): Batch; + retrieve(id: SalesforceId, options?: Object, callback?: Callback>): Promise>; + retrieve(ids: SalesforceId[], options?: Object, callback?: Callback>>): Promise>>; + update(record: Partial, options?: Object, callback?: Callback): Promise; + update(records: Array>, options?: Object, callback?: Callback): Promise; + // FIXME: should input really be optional? the documentation says so, but how can you actually update without it? + updateBulk(input?: Record[] | stream.Stream | string, callback?: Callback): Batch; + updated(start: string | Date, end: string | Date, callback?: Callback): Promise; + upsert(records: Record, extIdField: SalesforceId, options?: Object, callback?: Callback): Promise; + upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: Callback): Promise; + upsertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; - find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: object | string, callback?: Callback>>): Query>>; + find(query?: object | string, fields?: Object | string[] | string, callback?: Callback>>): Query>>; + find(query?: object | string, fields?: Object | string[] | string, options?: FindOptions, callback?: Callback>>): Query>>; - findOne(query?: any, callback?: (err: Error, ret: T) => void): Query; - findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): Query; - findOne(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T) => void): Query; + findOne(query?: object | string, callback?: Callback>): Query>; + findOne(query?: object | string, fields?: Object | string[] | string, callback?: Callback>): Query>; + findOne(query?: object | string, fields?: Object | string[] | string, options?: FindOptions, callback?: Callback>): Query>; approvalLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.approvalLayouts */ - (callback?: (err: Error, layoutInfo: ApprovalLayoutInfo) => void): ApprovalLayoutInfo; + (callback?: Callback): ApprovalLayoutInfo; clear(): void; } - approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; - bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult[]) => void): Batch; + approvalLayouts(callback?: Callback): Promise; + bulkload(operation: string, options?: { extIdField?: string }, input?: Array> | stream.Stream | string, callback?: Callback): Batch; compactLayouts$: { /** Returns a value from the cache if it exists, otherwise calls SObject.compactLayouts */ - (callback?: (err: Error, layoutInfo: CompactLayoutInfo) => void): CompactLayoutInfo; + (callback?: Callback): CompactLayoutInfo; clear(): void; } - compactLayouts(callback?: CompactLayoutInfo): Promise; - count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Query; - create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; - createBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - del(id: string, callback?: (err: Error, ret: RecordResult) => void): Promise; - del(ids: string[], callback?: (err: Error, ret: RecordResult[]) => void): Promise; - destroy(id: string, callback?: (err: Error, ret: RecordResult) => void): Promise; - destroy(ids: string[], callback?: (err: Error, ret: RecordResult[]) => void): Promise; - delete(id: string, callback?: (err: Error, ret: RecordResult) => void): Promise; - delete(ids: string[], callback?: (err: Error, ret: RecordResult[]) => void): Promise; - deleteBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - destroyBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - destroyHardBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - deleted(start: Date | string, end: Date | string, callback?: (info: DeletedRecordsInfo) => void): Promise; - deleteHardBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; - describe(callback?: (err: Error, ret: DescribeSObjectResult) => void): Promise; + compactLayouts(callback?: Callback): Promise; + count(conditions?: Object | string, callback?: Callback): Query; + create(record: Record, options: object, callback?: Callback): Promise; + create(record: Record, callback?: Callback): Promise; + create(record: Array>, options: object, callback?: Callback): Promise; + create(record: Array>, callback?: Callback): Promise; + // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? + createBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + del(id: string, callback?: Callback): Promise; + del(ids: string[], callback?: Callback): Promise; + destroy(id: string, callback?: Callback): Promise; + destroy(ids: string[], callback?: Callback): Promise; + delete(id: string, callback?: Callback): Promise; + delete(ids: string[], callback?: Callback): Promise; + // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? + deleteBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? + destroyBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? + destroyHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + deleted(start: Date | string, end: Date | string, callback?: Callback): Promise; + // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? + deleteHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + describe(callback?: Callback): Promise; describe$: { /** Returns a value from the cache if it exists, otherwise calls SObject.describe */ - (callback?: (err: Error, ret: DescribeSObjectResult) => void): DescribeSObjectResult; + (callback?: Callback): DescribeSObjectResult; clear(): void; } - insert(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; - insertBulk(input?: Array> | stream.Stream | string, callback?: (err: Error, ret: RecordResult) => void): Batch; + insert(record: Record, callback?: Callback): Promise; + insert(records: Array>, callback?: Callback): Promise; + insertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; /** Returns a value from the cache if it exists, otherwise calls SObject.layouts */ layouts$: { - (layoutName?: string, callback?: (err: Error, info: LayoutInfo) => void): LayoutInfo; + (layoutName?: string, callback?: Callback): LayoutInfo; clear(): void; } - layouts(layoutName?: string, callback?: (err: Error, info: LayoutInfo) => void): Promise; + layouts(layoutName?: string, callback?: Callback): Promise; listview(id: string): ListView; - listviews(callback?: (err: Error, info: ListViewsInfo) => void): Promise; + listviews(callback?: Callback): Promise; quickAction(actionName: string): QuickAction; - quickActions(callback?: (err: Error, info: any) => void): Promise; - recent(callback?: (err: Error, ret: RecordResult) => void): Promise; - select(callback?: (err: Error, ret: T[]) => void): Query; + quickActions(callback?: Callback): Promise; + // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? + recent(callback?: Callback): Promise; + select(callback?: Callback): Query; // TODO:use a typed pluck to turn `fields` into a subset of T's fields so that the output is slimmed down appropriately - select(fields?: {[P in keyof T]: boolean} | Array<(keyof T)> | (keyof T), callback?: (err: Error, ret: Array>) => void): Query>>; + select(fields?: {[P in keyof T]: boolean} | Array<(keyof T)> | (keyof T), callback?: Callback>>): Query>>; +} + +export interface FindOptions { + limit?: number; + offset?: number; + skip?: number; } export interface UpdatedRecordsInfo { @@ -114,4 +132,5 @@ export class ListView { } export class ListViewsInfo { } -export class QuickAction { } +// TODO: Remove this export +export { QuickAction } // for compatibility if anyone had imported it from this file From 48ec69d35f16441cec6954a8a55612cbc9b21508 Mon Sep 17 00:00:00 2001 From: ToastHawaii Date: Thu, 9 Aug 2018 22:13:51 +0200 Subject: [PATCH 104/346] Add type definition for dav --- types/dav/dav-tests.ts | 250 +++++++++++++ types/dav/index.d.ts | 804 ++++++++++++++++++++++++++++++++++++++++ types/dav/tsconfig.json | 23 ++ types/dav/tslint.json | 1 + 4 files changed, 1078 insertions(+) create mode 100644 types/dav/dav-tests.ts create mode 100644 types/dav/index.d.ts create mode 100644 types/dav/tsconfig.json create mode 100644 types/dav/tslint.json diff --git a/types/dav/dav-tests.ts b/types/dav/dav-tests.ts new file mode 100644 index 0000000000..6a31df698d --- /dev/null +++ b/types/dav/dav-tests.ts @@ -0,0 +1,250 @@ +import * as dav from "dav"; + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ + username: 'xxx', + password: 'xxx' + }) + ); + + dav.createAccount({ server: 'http://dav.example.com', xhr }) + .then((account) => { + account.calendars.forEach(() => { + }); + }); + const client = new dav.Client(xhr); + + client.createAccount({ + server: 'http://dav.example.com', + accountType: 'carddav' + }).then((account) => { + account.addressBooks.forEach(() => { + }); + }); +})(); + +(() => { + const client = new dav.Client( + new dav.transport.Basic( + new dav.Credentials({ + username: 'xxx', + password: 'xxx' + }) + ), + { + baseUrl: 'https://mail.mozilla.com' + } + ); + + const req = dav.request.basic({ + method: 'PUT', + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + etag: '12345' + }); + + client.send(req, '/calendars/123.ics') + .then(() => { }); +})(); + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ + username: 'xxx', + password: 'xxx' + }) + ); + + const req = dav.request.basic({ + method: 'PUT', + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + etag: '12345' + }); + + xhr.send(req, 'https://mail.mozilla.com/calendars/123.ics') + .then(() => { + }); +})(); + +dav.debug.enabled = true; + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ + username: 'Killer BOB', + password: 'blacklodge' + }) + ); + + const client = new dav.Client(xhr, { baseUrl: 'https://mail.mozilla.com' }); + + const url = 'https://mail.mozilla.com/'; + const req = dav.request.basic({ + method: 'PUT', + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + etag: 'abc123' + }); + + const sandbox = dav.createSandbox(); + client.send(req, url, { sandbox }); + xhr.send(req, url, { sandbox }); + + client.createAccount({ sandbox: {}, server: 'http://dav.example.com' }); + dav.createAccount({ + sandbox: {}, + server: 'http://dav.example.com', + xhr + }); + + let calendar = new dav.Calendar(); + client.createCalendarObject(calendar, { + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + filename: 'test.ics' + }); + dav.createCalendarObject( + calendar, + { + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + filename: 'test.ics', + xhr + }); + + let object = new dav.CalendarObject(); + client.updateCalendarObject(object); + dav.updateCalendarObject( + object, + { + xhr + } + ); + + object = new dav.CalendarObject(); + client.deleteCalendarObject(object); + dav.deleteCalendarObject( + object, + { + xhr + } + ); + + calendar = new dav.Calendar(); + client.syncCalendar(calendar, { syncMethod: 'webdav' }); + dav.syncCalendar( + calendar, + { + syncMethod: 'webdav', + xhr + } + ); + + let account = new dav.Account(); + client.syncCaldavAccount(account, { syncMethod: 'webdav' }); + dav.syncCaldavAccount( + account, + { + syncMethod: 'webdav', + xhr + } + ); + + let addressBook = new dav.AddressBook(); + client.createCard(addressBook, { + data: 'BEGIN:VCARD\nEND:VCARD', + filename: 'test.vcf' + }); + dav.createCard(addressBook, + { + data: 'BEGIN:VCARD\nEND:VCARD', + filename: 'test.vcf', + xhr + }); + + let vcard = new dav.VCard(); + client.updateCard(vcard); + dav.updateCard( + vcard, + { + xhr + } + ); + vcard = new dav.VCard(); + client.deleteCard(vcard); + dav.deleteCard( + vcard, + { + xhr + }); + + addressBook = new dav.AddressBook(); + client.syncAddressBook(addressBook, { + syncMethod: 'basic' + }); + + dav.syncAddressBook( + addressBook, + { + syncMethod: 'basic', + xhr + }); + + account = new dav.Account(); + client.syncCarddavAccount(account, { syncMethod: 'basic' }); + + dav.syncCarddavAccount( + account, + { + syncMethod: 'basic', + xhr + }); +})(); + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ username: 'admin', password: 'admin' }) + ); + + const req: dav.Request = { + method: 'GET', + transformRequest: (xhr: any) => xhr + }; + + const sandbox = dav.createSandbox(); + xhr.send(req, 'http://127.0.0.1:1337', { sandbox }); + sandbox.requestList; + + xhr.send(req, 'http://127.0.0.1:1337'); +})(); + +(() => { + const credentials = new dav.Credentials({ + clientId: '605300196874-1ki833poa7uqabmh3hq' + + '6u1onlqlsi54h.apps.googleusercontent.com', + clientSecret: 'jQTKlOhF-RclGaGJot3HIcVf', + redirectUrl: 'https://oauth.gaiamobile.org/authenticated', + tokenUrl: 'https://accounts.google.com/o/oauth2/token', + authorizationCode: 'gareth' + }); + + const xhr = new dav.transport.OAuth2(credentials); + + const req = { method: 'GET' }; + + credentials.accessToken = 'EXPIRED'; + credentials.refreshToken = '1/oPHTPFgECWFPrs7KgHdis24u6Xl4E4EnRrkkiwLfzdk'; + credentials.expiration = Date.now() - 1; + + xhr.send(req, 'http://127.0.0.1:1337', { + retry: false + }); + + credentials.accessToken = 'Little Bear'; + credentials.refreshToken = 'spicy tamales'; + const expiration = credentials.expiration = Date.now() + 60 * 60 * 1000; + + credentials.accessToken = 'EXPIRED'; + credentials.refreshToken = 'raspberry pie'; + credentials.expiration = Date.now() + 60 * 60 * 1000; + + credentials.accessToken = 'EXPIRED'; + credentials.refreshToken = 'soda'; +})(); diff --git a/types/dav/index.d.ts b/types/dav/index.d.ts new file mode 100644 index 0000000000..6b1b09e326 --- /dev/null +++ b/types/dav/index.d.ts @@ -0,0 +1,804 @@ +// Type definitions for dav 1.7 +// Project: https://github.com/lambdabaa/dav/ +// Definitions by: ToastHawaii +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export let version: string; + +/** + * Perform an initial download of a caldav or carddav account's data. + * @param options + * @returns a Promise which will be fulfilled with a dav.Account object. + */ +export function createAccount(options: CreateAccountOptions): Promise; + +export interface CreateAccountOptions { + /** + * one of 'caldav' or 'carddav'. Defaults to 'caldav'. + */ + accountType?: "caldav" | "carddav"; + + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * whether or not to load dav collections. + */ + loadCollections?: boolean; + + /** + * whether or not to load dav objects. + */ + loadObjects?: boolean; + + /** + * request sandox. + */ + sandbox?: Sandbox | {}; + + /** + * some url for server (needn't be base url). + */ + server: string; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + + xhr?: transport.Transport; +} + +/** + * Create a calendar object on the parameter calendar. + * @param calendar the calendar to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been created. + */ +export function createCalendarObject(calendar: Calendar, options: CreateCalendarObjectOptions): Promise; + +export interface CreateCalendarObjectOptions { + /** + * rfc 5545 VCALENDAR object. + */ + data: string; + + /** + * name for the calendar ics file. + */ + filename: string; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Persist updates to the parameter calendar object to the server. + * @param calendarObject updated calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been updated. + */ +export function updateCalendarObject(calendarObject: CalendarObject, options: UpdateCalendarObjectOptions): Promise; + +export interface UpdateCalendarObjectOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Delete the parameter calendar object on the server. + * @param calendarObject target calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been deleted. + */ +export function deleteCalendarObject(calendarObject: CalendarObject, options: DeleteCalendarObjectOptions): Promise; + +export interface DeleteCalendarObjectOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the parameter calendar. + * @param calendar the calendar to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Calendar object once sync is complete. + */ +export function syncCalendar(calendar: Calendar, options: SyncCalendarOptions): Promise; + +export interface SyncCalendarOptions { + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * either 'basic' or 'webdav'. If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the account's calendars. + * @param account the calendar account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Account object once sync is complete. + */ +export function syncCaldavAccount(account: Account, options: SyncCaldavAccountOptions): Promise; + +export interface SyncCaldavAccountOptions { + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * either 'basic' or 'webdav'. If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Create a vcard object on the parameter address book. + * @param addressBook the address book to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been created. + */ +export function createCard(addressBook: AddressBook, options: CreateCardOptions): Promise; + +export interface CreateCardOptions { + /** + * VCARD object. + */ + data: string; + /** + * name for the vcard vcf file. + */ + filename: string; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Persist updates to the parameter vcard object to the server. + * @param card updated vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been updated. + */ +export function updateCard(card: VCard, options: UpdateCardOptions): Promise; + +export interface UpdateCardOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Delete the parameter vcard object on the server. + * @param card target vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been deleted. + */ +export function deleteCard(card: VCard, options: DeleteCardOptions): Promise; + +export interface DeleteCardOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the parameter address books. + * @param addressBook the address book to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated AddressBook object once sync is complete. + */ +export function syncAddressBook(addressBook: AddressBook, options: SyncAddressBookOptions): Promise; + +export interface SyncAddressBookOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * either 'basic' or 'webdav'.If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the account's address books. + * @param account the address book account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated Account object once sync is complete. + */ +export function syncCarddavAccount(account: Account, options: SyncCarddavAccountOptions): Promise; + +export interface SyncCarddavAccountOptions { + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * either 'basic' or 'webdav'. If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Create a request sandbox. + */ +export class Sandbox { + constructor(); + + requestList: any[]; + + add(request: any): void; + + /** + * abort sandboxed requests as a group. + */ + abort(): void; +} + +/** + * @deprecated + */ +export function createSandbox(): Sandbox; + +export namespace transport { + class Transport { + /** + * @param credentials user authorization. + */ + constructor(credentials: Credentials); + + send(request: Request, url: string, options?: TransportOptions): Promise; + } + + interface TransportOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + + retry?: boolean; + } + + class Basic extends Transport { + /** + * Create a new Basic object. This sends dav requests using http basic authentication. + * @param credentials user authorization. + */ + constructor(credentials: Credentials); + + /** + * + * @param request object with request info. + * @param url + * @param options + * @return a promise that will be resolved with an xhr request after + * its readyState is 4 or the result of applying an optional request + * `transformResponse` function to the xhr object after its readyState + * is 4. + */ + send(request: Request, url: string, options?: TransportOptions): Promise; + } + + /** + * Create a new OAuth2 object.This sends dav requests authorized via rfc 6749 oauth2. + * @param credentials user authorization. + */ + class OAuth2 extends Transport { + constructor(credentials: Credentials); + + /** + * + * @param request object with request info. + * @param url + * @param options + * @return a promise that will be resolved with an xhr request after + * its readyState is 4 or the result of applying an optional request + * `transformResponse` function to the xhr object after its readyState + * is 4. + */ + send(request: Request, url: string, options?: TransportOptions): Promise; + } +} + +export namespace request { + /** + * + * @param options + * @returns + */ + function addressBookQuery(options: AddressBookQueryOptions): string; + + interface AddressBookQueryOptions { + /** + * value for Depth header. + */ + depth?: string; + + /** + * list of props to request. + */ + props: object[]; + } + + /** + * + * @param options + * @returns + */ + function basic(options: BasicOptions): Request; + + interface BasicOptions { + /** + * put request body. + */ + data: string; + + /** + * http method. + */ + method: string; + + /** + * cached calendar object etag. + */ + etag: string; + } + + /** + * + * @param options + * @returns + */ + function calendarQuery(options: CalendarQueryOptions): string; + + interface CalendarQueryOptions { + /** + * value for Depth header. + */ + depth?: string; + + /** + * list of filters to send with request. + */ + filters: object[]; + + /** + * list of props to request. + */ + props: object[]; + + /** + * VTIMEZONE calendar object. + */ + timezone: string; + } + + /** + * + * @param options + * @returns + */ + function propfind(options: PropfindOptions): string; + + interface PropfindOptions { + /** + * value for Depth header. + */ + depth?: string; + + /** + * list of props to request. + */ + props: object[]; + } + + /** + * + * @param options + * @returns + */ + function syncCollection(options: SyncCollectionOptions): string; + + interface SyncCollectionOptions { + /** + * option value for Depth header. + */ + depth?: string; + + /** + * list of props to request. + */ + props: object[]; + + /** + * indicates scope of the sync report request. + */ + syncLevel: number; + + /** + * synchronization token provided by the server. + */ + syncToken: string; + } +} + +export class Client { + /** + * Create a new Client object. The client interface allows consumers to set + * their credentials and transport once and then make authorized requests + * without passing them to each request. Each of the other, public API + * methods should be available on Client objects. + * @param xhr request sender. + * @param options + */ + constructor(xhr: transport.Transport, options?: ClientOptions); + + /** + * Send a request using this client's transport (and perhaps baseUrl). + * @param req dav request. + * @param options + * @return a promise that will be resolved with an xhr request after + * its readyState is 4 or the result of applying an optional request + * `transformResponse` function to the xhr object after its readyState + * is 4. + */ + send(req: Request, uri: string, options?: ClientSendOptions): Promise; + + /** + * Perform an initial download of a caldav or carddav account's data. + * @param options + * @returns a Promise which will be fulfilled with a dav.Account object. + */ + createAccount(options?: CreateAccountOptions): Promise; + + /** + * Create a calendar object on the parameter calendar. + * @param calendar the calendar to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been created. + */ + createCalendarObject(calendar: Calendar, options?: CreateCalendarObjectOptions): Promise; + + /** + * Persist updates to the parameter calendar object to the server. + * @param calendarObject updated calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been updated. + */ + updateCalendarObject(calendarObject: CalendarObject, options?: UpdateCalendarObjectOptions): Promise; + + /** + * Delete the parameter calendar object on the server. + * @param calendarObject target calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been deleted. + */ + deleteCalendarObject(calendarObject: CalendarObject, options?: DeleteCalendarObjectOptions): Promise; + + /** + * Fetch changes from the remote server to the parameter calendar. + * @param calendar the calendar to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Calendar object once sync is complete. + */ + syncCalendar(calendar: Calendar, options?: SyncCalendarOptions): Promise; + + /** + * Fetch changes from the remote server to the account's calendars. + * @param account the calendar account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Account object once sync is complete. + */ + syncCaldavAccount(account: Account, options?: SyncCaldavAccountOptions): Promise; + + /** + * Create a vcard object on the parameter address book. + * @param addressBook the address book to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been created. + */ + createCard(addressBook: AddressBook, options?: CreateCardOptions): Promise; + + /** + * Persist updates to the parameter vcard object to the server. + * @param card updated vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been updated. + */ + updateCard(card: VCard, options?: UpdateCardOptions): Promise; + + /** + * + * Delete the parameter vcard object on the server. + * @param card target vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been deleted. + */ + deleteCard(card: VCard, options?: DeleteCardOptions): Promise; + + /** + * Fetch changes from the remote server to the parameter address books. + * @param addressBook the address book to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated AddressBook object once sync is complete. + */ + syncAddressBook(addressBook: AddressBook, options?: SyncAddressBookOptions): Promise; + + /** + * Fetch changes from the remote server to the account's address books. + * @param account the address book account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated Account object once sync is complete. + */ + syncCarddavAccount(account: Account, options?: SyncCarddavAccountOptions): Promise; +} + +export interface ClientOptions { + /** + * root url to resolve relative request urls with. + */ + baseUrl: string; +} + +export interface ClientSendOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * relative url for request. + */ + url?: string; +} + +export type Partial = { + [P in keyof T]?: T[P]; +}; + +export class Account { + constructor(options?: AccountOptions); + server: string; + credentials: Credentials; + rootUrl: string; + principalUrl: string; + homeUrl: string; + calendars: Calendar[]; + addressBooks: AddressBook[]; +} + +export type AccountOptions = Partial; + +export class Credentials { + constructor(options?: CredentialsOptions); + + /** + * username (perhaps email) for calendar user. + */ + username: string; + + /** + * plaintext password for calendar user. + */ + password: string; + + /** + * oauth client id. + */ + clientId: string; + + /** + * oauth client secret. + */ + clientSecret: string; + + /** + * oauth code. + */ + authorizationCode: string; + + /** + * oauth redirect url. + */ + redirectUrl: string; + + /** + * oauth token url. + */ + tokenUrl: string; + + /** + * oauth access token. + */ + accessToken: string; + + /** + * oauth refresh token. + */ + refreshToken: string; + + /** + * unix time for access token expiration. + */ + expiration: number; +} +export type CredentialsOptions = Partial; + +export class DAVCollection { + constructor(options: DAVCollectionOptions); + data: string; + objects: T[]; + account: Account; + ctag: string; + description: string; + displayName: string; + reports: string[]; + resourcetype: string; + syncToken: string; + url: string; +} +export type DAVCollectionOptions = Partial>; + +export class AddressBook extends DAVCollection { + constructor(options?: AddressBookOptions); +} +export type AddressBookOptions = Partial; + +export class Calendar extends DAVCollection { + constructor(options?: CalendarOptions); + + components: string[]; + timezone: string; +} +export type CalendarOptions = Partial; + +export class DAVObject { + constructor(options: DAVObjectOptions); + data: string; + etag: string; + url: string; +} +export type DAVObjectOptions = Partial; + +export class CalendarObject extends DAVObject { + constructor(options?: CalendarObjectOptions); + calendar: Calendar; + calendarData: string; +} +export type CalendarObjectOptions = Partial; + +export class VCard extends DAVObject { + constructor(options?: VCardOptions); + addressBook: AddressBook; + addressData: string; +} + +export type VCardOptions = Partial; + +export class Request { + constructor(options?: RequestOptions); + method: string; + requestData?: string; + transformRequest?: (xhr: any) => any; + transformResponse?: (xhr: any) => any; + onerror?: (error: Error) => any; +} + +export type RequestOptions = Partial; + +export namespace debug { + let enabled: boolean; +} + +export namespace ns { + const CALENDAR_SERVER = 'http://calendarserver.org/ns/'; + const CALDAV_APPLE = 'http://apple.com/ns/ical/'; + const CALDAV = 'urn:ietf:params:xml:ns:caldav'; + const CARDDAV = 'urn:ietf:params:xml:ns:carddav'; + const DAV = 'DAV:'; +} diff --git a/types/dav/tsconfig.json b/types/dav/tsconfig.json new file mode 100644 index 0000000000..5de3437644 --- /dev/null +++ b/types/dav/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", + "dav-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dav/tslint.json b/types/dav/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/dav/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 692c933823f2a2f1604de0c107ec445005c33f24 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 14:18:12 -0600 Subject: [PATCH 105/346] Fix SObject.create signature that broke tests --- types/jsforce/salesforce-object.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 262788de29..ce2f996829 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -45,10 +45,10 @@ export class SObject { } compactLayouts(callback?: Callback): Promise; count(conditions?: Object | string, callback?: Callback): Query; - create(record: Record, options: object, callback?: Callback): Promise; - create(record: Record, callback?: Callback): Promise; - create(record: Array>, options: object, callback?: Callback): Promise; - create(record: Array>, callback?: Callback): Promise; + create(record: T, options: object, callback?: Callback): Promise; + create(record: T, callback?: Callback): Promise; + create(record: Array, options: object, callback?: Callback): Promise; + create(record: Array, callback?: Callback): Promise; // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? createBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; del(id: string, callback?: Callback): Promise; From e284bd9d9cbe71bae4428db922d51caf8c95c925 Mon Sep 17 00:00:00 2001 From: Gregory Ristow Date: Thu, 9 Aug 2018 16:48:08 -0400 Subject: [PATCH 106/346] fix(bloomfilter): missing deserialization overload and correct .buckets type --- types/bloomfilter/bloomfilter-tests.ts | 8 +++++++- types/bloomfilter/index.d.ts | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/types/bloomfilter/bloomfilter-tests.ts b/types/bloomfilter/bloomfilter-tests.ts index 96ee0443b6..05f6c5210a 100644 --- a/types/bloomfilter/bloomfilter-tests.ts +++ b/types/bloomfilter/bloomfilter-tests.ts @@ -4,8 +4,14 @@ function test_bloomfilter() { const k = 2; const bloomFilter = new BloomFilter(m, k); - const array: Int32Array[] = bloomFilter.buckets; + const array: Int32Array = bloomFilter.buckets; const length: number = bloomFilter.buckets.length; bloomFilter.add('someString'); const test: boolean = bloomFilter.test('someString'); + + const buckets: Int32Array = bloomFilter.buckets; + const bloom2 = new BloomFilter(buckets, k); + + const a: Int32Array = new Int32Array(16); + a[3]; } diff --git a/types/bloomfilter/index.d.ts b/types/bloomfilter/index.d.ts index 00ed408c6d..980a96be55 100644 --- a/types/bloomfilter/index.d.ts +++ b/types/bloomfilter/index.d.ts @@ -1,14 +1,29 @@ -// Type definitions for BloomFilter 0.1 +// Type definitions for BloomFilter 0.0 // Project: https://github.com/jasondavies/bloomfilter.js // Definitions by: slawiko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class BloomFilter { - buckets: Int32Array[]; + buckets: Int32Array; - constructor(m: number, k: number); + /** + * Create a new empty bloom filter of size m with hashes k or + * provide buckets as a number[] or Int32Array to deserialize a bloom filter + * @param mOrBucketsArray number of bits (will be rounded up to nearest 32), or buckets + * to deserialize into a filled bloomfilter + * @param k number of hashes + */ + constructor(m: number | number[] | Int32Array, k: number); + /** + * Add a value to a bloom filter + * @param value + */ add(value: any): void; + /** + * Test whether a value exists in a bloom filter. (False positives are + * possible, false negatives are not.) + */ test(value: any): boolean; } From 713219e64b3fb52b52f35db6f7b558b7e2913f2f Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Thu, 9 Aug 2018 23:08:23 +0200 Subject: [PATCH 107/346] typed.js: remove package as typings are not included upstream --- notNeededPackages.json | 6 + types/typed.js/index.d.ts | 185 ------------------------------- types/typed.js/tsconfig.json | 24 ---- types/typed.js/tslint.json | 3 - types/typed.js/typed.js-tests.ts | 29 ----- 5 files changed, 6 insertions(+), 241 deletions(-) delete mode 100644 types/typed.js/index.d.ts delete mode 100644 types/typed.js/tsconfig.json delete mode 100644 types/typed.js/tslint.json delete mode 100644 types/typed.js/typed.js-tests.ts diff --git a/notNeededPackages.json b/notNeededPackages.json index 8b56dbd9b5..056aa81e5b 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1530,6 +1530,12 @@ "sourceRepoURL": "https://github.com/samchon/tstl", "asOfVersion": "1.5.7" }, + { + "libraryName": "typed.js", + "typingsPackageName": "typed.js", + "sourceRepoURL": "https://github.com/mattboldt/typed.js", + "asOfVersion": "2.0.9" + }, { "libraryName": "TypeScript", "typingsPackageName": "typescript", diff --git a/types/typed.js/index.d.ts b/types/typed.js/index.d.ts deleted file mode 100644 index 45064e9c03..0000000000 --- a/types/typed.js/index.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -// Type definitions for typed.js 2.0 -// Project: https://github.com/mattboldt/typed.js -// Definitions by: Davide Donadello -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export default Typed; - -export class Typed { - constructor(elementId: string, options: TypedJsOptions); - - /** - * Toggle start() and stop() of the Typed instance - */ - toggle(): void; - - /** - * Stop typing / backspacing and enable cursor blinking - */ - stop(): void; - - /** - * Start typing / backspacing after being stopped - */ - start(): void; - - /** - * Destroy this instance of Typed - */ - destroy(): void; - - /** - * Reset Typed and optionally restarts - */ - reset(restart: boolean): void; -} - -export type TypedJsContentType = "html" | "null"; - -export interface TypedJsOptions { - /** - * Strings to be typed - */ - strings?: string[]; - - /** - * ID of element containing string children - */ - stringsElement?: string; - - /** - * Type speed in milliseconds - */ - typeSpeed?: number; - - /** - * Time before typing starts in milliseconds - */ - startDelay?: number; - - /** - * Backspacing speed in milliseconds - */ - backSpeed?: number; - - /** - * Only backspace what doesn't match the previous string - */ - smartBackspace?: boolean; - - /** - * Shuffle the strings - */ - shuffle?: boolean; - - /** - * Time before backspacing in milliseconds - */ - backDelay?: number; - - /** - * Fade out instead of backspace - */ - fadeOut?: boolean; - - /** - * Css class for fade animation - */ - fadeOutClass?: string; - - /** - * Fade out delay in milliseconds - */ - fadeOutDelay?: number; - - /** - * Loop strings - */ - loop?: boolean; - - /** - * Amount of loops - */ - loopCount?: number; - - /** - * Show cursor - */ - showCursor?: boolean; - - /** - * Character for cursor - */ - cursorChar?: string; - - /** - * Insert CSS for cursor and fadeOut into HTML - */ - autoInsertCss?: boolean; - - /** - * Attribute for typing - * Ex: input placeholder, value, or just HTML text - */ - attr?: string; - - /** - * Bind to focus and blur if el is text input - */ - bindInputFocusEvents?: boolean; - - /** - * 'html' or 'null' for plaintext - */ - contentType?: TypedJsContentType; - - /** - * All typing is complete - */ - onComplete?: (self: Typed) => void; - - /** - * Before each string is typed - */ - preStringTyped?: (arrayPos: number, self: Typed) => void; - - /** - * After each string is typed - */ - onStringTyped?: (arrayPos: number, self: Typed) => void; - - /** - * During looping, after last string is typed - */ - onLastStringBackspaced?: (self: Typed) => void; - - /** - * Typing has been stopped - */ - onTypingPaused?: (arrayPos: number, self: Typed) => void; - - /** - * Typing has been started after being stopped - */ - onTypingResumed?: (arrayPos: number, self: Typed) => void; - - /** - * After reset - */ - onReset?: (self: Typed) => void; - - /** - * After stop - */ - onStop?: (arrayPos: number, self: Typed) => void; - - /** - * After start - */ - onStart?: (arrayPos: number, self: Typed) => void; - - /** - * After destroy - */ - onDestroy?: (self: Typed) => void; -} diff --git a/types/typed.js/tsconfig.json b/types/typed.js/tsconfig.json deleted file mode 100644 index b018ca64fe..0000000000 --- a/types/typed.js/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "esModuleInterop": true - }, - "files": [ - "index.d.ts", - "typed.js-tests.ts" - ] -} diff --git a/types/typed.js/tslint.json b/types/typed.js/tslint.json deleted file mode 100644 index e60c15844f..0000000000 --- a/types/typed.js/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} \ No newline at end of file diff --git a/types/typed.js/typed.js-tests.ts b/types/typed.js/typed.js-tests.ts deleted file mode 100644 index 3e4bd0a137..0000000000 --- a/types/typed.js/typed.js-tests.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Typed, TypedJsOptions } from 'typed.js'; - -// Create instance -const typed = new Typed(".element", { - strings: ["First sentence.", "& a second sentence."], - typeSpeed: 100, - startDelay: 0, - backSpeed: 50, - smartBackspace: true, - shuffle: true, - backDelay: 150, - loop: true, - showCursor: true, - autoInsertCss: true, - contentType: "html", - onComplete: (self: Typed) => { - // Complete!! - }, - onDestroy: (self: Typed) => { - // End!! - }, -}); - -// Methods -typed.reset(false); -typed.destroy(); -typed.start(); -typed.stop(); -typed.toggle(); From bc74bacf347022d31a614e04cc5895a33430bf24 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Thu, 9 Aug 2018 17:28:37 -0600 Subject: [PATCH 108/346] Write tests for SObject and move Callback back to connection.d.ts --- types/jsforce/connection.d.ts | 31 ++- types/jsforce/global.d.ts | 1 - types/jsforce/http-api.d.ts | 5 + types/jsforce/index.d.ts | 2 +- types/jsforce/jsforce-tests.ts | 363 ++++++++++++++++++++++----- types/jsforce/quick-action.d.ts | 2 +- types/jsforce/salesforce-object.d.ts | 25 +- 7 files changed, 350 insertions(+), 79 deletions(-) delete mode 100644 types/jsforce/global.d.ts create mode 100644 types/jsforce/http-api.d.ts diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index fcf614eb92..e7fd593b01 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -10,8 +10,16 @@ import { Metadata } from './api/metadata'; import { Bulk } from './bulk'; import { Cache } from './cache' import { OAuth2, Streaming } from '.'; +import { HttpApiOptions } from './http-api' -export type Callback = (err: Error, result: T) => void; +export type Callback = (err: Error | null, result: T) => void; +// The type for these options was determined by looking at the usage +// of the options object in Connection.create and other methods +// go to http://jsforce.github.io/jsforce/doc/connection.js.html#line568 +// and search for options +export interface RestApiOptions { + headers?: { [x: string]: string } +} // These are pulled out because according to http://jsforce.github.io/jsforce/doc/connection.js.html#line49 // the oauth options can either be in the `oauth2` proeprty OR spread across the main connection @@ -93,24 +101,24 @@ export type ConnectionEvent = "refresh"; */ export abstract class BaseConnection extends EventEmitter { _baseUrl(): string; - request(info: RequestInfo | string, options?: Object, callback?: (err: Error, Object: object) => void): Promise; + request(info: RequestInfo | string, options?: HttpApiOptions, callback?: (err: Error, Object: object) => void): Promise; query(soql: string, options?: ExecuteOptions, callback?: (err: Error, result: QueryResult) => void): Query>; queryMore(locator: string, options?: ExecuteOptions, callback?: (err: Error, result: QueryResult) => void): Promise>; - create(type: string, records: Record | Array>, options?: Object, + create(type: string, records: Record | Array>, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - insert(type: string, records: Record | Array>, options?: Object, + insert(type: string, records: Record | Array>, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - retrieve(type: string, ids: string | string[], options?: Object, + retrieve(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: Record | Array>) => void): Promise<(Record | Array>)>; - update(type: string, records: Record | Array>, options?: Object, + update(type: string, records: Record | Array>, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | Array>) => void): Promise<(RecordResult | RecordResult[])>; - upsert(type: string, records: Record | Array>, extIdField: string, options?: Object, + upsert(type: string, records: Record | Array>, extIdField: string, options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - del(type: string, ids: string | string[], options?: Object, + del(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - delete(type: string, ids: string | string[], options?: Object, + delete(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - destroy(type: string, ids: string | string[], options?: Object, + destroy(type: string, ids: string | string[], options?: RestApiOptions, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; describe$: { /** Returns a value from the cache if it exists, otherwise calls Connection.describe */ @@ -124,7 +132,8 @@ export abstract class BaseConnection extends EventEmitter { clear(): void; } describeGlobal(callback?: (err: Error, result: DescribeGlobalResult) => void): Promise; - sobject(resource: string): SObject; + // we want any object to be accepted if the user doesn't decide to give an explicit type + sobject(resource: string): SObject; } export class Connection extends BaseConnection { diff --git a/types/jsforce/global.d.ts b/types/jsforce/global.d.ts deleted file mode 100644 index 2c30ae64bb..0000000000 --- a/types/jsforce/global.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Callback = (err: Error | null, ret: T) => void; diff --git a/types/jsforce/http-api.d.ts b/types/jsforce/http-api.d.ts new file mode 100644 index 0000000000..1986ce0c75 --- /dev/null +++ b/types/jsforce/http-api.d.ts @@ -0,0 +1,5 @@ +export interface HttpApiOptions { + responseType?: string; + transport?: object; + noContentResponse?: object +} diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index ddcb0d8260..d92677a5eb 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -6,7 +6,7 @@ // Tim Noonan // Abraham White // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 export * from './api/analytics'; export * from './api/chatter'; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 8eb97aebc7..886bd012c0 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -4,12 +4,9 @@ import * as express from 'express'; import * as glob from 'glob'; import * as sf from 'jsforce'; - -export interface DummyRecord { - thing: boolean; - other: number; - person: string; -} +import { RecordReference, Record } from 'jsforce/record'; +import { SObject } from 'jsforce/salesforce-object'; +import { RecordResult } from 'jsforce/record-result'; const salesforceConnection: sf.Connection = new sf.Connection({ instanceUrl: '', @@ -20,7 +17,304 @@ const salesforceConnection: sf.Connection = new sf.Connection({ }, }); -salesforceConnection.sobject("Dummy").select(["thing", "other"]); +async function testSObject(connection: sf.Connection) { + interface DummyRecord { + thing: boolean; + other: number; + person: string; + } + + const dummySObject: SObject = connection.sobject('Dummy'); + + // currently untyped, but some future change may make this stricter + const restApiOptions = { + headers: { Bearer: 'I have no idea what this wants' } + }; + + { // Test SObject.record + // $ExpectType RecordReference + dummySObject.record('50130000000014C'); + } + + { // Test SObject.retrieve + // with single id + // $ExpectType Record + await dummySObject.retrieve('50130000000014C'); + // with single id and rest api options + // $ExpectType Record + await dummySObject.retrieve('50130000000014C', restApiOptions); + + // with single id and callback + dummySObject.retrieve('50130000000014C', restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType Record + }); + + // with ids array + // $ExpectType Record[] + await dummySObject.retrieve(['IIIIDDD']); + // with ids array and rest api options + // $ExpectType Record[] + await dummySObject.retrieve(['IIIIDDD'], restApiOptions); + + // with ids array and callback + dummySObject.retrieve(['50130000000014C'], restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType Record[] + }); + + salesforceConnection.sobject("ContentVersion").retrieve("world", { + test: "test" + }, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType any + }); + } + + { // Test SObject.update + // if we require that records have an id field this will fail + // //$ExpectError + await dummySObject.update({ thing: false }); + + // If we require that the records have an Id field + // await dummySObject.update({ thing: false, Id: 'asdf' }); // $ExpectType RecordResult + + // invalid field + // $ExpectError + await dummySObject.update({ asdf: false }); + + // with rest api options + // $ExpectType RecordResult + await dummySObject.update({ thing: false }, restApiOptions); + + // with callback + dummySObject.update({ thing: false }, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult + }); + + dummySObject.update({ thing: false }, restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult + }); + + // with multiple records + // $ExpectType RecordResult[] + await dummySObject.update([{ thing: false }]); + + // with multiple records and api options + // $ExpectType RecordResult[] + await dummySObject.update([{ thing: false }], restApiOptions); + + // with multiple records and callback + dummySObject.update([{ thing: false }], restApiOptions, (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + + dummySObject.update([{ thing: false }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.updated + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated(new Date(), new Date()); + + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated(new Date(), 'hi'); + + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated('hi', new Date()); + + // $ExpectType UpdatedRecordsInfo + await dummySObject.updated('hi', 'hi'); + + dummySObject.updated(new Date(), 'hi', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType UpdatedRecordsInfo + }); + } + + { // Test SObject.upsert + const updateData = { + Id: 'Some ID', + thing: true, + other: 1, + person: 'hi' + }; + // $ExpectType RecordResult + await dummySObject.upsert(updateData, 'Id'); + + // $ExpectType RecordResult + await dummySObject.upsert(updateData, 'Id', restApiOptions); + + // $ExpectType RecordResult[] + await dummySObject.upsert([updateData], 'Id'); + + // $ExpectType RecordResult[] + await dummySObject.upsert([updateData], 'Id', restApiOptions); + + dummySObject.upsert(updateData, 'Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + dummySObject.upsert(updateData, 'Id', restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + dummySObject.upsert([updateData], 'Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + + dummySObject.upsert([updateData], 'Id', restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.find + } + + { // Test SObject.findOne + salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { + err; // $ExpectType Error | null + contentVersion; // $ExpectType any + }); + } + + { // Test SObject.select + + dummySObject.select(["thing", "other"]); + + // note the following should never compile: + // $ExpectError + dummySObject.select(["lol"]); + } + + { // Test SObject.create + // $ExpectType RecordResult + await dummySObject.create({ + thing: true, + other: 1, + person: 'hi' + }); + + // $ExpectType RecordResult + await dummySObject.create({ + thing: true, + other: 1, + person: 'hi' + }, restApiOptions); + + // $ExpectType RecordResult[] + await dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }]); + + // $ExpectType RecordResult[] + await dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }], restApiOptions); + + dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + + dummySObject.create([{ + thing: true, + other: 1, + person: 'hi' + }], restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + + salesforceConnection.sobject("Account").create({ + Name: "Test Acc 2", + BillingStreet: "Maplestory street", + BillingPostalCode: "ME4 666" + }, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + // callback and rest api options + salesforceConnection.sobject("ContentVersion").create({ + OwnerId: '', + Title: 'hello', + PathOnClient: './hello-world.jpg', + VersionData: '{ Test: Data }' + }, restApiOptions, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + salesforceConnection.sobject("ContentDocumentLink").create({ + ContentDocumentId: '', + LinkedEntityId: '', + ShareType: "I" + }, (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + } + + { // Test SObject.destroy and aliases + // $ExpectType RecordResult + await dummySObject.del('Id'); + // $ExpectType RecordResult + await dummySObject.destroy('Id'); + // $ExpectType RecordResult + await dummySObject.delete('Id'); + + // $ExpectType RecordResult[] + await dummySObject.del(['Id']); + // $ExpectType RecordResult[] + await dummySObject.destroy(['Id']); + // $ExpectType RecordResult[] + await dummySObject.delete(['Id']); + + dummySObject.del('Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + dummySObject.destroy('Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + dummySObject.delete('Id', (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult + }); + + dummySObject.del(['Id'], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + dummySObject.destroy(['Id'], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + dummySObject.delete(['Id'], (err, ret) => { + err; // $ExpectType Error | null + ret; // $ExpectType RecordResult[] + }); + } +} const requestInfo: sf.RequestInfo = { body: '', @@ -38,51 +332,6 @@ const queryOptions: sf.ExecuteOptions = { }; salesforceConnection.query('SELECT Id, Name FROM Account', queryOptions); -// note the following should never compile: -// salesforceConnection.sobject("Dummy").select(["lol"]); - -salesforceConnection.sobject("Account").create({ - Name: "Test Acc 2", - BillingStreet: "Maplestory street", - BillingPostalCode: "ME4 666" -}, (err: Error, ret: sf.RecordResult | sf.RecordResult[]) => { - if (err || !Array.isArray(ret) && !ret.success) { - return; - } -}); - -salesforceConnection.sobject("ContentVersion").create({ - OwnerId: '', - Title: 'hello', - PathOnClient: './hello-world.jpg', - VersionData: '{ Test: Data }' -}, (err: Error, ret: sf.RecordResult | sf.RecordResult[]) => { - if (err || !Array.isArray(ret) && !ret.success) { - return; - } -}); - -salesforceConnection.sobject("ContentVersion").retrieve("world", { - test: "test" -}, (err: Error, ret) => { - if (err) { - return; - } -}); - -salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { -}); - -salesforceConnection.sobject("ContentDocumentLink").create({ - ContentDocumentId: '', - LinkedEntityId: '', - ShareType: "I" -}, (err: Error, ret: sf.RecordResult | sf.RecordResult[]) => { - if (err || !Array.isArray(ret) && !ret.success) { - return; - } -}); - sf.Date.YESTERDAY; salesforceConnection.sobject('Coverage__c') @@ -230,7 +479,7 @@ async function testChatter(conn: sf.Connection): Promise { }, feedElementType: 'FeedItem', subjectId: 'me' - }, (err: Error, result: any) => { + }, (err: Error | null, result: any) => { if (err) { throw err; } @@ -242,7 +491,7 @@ async function testChatter(conn: sf.Connection): Promise { text: 'This is new comment on the post' }] } - }, (err: Error, result: any) => { + }, (err: Error | null, result: any) => { if (err) { throw err; } @@ -366,13 +615,15 @@ async function testDescribe() { object.fields.forEach(field => { const type: sf.FieldType = field.type; // following should never compile - // const fail = type === 'hey' + // $ExpectError + const fail = type === 'hey'; const isString = type === 'string'; }); // following should never compile (if StrictNullChecks is on) - // object.keyPrefix.length; + // $ExpectError + object.keyPrefix.length; console.log(`${sobject.name} Label: `, object.label); diff --git a/types/jsforce/quick-action.d.ts b/types/jsforce/quick-action.d.ts index aa6036993a..a67f4d4e08 100644 --- a/types/jsforce/quick-action.d.ts +++ b/types/jsforce/quick-action.d.ts @@ -1,4 +1,4 @@ -import { Callback } from './global'; +import { Callback } from './connection'; import { Record } from './record'; export class QuickAction { diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index ce2f996829..2015f5d79b 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -5,22 +5,29 @@ import { DescribeSObjectResult } from './describe-result'; import { Query } from './query'; import { Record, RecordReference } from './record'; import { RecordResult } from './record-result'; -import { Connection, Callback } from './connection'; +import { Connection, RestApiOptions, Callback } from './connection'; import { SalesforceId } from './salesforce-id'; import { Batch, BatchResultInfo } from './batch'; import { QuickAction, QuickActionInfo } from './quick-action'; export class SObject { record(id: SalesforceId): RecordReference; - retrieve(id: SalesforceId, options?: Object, callback?: Callback>): Promise>; - retrieve(ids: SalesforceId[], options?: Object, callback?: Callback>>): Promise>>; - update(record: Partial, options?: Object, callback?: Callback): Promise; - update(records: Array>, options?: Object, callback?: Callback): Promise; + retrieve(id: SalesforceId, callback?: Callback>): Promise>; + retrieve(id: SalesforceId, options?: object, callback?: Callback>): Promise>; + retrieve(ids: SalesforceId[], callback?: Callback>>): Promise>>; + retrieve(ids: SalesforceId[], options?: object, callback?: Callback>>): Promise>>; + // Should update require that the record Id field be provided? + update(record: Partial, callback?: Callback): Promise; + update(record: Partial, options?: RestApiOptions, callback?: Callback): Promise; + update(records: Array>, callback?: Callback): Promise; + update(records: Array>, options?: RestApiOptions, callback?: Callback): Promise; // FIXME: should input really be optional? the documentation says so, but how can you actually update without it? updateBulk(input?: Record[] | stream.Stream | string, callback?: Callback): Batch; updated(start: string | Date, end: string | Date, callback?: Callback): Promise; - upsert(records: Record, extIdField: SalesforceId, options?: Object, callback?: Callback): Promise; - upsert(records: Array>, extIdField: SalesforceId, options?: Object, callback?: Callback): Promise; + upsert(records: Record, extIdField: string, callback?: Callback): Promise; + upsert(records: Record, extIdField: string, options?: RestApiOptions, callback?: Callback): Promise; + upsert(records: Array>, extIdField: string, callback?: Callback): Promise; + upsert(records: Array>, extIdField: string, options?: RestApiOptions, callback?: Callback): Promise; upsertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; find(query?: object | string, callback?: Callback>>): Query>>; @@ -45,9 +52,9 @@ export class SObject { } compactLayouts(callback?: Callback): Promise; count(conditions?: Object | string, callback?: Callback): Query; - create(record: T, options: object, callback?: Callback): Promise; + create(record: T, options?: RestApiOptions, callback?: Callback): Promise; create(record: T, callback?: Callback): Promise; - create(record: Array, options: object, callback?: Callback): Promise; + create(record: Array, options?: RestApiOptions, callback?: Callback): Promise; create(record: Array, callback?: Callback): Promise; // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? createBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; From d7002d4d09fb0374a00ba8d01395c0c1e162b0b0 Mon Sep 17 00:00:00 2001 From: Ilia Beliaev Date: Fri, 10 Aug 2018 10:28:26 +0300 Subject: [PATCH 109/346] Fixes after running lint. --- types/vue-select/index.d.ts | 38 +++++++++++++--------------- types/vue-select/tsconfig.json | 4 ++- types/vue-select/vue-select-tests.ts | 12 ++++----- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/types/vue-select/index.d.ts b/types/vue-select/index.d.ts index 331fa7ec92..ff8767e189 100644 --- a/types/vue-select/index.d.ts +++ b/types/vue-select/index.d.ts @@ -1,22 +1,18 @@ -// Type definitions for vue-select 2.4.0 +// Type definitions for vue-select 2.4 // Project: https://github.com/sagalbot/vue-select#readme // Definitions by: Ilia Beliaev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript version: 2.4.0 +// TypeScript Version: 2.3 -import {VueConstructor} from 'vue'; +import { VueConstructor } from 'vue'; export default VueSelect; - export const VueSelect: VueSelectConstructor; - -export type Option = any | null; - -export type OptionConsumer = (option: Option) => void; +export type OptionConsumer = (option: any) => void; export interface VueSelectProps { - value: Option; - options: Option[]; + value: any; + options: any[]; disabled: boolean; maxHeight: string; searchable: boolean; @@ -26,13 +22,13 @@ export interface VueSelectProps { clearSearchOnSelect: boolean; closeOnSelect: boolean; label: string; - getOptionLabel: (option: Option) => string; + getOptionLabel: (option: any) => string; onChange: OptionConsumer; taggable: boolean; tabindex: number | null; pushTags: boolean; filterable: boolean; - createOption: (option: Option) => Option; + createOption: (option: any) => any; resetOnOptionsChange: boolean; noDrop: boolean; inputId: string | null; @@ -42,14 +38,14 @@ export interface VueSelectProps { export interface VueSelectData { search: string; open: boolean; - mutableValue: Option; - mutableOptions: Option[]; + mutableValue: any; + mutableOptions: any[]; } export interface VueSelectWatch { - value: (val: Option) => void; - mutableValue: (val: Option, old: Option) => void; - options: (val: Option) => void; + value: (val: any) => void; + mutableValue: (val: any, old: any) => void; + options: (val: any) => void; mutableOptions: () => void; multiple: (reset: boolean) => void; created: () => void; @@ -61,12 +57,12 @@ export interface VueSelectMethods { clearSelection: () => void; onAfterSelect: OptionConsumer; toggleDropdown: (e: Event) => void; - isOptionSelected: (option: Option) => boolean; + isOptionSelected: (option: any) => boolean; onEscape: () => void; onSearchBlur: () => void; onSearchFocus: () => void; maybeDeleteValue: () => void; - optionExists: (option: Option) => boolean; + optionExists: (option: any) => boolean; maybePushTag: OptionConsumer; } @@ -76,9 +72,9 @@ export interface VueSelectComputed { searching: () => boolean; dropdownOpen: () => boolean; searchPlaceholder: () => boolean; - filteredOptions: () => Option[]; + filteredOptions: () => any[]; isValueEmpty: () => boolean; - valueAsArray: () => Option[]; + valueAsArray: () => any[]; showClearButton: () => boolean; } diff --git a/types/vue-select/tsconfig.json b/types/vue-select/tsconfig.json index c757293eec..656897ba29 100644 --- a/types/vue-select/tsconfig.json +++ b/types/vue-select/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/vue-select/vue-select-tests.ts b/types/vue-select/vue-select-tests.ts index 17cf97b2be..8fea33b2dc 100644 --- a/types/vue-select/vue-select-tests.ts +++ b/types/vue-select/vue-select-tests.ts @@ -1,5 +1,5 @@ import Vue from 'vue'; -import VueSelect, {Option} from 'vue-select'; +import VueSelect from 'vue-select'; const options = [ { @@ -8,29 +8,27 @@ const options = [ { name: 'SomeName2' } -] +]; new Vue({ - el: '#app', data: { options, value: null, - }, components: { 'vue-select': VueSelect }, methods: { - getOptionLabel(option: Option) { + getOptionLabel(option: any) { if (option && option.name) { return option.name; } return ''; }, - optionConsumer(option: Option) { + optionConsumer(option: any) { }, - optionToOption(option: Option) { + optionToOption(option: any) { return option; }, onSearch(search: string, loading: (b: boolean) => void) { From 5377b9532a496406c7421d15942e201eb8c2b4e7 Mon Sep 17 00:00:00 2001 From: Pascal Maximilian Bremer <8161919+Bomberus@users.noreply.github.com> Date: Fri, 10 Aug 2018 09:57:36 +0200 Subject: [PATCH 110/346] Fix missing function setLocale See https://github.com/Marak/faker.js/issues/624 for more information --- types/faker/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index 552e7d3eeb..248a0ba96c 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -11,7 +11,8 @@ declare const fakerStatic: Faker.FakerStatic; declare namespace Faker { interface FakerStatic { locale: string; - + setLocale(locale: string): void; + address: { zipCode(format?: string): string; city(format?: number): string; From e6e7e72239c2e1f52ba904a645996dae4937cd6a Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Fri, 10 Aug 2018 11:06:07 +0200 Subject: [PATCH 111/346] yup: setLocale is no longer in a separate file --- types/yup/index.d.ts | 1 + types/yup/lib/customLocale.d.ts | 5 ----- types/yup/tsconfig.json | 3 +-- types/yup/yup-tests.ts | 3 +-- 4 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 types/yup/lib/customLocale.d.ts diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index 08697521d8..b4c8ea797e 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -12,6 +12,7 @@ export function addMethod>(schemaCtor: AnySchemaConstructo export function ref(path: string, options?: { contextPrefix: string }): Ref; export function lazy(fn: (value: T) => Schema): Lazy; export function ValidationError(errors: string | string[], value: any, path: string, type?: any): ValidationError; +export function setLocale(customLocale: LocaleObject): void; export const mixed: MixedSchemaConstructor; export const string: StringSchemaConstructor; diff --git a/types/yup/lib/customLocale.d.ts b/types/yup/lib/customLocale.d.ts deleted file mode 100644 index b0abe418f3..0000000000 --- a/types/yup/lib/customLocale.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { - LocaleObject, -} from "../index"; - -export function setLocale(customLocale: LocaleObject): void; diff --git a/types/yup/tsconfig.json b/types/yup/tsconfig.json index 2f701d2d03..7a38726edd 100644 --- a/types/yup/tsconfig.json +++ b/types/yup/tsconfig.json @@ -18,7 +18,6 @@ }, "files": [ "index.d.ts", - "lib/customLocale.d.ts", "yup-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index c2d04a8cf5..2d5b509b37 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -1,5 +1,4 @@ import * as yup from 'yup'; -import { setLocale } from 'yup/lib/customLocale'; // tslint:disable-next-line:no-duplicate-imports import { reach, date, Schema, ObjectSchema, ValidationError, MixedSchema, SchemaDescription, TestOptions, ValidateOptions, NumberSchema, TestContext } from 'yup'; @@ -289,7 +288,7 @@ const validateOptions: ValidateOptions = { } }; -setLocale({ +yup.setLocale({ number: { max: "Max message", min: "Min message" }, string: { email: "String message"} }); From eb938359c82412a35cf797cd25e764122cb000fc Mon Sep 17 00:00:00 2001 From: Hanno Fellmann Date: Fri, 10 Aug 2018 11:07:26 +0200 Subject: [PATCH 112/346] Add className attribute to react-flatpickr --- types/react-flatpickr/index.d.ts | 1 + types/react-flatpickr/react-flatpickr-tests.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts index 4586774568..a0a9725ccd 100644 --- a/types/react-flatpickr/index.d.ts +++ b/types/react-flatpickr/index.d.ts @@ -12,6 +12,7 @@ export interface DateTimePickerProps { options?: flatpickr.Options.Options; onChange?: flatpickr.Options.Hook; value?: string; + className?: string; } export default class DatePicker extends Component {} diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx index fbbb6f45a7..452d8529b4 100644 --- a/types/react-flatpickr/react-flatpickr-tests.tsx +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -18,3 +18,5 @@ const onChange = ( const onChangeElement = ; const valueElement = ; + +const classNameElement = ; From 1b0812447cb9a69ef4ba7592cbc47238e83082a2 Mon Sep 17 00:00:00 2001 From: hansemannn Date: Fri, 10 Aug 2018 14:37:38 +0200 Subject: [PATCH 113/346] Update for Titanium 7.3 --- types/titanium/index.d.ts | 6101 +++++++++--------------------- types/titanium/titanium-tests.ts | 41 +- 2 files changed, 1711 insertions(+), 4431 deletions(-) diff --git a/types/titanium/index.d.ts b/types/titanium/index.d.ts index b191fd2766..e26d4aecb4 100644 --- a/types/titanium/index.d.ts +++ b/types/titanium/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Titanium 7.1 +// Type definitions for Titanium 7.3 // Project: https://github.com/appcelerator/titanium_mobile // Definitions by: Axway Appcelerator // Jan Vennemann @@ -998,20 +998,30 @@ declare namespace Titanium { const AUTOFILL_TYPE_CARD_EXPIRATION_DATE: string; /** - * Specifies the expectation of a card expectation day. + * Specifies the expectation of a card expiration day. */ const AUTOFILL_TYPE_CARD_EXPIRATION_DAY: string; /** - * Specifies the expectation of a card expectation month. + * Specifies the expectation of a card expiration month. */ const AUTOFILL_TYPE_CARD_EXPIRATION_MONTH: string; /** - * Specifies the expectation of a card expectation year. + * Specifies the expectation of a card expiration year. */ const AUTOFILL_TYPE_CARD_EXPIRATION_YEAR: string; + /** + * Specifies the expectation of a new password. + */ + const AUTOFILL_TYPE_NEW_PASSWORD: string; + + /** + * Specifies the expectation of a single-factor SMS login code. + */ + const AUTOFILL_TYPE_ONE_TIME_CODE: string; + /** * Converts strings formatted as addresses into clickable links. */ @@ -2332,6 +2342,11 @@ declare namespace Titanium { */ hiddenBehavior: number; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -2409,7 +2424,7 @@ declare namespace Titanium { softKeyboardOnFocus: number; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -2458,6 +2473,11 @@ declare namespace Titanium { */ transitionName: string; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -2865,6 +2885,16 @@ declare namespace Titanium { */ setHiddenBehavior(hiddenBehavior: number): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -3125,6 +3155,16 @@ declare namespace Titanium { */ setTransitionName(transitionName: string): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -3361,6 +3401,11 @@ declare namespace Titanium { */ hiddenBehavior: number; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -3438,7 +3483,7 @@ declare namespace Titanium { softKeyboardOnFocus: number; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -3487,6 +3532,11 @@ declare namespace Titanium { */ transitionName: string; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -3894,6 +3944,16 @@ declare namespace Titanium { */ setHiddenBehavior(hiddenBehavior: number): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -4154,6 +4214,16 @@ declare namespace Titanium { */ setTransitionName(transitionName: string): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -4749,6 +4819,11 @@ declare namespace Titanium { */ cancel: number; + /** + * Setting this to true requires the end-user to click a dialog button to close the dialog. + */ + buttonClickRequired: boolean; + /** * When this is set to `true`, the dialog is canceled when touched outside the window's bounds. */ @@ -4922,6 +4997,16 @@ declare namespace Titanium { */ setCancel(cancel: number): void; + /** + * Gets the value of the property. + */ + getButtonClickRequired(): boolean; + + /** + * Sets the value of the property. + */ + setButtonClickRequired(buttonClickRequired: boolean): void; + /** * Gets the value of the property. */ @@ -5612,6 +5697,11 @@ declare namespace Titanium { * A button widget that has four states: normal, disabled, focused and selected. */ interface Button extends Titanium.UI.View { + /** + * Specify an attributed string for the label. + */ + attributedString: Titanium.UI.AttributedString; + /** * Default button text color, as a color name or hex triplet. */ @@ -5688,6 +5778,16 @@ declare namespace Titanium { */ verticalAlign: number | string; + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + /** * Gets the value of the property. */ @@ -5944,11 +6044,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -5959,6 +6054,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -6001,7 +6101,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -6020,6 +6120,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -6065,21 +6170,6 @@ declare namespace Titanium { */ labels: string[] | BarItemType[]; - /** - * Style of the button bar. - */ - style: number; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -6101,21 +6191,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -6317,11 +6392,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -6347,6 +6417,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -6477,6 +6557,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -6577,16 +6667,6 @@ declare namespace Titanium { */ setLabels(labels: ReadonlyArray): void; - /** - * Gets the value of the property. - */ - getStyle(): number; - - /** - * Sets the value of the property. - */ - setStyle(style: number): void; - } /** @@ -6679,11 +6759,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -6694,6 +6769,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -6736,7 +6816,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -6755,6 +6835,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -6800,16 +6885,6 @@ declare namespace Titanium { */ selected: number; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -6831,21 +6906,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -7067,11 +7127,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -7097,6 +7152,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -7227,6 +7292,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -7520,6 +7595,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -7562,7 +7642,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -7581,6 +7661,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -7641,16 +7726,6 @@ declare namespace Titanium { */ wobble: boolean; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -7672,21 +7747,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -7928,6 +7988,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -8058,6 +8128,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -8374,7 +8454,7 @@ declare namespace Titanium { enableZoomControls: boolean; /** - * Set to `true` to prevent scaling of 2x-resolution remote images for Retina + * Set to `true` to prevent scaling of 2x/3x-resolution remote images for retina * displays. */ hires: boolean; @@ -8596,7 +8676,7 @@ declare namespace Titanium { } /** - * A text label, with optional background image. + * A text label, with an optional background image. */ interface Label extends Titanium.UI.View { /** @@ -9396,7 +9476,7 @@ declare namespace Titanium { separatorColor: string; /** - * The insets for list view separators (applies to all cells). This property is applicable on iOS 7 and greater. + * The insets for list view separators (applies to all cells). */ separatorInsets: any; @@ -9411,17 +9491,17 @@ declare namespace Titanium { style: number; /** - * The insets for the table view header and footer. This property is applicable on iOS 7 and greater. + * The insets for the table view header and footer. */ tableSeparatorInsets: any; /** - * The insets for the list view header and footer. This property is applicable on iOS 7 and greater. + * The insets for the list view header and footer. */ listSeparatorInsets: any; /** - * The insets for list view cells (applies to all cells). This property is applicable on iOS 7 and greater. + * The insets for list view cells (applies to all cells). */ rowSeparatorInsets: any; @@ -9966,203 +10046,7 @@ declare namespace Titanium { /** * A control that displays an image composited with a background image or color. */ - interface MaskedImage extends Titanium.Proxy { - /** - * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. - */ - accessibilityHidden: boolean; - - /** - * Briefly describes what performing an action (such as a click) on the view will do. - */ - accessibilityHint: string; - - /** - * A succint label identifying the view for the device's accessibility service. - */ - accessibilityLabel: string; - - /** - * A string describing the value (if any) of the view for the device's accessibility service. - */ - accessibilityValue: string; - - /** - * Coordinate of the view about which to pivot an animation. - */ - anchorPoint: Point; - - /** - * Current position of the view during an animation. - */ - readonly animatedCenter: Point; - - /** - * Background color of the view, as a color name or hex triplet. - */ - backgroundColor: string; - - /** - * A background gradient for the view. - */ - backgroundGradient: Gradient; - - /** - * Background image for the view, specified as a local file path or URL. - */ - backgroundImage: string; - - /** - * Determines whether to tile a background across a view. - */ - backgroundRepeat: boolean; - - /** - * Size of the left end cap. - */ - backgroundLeftCap: number; - - /** - * Size of the top end cap. - */ - backgroundTopCap: number; - - /** - * Border color of the view, as a color name or hex triplet. - */ - borderColor: string; - - /** - * Radius for the rounded corners of the view's border. - */ - borderRadius: number; - - /** - * Border width of the view. - */ - borderWidth: number; - - /** - * View's bottom position, in platform-specific units. - */ - bottom: number | string; - - /** - * View's center position, in the parent view's coordinates. - */ - center: Point; - - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - - /** - * View's clipping behavior. - */ - clipMode: number; - - /** - * View height, in platform-specific units. - */ - height: number | string; - - /** - * View's left position, in platform-specific units. - */ - left: number | string; - - /** - * Specifies how the view positions its children. - * One of: 'composite', 'vertical', or 'horizontal'. - */ - layout: string; - - /** - * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). - */ - opacity: number; - - /** - * Background color of the wrapper view when this view is used as either or . - */ - pullBackgroundColor: string; - - /** - * The preview context used in the 3D-Touch feature "Peek and Pop". - */ - previewContext: Titanium.UI.iOS.PreviewContext; - - /** - * View's right position, in platform-specific units. - */ - right: number | string; - - /** - * The bounding box of the view relative to its parent, in system units. - */ - readonly rect: Dimension; - - /** - * The size of the view in system units. - */ - readonly size: Dimension; - - /** - * The view's tintColor. This property is applicable on iOS 7 and greater. - */ - tintColor: string; - - /** - * The view's top position. - */ - top: number | string; - - /** - * Determines whether view should receive touch events. - */ - touchEnabled: boolean; - - /** - * Transformation matrix to apply to the view. - */ - transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Determines the blur radius used to create the shadow. - */ - viewShadowRadius: number; - - /** - * Determines the color of the shadow. - */ - viewShadowColor: string; - - /** - * Determines the offset for the shadow of the view. - */ - viewShadowOffset: Point; - - /** - * Determines whether the view is visible. - */ - visible: boolean; - - /** - * View's width, in platform-specific units. - */ - width: number | string; - - /** - * Determines whether the layout has wrapping behavior. - */ - horizontalWrap: boolean; - - /** - * Z-index stack order position, relative to other sibling views. - */ - zIndex: number; - + interface MaskedImage extends Titanium.UI.View { /** * Image drawn as the background image. */ @@ -10183,488 +10067,6 @@ declare namespace Titanium { */ tint: string; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - - /** - * Animates this view. - */ - animate(animation: any, callback?: (param0: any) => any): void; - - /** - * Finishes a batch update of the View's layout properties and schedules a layout pass of the - * view tree. - */ - finishLayout(): void; - - /** - * Hides this view. - */ - hide(options?: AnimationOption): void; - - /** - * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - insertAt(params: any): void; - - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - - /** - * Makes this view visible. - */ - show(options?: AnimationOption): void; - - /** - * Starts a batch update of this view's layout properties. - */ - startLayout(): void; - - /** - * Returns an image of the rendered view, as a Blob. - */ - toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; - - /** - * Performs a batch update of all supplied layout properties and schedules a layout pass after - * they have been updated. - */ - updateLayout(params: any): void; - - /** - * Translates a point from this view's coordinate system to another view's coordinate system. - */ - convertPointToView(point: Point, destinationView: any): Point; - - /** - * Returns the matching view of a given view ID. - */ - getViewById(id: string): Titanium.UI.View; - - /** - * Gets the value of the property. - */ - getAccessibilityHidden(): boolean; - - /** - * Sets the value of the property. - */ - setAccessibilityHidden(accessibilityHidden: boolean): void; - - /** - * Gets the value of the property. - */ - getAccessibilityHint(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityHint(accessibilityHint: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityLabel(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityLabel(accessibilityLabel: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityValue(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityValue(accessibilityValue: string): void; - - /** - * Gets the value of the property. - */ - getAnchorPoint(): Point; - - /** - * Sets the value of the property. - */ - setAnchorPoint(anchorPoint: Point): void; - - /** - * Gets the value of the property. - */ - getAnimatedCenter(): Point; - - /** - * Gets the value of the property. - */ - getBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundColor(backgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundGradient(): Gradient; - - /** - * Sets the value of the property. - */ - setBackgroundGradient(backgroundGradient: Gradient): void; - - /** - * Gets the value of the property. - */ - getBackgroundImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundImage(backgroundImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundRepeat(): boolean; - - /** - * Sets the value of the property. - */ - setBackgroundRepeat(backgroundRepeat: boolean): void; - - /** - * Gets the value of the property. - */ - getBackgroundLeftCap(): number; - - /** - * Sets the value of the property. - */ - setBackgroundLeftCap(backgroundLeftCap: number): void; - - /** - * Gets the value of the property. - */ - getBackgroundTopCap(): number; - - /** - * Sets the value of the property. - */ - setBackgroundTopCap(backgroundTopCap: number): void; - - /** - * Gets the value of the property. - */ - getBorderColor(): string; - - /** - * Sets the value of the property. - */ - setBorderColor(borderColor: string): void; - - /** - * Gets the value of the property. - */ - getBorderRadius(): number; - - /** - * Sets the value of the property. - */ - setBorderRadius(borderRadius: number): void; - - /** - * Gets the value of the property. - */ - getBorderWidth(): number; - - /** - * Sets the value of the property. - */ - setBorderWidth(borderWidth: number): void; - - /** - * Gets the value of the property. - */ - getBottom(): number | string; - - /** - * Sets the value of the property. - */ - setBottom(bottom: number): void; - - /** - * Sets the value of the property. - */ - setBottom(bottom: string): void; - - /** - * Gets the value of the property. - */ - getCenter(): Point; - - /** - * Sets the value of the property. - */ - setCenter(center: Point): void; - - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - - /** - * Gets the value of the property. - */ - getClipMode(): number; - - /** - * Sets the value of the property. - */ - setClipMode(clipMode: number): void; - - /** - * Gets the value of the property. - */ - getHeight(): number | string; - - /** - * Sets the value of the property. - */ - setHeight(height: number): void; - - /** - * Sets the value of the property. - */ - setHeight(height: string): void; - - /** - * Gets the value of the property. - */ - getLeft(): number | string; - - /** - * Sets the value of the property. - */ - setLeft(left: number): void; - - /** - * Sets the value of the property. - */ - setLeft(left: string): void; - - /** - * Gets the value of the property. - */ - getLayout(): string; - - /** - * Sets the value of the property. - */ - setLayout(layout: string): void; - - /** - * Gets the value of the property. - */ - getOpacity(): number; - - /** - * Sets the value of the property. - */ - setOpacity(opacity: number): void; - - /** - * Gets the value of the property. - */ - getPullBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setPullBackgroundColor(pullBackgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getPreviewContext(): Titanium.UI.iOS.PreviewContext; - - /** - * Sets the value of the property. - */ - setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; - - /** - * Gets the value of the property. - */ - getRight(): number | string; - - /** - * Sets the value of the property. - */ - setRight(right: number): void; - - /** - * Sets the value of the property. - */ - setRight(right: string): void; - - /** - * Gets the value of the property. - */ - getRect(): Dimension; - - /** - * Gets the value of the property. - */ - getSize(): Dimension; - - /** - * Gets the value of the property. - */ - getTintColor(): string; - - /** - * Sets the value of the property. - */ - setTintColor(tintColor: string): void; - - /** - * Gets the value of the property. - */ - getTop(): number | string; - - /** - * Sets the value of the property. - */ - setTop(top: number): void; - - /** - * Sets the value of the property. - */ - setTop(top: string): void; - - /** - * Gets the value of the property. - */ - getTouchEnabled(): boolean; - - /** - * Sets the value of the property. - */ - setTouchEnabled(touchEnabled: boolean): void; - - /** - * Gets the value of the property. - */ - getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix2D): void; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix3D): void; - - /** - * Gets the value of the property. - */ - getViewShadowRadius(): number; - - /** - * Sets the value of the property. - */ - setViewShadowRadius(viewShadowRadius: number): void; - - /** - * Gets the value of the property. - */ - getViewShadowColor(): string; - - /** - * Sets the value of the property. - */ - setViewShadowColor(viewShadowColor: string): void; - - /** - * Gets the value of the property. - */ - getViewShadowOffset(): Point; - - /** - * Sets the value of the property. - */ - setViewShadowOffset(viewShadowOffset: Point): void; - - /** - * Gets the value of the property. - */ - getVisible(): boolean; - - /** - * Sets the value of the property. - */ - setVisible(visible: boolean): void; - - /** - * Gets the value of the property. - */ - getWidth(): number | string; - - /** - * Sets the value of the property. - */ - setWidth(width: number): void; - - /** - * Sets the value of the property. - */ - setWidth(width: string): void; - - /** - * Gets the value of the property. - */ - getHorizontalWrap(): boolean; - - /** - * Sets the value of the property. - */ - setHorizontalWrap(horizontalWrap: boolean): void; - - /** - * Gets the value of the property. - */ - getZIndex(): number; - - /** - * Sets the value of the property. - */ - setZIndex(zIndex: number): void; - /** * Gets the value of the property. */ @@ -10711,262 +10113,6 @@ declare namespace Titanium { * A toast notification. */ interface Notification extends Titanium.Proxy { - /** - * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. - */ - accessibilityHidden: boolean; - - /** - * Briefly describes what performing an action (such as a click) on the view will do. - */ - accessibilityHint: string; - - /** - * A succint label identifying the view for the device's accessibility service. - */ - accessibilityLabel: string; - - /** - * A string describing the value (if any) of the view for the device's accessibility service. - */ - accessibilityValue: string; - - /** - * Background color of the view, as a color name or hex triplet. - */ - backgroundColor: string; - - /** - * Disabled background color of the view, as a color name or hex triplet. - */ - backgroundDisabledColor: string; - - /** - * Disabled background image for the view, specified as a local file path or URL. - */ - backgroundDisabledImage: string; - - /** - * Focused background color of the view, as a color name or hex triplet. - */ - backgroundFocusedColor: string; - - /** - * Focused background image for the view, specified as a local file path or URL. - */ - backgroundFocusedImage: string; - - /** - * A background gradient for the view. - */ - backgroundGradient: Gradient; - - /** - * Background image for the view, specified as a local file path or URL. - */ - backgroundImage: string; - - /** - * Determines whether to tile a background across a view. - */ - backgroundRepeat: boolean; - - /** - * Selected background color of the view, as a color name or hex triplet. - */ - backgroundSelectedColor: string; - - /** - * Selected background image url for the view, specified as a local file path or URL. - */ - backgroundSelectedImage: string; - - /** - * Border color of the view, as a color name or hex triplet. - */ - borderColor: string; - - /** - * Radius for the rounded corners of the view's border. - */ - borderRadius: number; - - /** - * Border width of the view. - */ - borderWidth: number; - - /** - * View's bottom position, in platform-specific units. - */ - bottom: number | string; - - /** - * View's center position, in the parent view's coordinates. - */ - center: Point; - - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - - /** - * Base elevation of the view relative to its parent in pixels. - */ - elevation: number; - - /** - * Whether view should be focusable while navigating with the trackball. - */ - focusable: boolean; - - /** - * View height, in platform-specific units. - */ - height: number | string; - - /** - * Sets the behavior when hiding an object to release or keep the free space - */ - hiddenBehavior: number; - - /** - * View's left position, in platform-specific units. - */ - left: number | string; - - /** - * Specifies how the view positions its children. - * One of: 'composite', 'vertical', or 'horizontal'. - */ - layout: string; - - /** - * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). - */ - opacity: number; - - /** - * When on, animate call overrides current animation if applicable. - */ - overrideCurrentAnimation: boolean; - - /** - * View's right position, in platform-specific units. - */ - right: number | string; - - /** - * The bounding box of the view relative to its parent, in system units. - */ - readonly rect: Dimension; - - /** - * Clockwise 2D rotation of the view in degrees. - */ - rotation: number; - - /** - * Clockwise rotation of the view in degrees (x-axis). - */ - rotationX: number; - - /** - * Clockwise rotation of the view in degrees (y-axis). - */ - rotationY: number; - - /** - * Scaling of the view in x-axis in pixels. - */ - scaleX: number; - - /** - * Scaling of the view in y-axis in pixels. - */ - scaleY: number; - - /** - * The size of the view in system units. - */ - readonly size: Dimension; - - /** - * Determines keyboard behavior when this view is focused. - */ - softKeyboardOnFocus: number; - - /** - * The view's top position. - */ - top: number | string; - - /** - * Determines whether view should receive touch events. - */ - touchEnabled: boolean; - - /** - * A material design visual construct that provides an instantaneous visual confirmation of touch point. - */ - touchFeedback: boolean; - - /** - * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. - */ - touchFeedbackColor: string; - - /** - * Transformation matrix to apply to the view. - */ - transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Horizontal location of the view relative to its left position in pixels. - */ - translationX: number; - - /** - * Vertical location of the view relative to its top position in pixels. - */ - translationY: number; - - /** - * Depth of the view relative to its elevation in pixels. - */ - translationZ: number; - - /** - * A name to identify this view in activity transition. - */ - transitionName: string; - - /** - * Determines whether the view is visible. - */ - visible: boolean; - - /** - * View's width, in platform-specific units. - */ - width: number | string; - - /** - * Determines whether the layout has wrapping behavior. - */ - horizontalWrap: boolean; - - /** - * Z-index stack order position, relative to other sibling views. - */ - zIndex: number; - - /** - * Determines whether to keep the device screen on. - */ - keepScreenOn: boolean; - /** * Notification text to display. */ @@ -11002,612 +10148,10 @@ declare namespace Titanium { */ verticalMargin: number; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - - /** - * Animates this view. - */ - animate(animation: any, callback?: (param0: any) => any): void; - - /** - * Finishes a batch update of the View's layout properties and schedules a layout pass of the - * view tree. - */ - finishLayout(): void; - - /** - * Hides this view. - */ - hide(options?: AnimationOption): void; - - /** - * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - insertAt(params: any): void; - - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Show the notification. */ - show(options?: AnimationOption): void; - - /** - * Starts a batch update of this view's layout properties. - */ - startLayout(): void; - - /** - * Returns an image of the rendered view, as a Blob. - */ - toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; - - /** - * Performs a batch update of all supplied layout properties and schedules a layout pass after - * they have been updated. - */ - updateLayout(params: any): void; - - /** - * Translates a point from this view's coordinate system to another view's coordinate system. - */ - convertPointToView(point: Point, destinationView: any): Point; - - /** - * Returns the matching view of a given view ID. - */ - getViewById(id: string): Titanium.UI.View; - - /** - * Gets the value of the property. - */ - getAccessibilityHidden(): boolean; - - /** - * Sets the value of the property. - */ - setAccessibilityHidden(accessibilityHidden: boolean): void; - - /** - * Gets the value of the property. - */ - getAccessibilityHint(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityHint(accessibilityHint: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityLabel(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityLabel(accessibilityLabel: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityValue(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityValue(accessibilityValue: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundColor(backgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundDisabledColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundDisabledColor(backgroundDisabledColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundDisabledImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundDisabledImage(backgroundDisabledImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundFocusedColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundFocusedColor(backgroundFocusedColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundFocusedImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundFocusedImage(backgroundFocusedImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundGradient(): Gradient; - - /** - * Sets the value of the property. - */ - setBackgroundGradient(backgroundGradient: Gradient): void; - - /** - * Gets the value of the property. - */ - getBackgroundImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundImage(backgroundImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundRepeat(): boolean; - - /** - * Sets the value of the property. - */ - setBackgroundRepeat(backgroundRepeat: boolean): void; - - /** - * Gets the value of the property. - */ - getBackgroundSelectedColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundSelectedColor(backgroundSelectedColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundSelectedImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundSelectedImage(backgroundSelectedImage: string): void; - - /** - * Gets the value of the property. - */ - getBorderColor(): string; - - /** - * Sets the value of the property. - */ - setBorderColor(borderColor: string): void; - - /** - * Gets the value of the property. - */ - getBorderRadius(): number; - - /** - * Sets the value of the property. - */ - setBorderRadius(borderRadius: number): void; - - /** - * Gets the value of the property. - */ - getBorderWidth(): number; - - /** - * Sets the value of the property. - */ - setBorderWidth(borderWidth: number): void; - - /** - * Gets the value of the property. - */ - getBottom(): number | string; - - /** - * Sets the value of the property. - */ - setBottom(bottom: number): void; - - /** - * Sets the value of the property. - */ - setBottom(bottom: string): void; - - /** - * Gets the value of the property. - */ - getCenter(): Point; - - /** - * Sets the value of the property. - */ - setCenter(center: Point): void; - - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - - /** - * Gets the value of the property. - */ - getElevation(): number; - - /** - * Sets the value of the property. - */ - setElevation(elevation: number): void; - - /** - * Gets the value of the property. - */ - getFocusable(): boolean; - - /** - * Sets the value of the property. - */ - setFocusable(focusable: boolean): void; - - /** - * Gets the value of the property. - */ - getHeight(): number | string; - - /** - * Sets the value of the property. - */ - setHeight(height: number): void; - - /** - * Sets the value of the property. - */ - setHeight(height: string): void; - - /** - * Gets the value of the property. - */ - getHiddenBehavior(): number; - - /** - * Sets the value of the property. - */ - setHiddenBehavior(hiddenBehavior: number): void; - - /** - * Gets the value of the property. - */ - getLeft(): number | string; - - /** - * Sets the value of the property. - */ - setLeft(left: number): void; - - /** - * Sets the value of the property. - */ - setLeft(left: string): void; - - /** - * Gets the value of the property. - */ - getLayout(): string; - - /** - * Sets the value of the property. - */ - setLayout(layout: string): void; - - /** - * Gets the value of the property. - */ - getOpacity(): number; - - /** - * Sets the value of the property. - */ - setOpacity(opacity: number): void; - - /** - * Gets the value of the property. - */ - getOverrideCurrentAnimation(): boolean; - - /** - * Sets the value of the property. - */ - setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; - - /** - * Gets the value of the property. - */ - getRight(): number | string; - - /** - * Sets the value of the property. - */ - setRight(right: number): void; - - /** - * Sets the value of the property. - */ - setRight(right: string): void; - - /** - * Gets the value of the property. - */ - getRect(): Dimension; - - /** - * Gets the value of the property. - */ - getRotation(): number; - - /** - * Sets the value of the property. - */ - setRotation(rotation: number): void; - - /** - * Gets the value of the property. - */ - getRotationX(): number; - - /** - * Sets the value of the property. - */ - setRotationX(rotationX: number): void; - - /** - * Gets the value of the property. - */ - getRotationY(): number; - - /** - * Sets the value of the property. - */ - setRotationY(rotationY: number): void; - - /** - * Gets the value of the property. - */ - getScaleX(): number; - - /** - * Sets the value of the property. - */ - setScaleX(scaleX: number): void; - - /** - * Gets the value of the property. - */ - getScaleY(): number; - - /** - * Sets the value of the property. - */ - setScaleY(scaleY: number): void; - - /** - * Gets the value of the property. - */ - getSize(): Dimension; - - /** - * Gets the value of the property. - */ - getSoftKeyboardOnFocus(): number; - - /** - * Sets the value of the property. - */ - setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; - - /** - * Gets the value of the property. - */ - getTop(): number | string; - - /** - * Sets the value of the property. - */ - setTop(top: number): void; - - /** - * Sets the value of the property. - */ - setTop(top: string): void; - - /** - * Gets the value of the property. - */ - getTouchEnabled(): boolean; - - /** - * Sets the value of the property. - */ - setTouchEnabled(touchEnabled: boolean): void; - - /** - * Gets the value of the property. - */ - getTouchFeedback(): boolean; - - /** - * Sets the value of the property. - */ - setTouchFeedback(touchFeedback: boolean): void; - - /** - * Gets the value of the property. - */ - getTouchFeedbackColor(): string; - - /** - * Sets the value of the property. - */ - setTouchFeedbackColor(touchFeedbackColor: string): void; - - /** - * Gets the value of the property. - */ - getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix2D): void; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix3D): void; - - /** - * Gets the value of the property. - */ - getTranslationX(): number; - - /** - * Sets the value of the property. - */ - setTranslationX(translationX: number): void; - - /** - * Gets the value of the property. - */ - getTranslationY(): number; - - /** - * Sets the value of the property. - */ - setTranslationY(translationY: number): void; - - /** - * Gets the value of the property. - */ - getTranslationZ(): number; - - /** - * Sets the value of the property. - */ - setTranslationZ(translationZ: number): void; - - /** - * Gets the value of the property. - */ - getTransitionName(): string; - - /** - * Sets the value of the property. - */ - setTransitionName(transitionName: string): void; - - /** - * Gets the value of the property. - */ - getVisible(): boolean; - - /** - * Sets the value of the property. - */ - setVisible(visible: boolean): void; - - /** - * Gets the value of the property. - */ - getWidth(): number | string; - - /** - * Sets the value of the property. - */ - setWidth(width: number): void; - - /** - * Sets the value of the property. - */ - setWidth(width: string): void; - - /** - * Gets the value of the property. - */ - getHorizontalWrap(): boolean; - - /** - * Sets the value of the property. - */ - setHorizontalWrap(horizontalWrap: boolean): void; - - /** - * Gets the value of the property. - */ - getZIndex(): number; - - /** - * Sets the value of the property. - */ - setZIndex(zIndex: number): void; - - /** - * Gets the value of the property. - */ - getKeepScreenOn(): boolean; - - /** - * Sets the value of the property. - */ - setKeepScreenOn(keepScreenOn: boolean): void; + show(): void; /** * Gets the value of the property. @@ -12136,7 +10680,7 @@ declare namespace Titanium { /** * A picker column, representing a selectable group of items in a . */ - interface PickerColumn extends Titanium.UI.View { + interface PickerColumn extends Titanium.Proxy { /** * Number of rows in this column. */ @@ -12363,7 +10907,7 @@ declare namespace Titanium { /** * The RefreshControl is a representation of the native iOS - * [UIRefreshControl](https://developer.apple.com/library/ios/documentation/uikit/reference/UIRefreshControl_class/Reference/Reference.html) + * [UIRefreshControl](https://developer.apple.com/documentation/uikit/uirefreshcontrol) * and Android [SwipeRefreshLayout](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html). */ interface RefreshControl extends Titanium.Proxy { @@ -13078,6 +11622,16 @@ declare namespace Titanium { */ color: string; + /** + * Background image of the text field, specified as a local file path or URL. + */ + fieldBackgroundImage: string; + + /** + * Background image of the text field in disabled state, specified as a local file path or URL. + */ + fieldBackgroundDisabledImage: string; + /** * Text to show when the search bar field is not focused. */ @@ -13200,6 +11754,26 @@ declare namespace Titanium { */ setColor(color: string): void; + /** + * Gets the value of the property. + */ + getFieldBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setFieldBackgroundImage(fieldBackgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getFieldBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setFieldBackgroundDisabledImage(fieldBackgroundDisabledImage: string): void; + /** * Gets the value of the property. */ @@ -13916,12 +12490,12 @@ declare namespace Titanium { iconInsets: TabIconInsets; /** - * Defines if the icon property of the tab must be used as a mask. This property is applicable on iOS 7 and greater. + * Defines if the icon property of the tab must be used as a mask. */ iconIsMask: boolean; /** - * Defines if the active icon property of the tab must be used as a mask. This property is applicable on iOS 7 and greater. + * Defines if the active icon property of the tab must be used as a mask. */ activeIconIsMask: boolean; @@ -14582,11 +13156,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -14597,6 +13166,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -14639,7 +13213,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -14658,6 +13232,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -14708,16 +13287,6 @@ declare namespace Titanium { */ style: number; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -14739,21 +13308,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -14955,11 +13509,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -14985,6 +13534,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -15115,6 +13674,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -15411,17 +13980,17 @@ declare namespace Titanium { separatorColor: string; /** - * The insets for table view separators (applies to all cells). This property is applicable on iOS 7 and greater. + * The insets for table view separators (applies to all cells). */ separatorInsets: any; /** - * The insets for the table view header and footer. This property is applicable on iOS 7 and greater. + * The insets for the table view header and footer. */ tableSeparatorInsets: any; /** - * The insets for table view cells (applies to all cells). This property is applicable on iOS 7 and greater. + * The insets for table view cells (applies to all cells). */ rowSeparatorInsets: any; @@ -15441,6 +14010,27 @@ declare namespace Titanium { */ style: number; + /** + * The background color of the search results (iOS-only). + */ + resultsBackgroundColor: string; + + /** + * Separator line color between rows inside search results, + * as a color name or hex triplet (iOS-only). + */ + resultsSeparatorColor: string; + + /** + * The separator style of the search results (iOS-only). + */ + resultsSeparatorStyle: number; + + /** + * The insets for search results separators (applies to all cells & iOS-only). + */ + resultsSeparatorInsets: any; + /** * Appends a single row or an array of rows to the end of the table. */ @@ -15954,6 +14544,46 @@ declare namespace Titanium { */ setStyle(style: number): void; + /** + * Gets the value of the property. + */ + getResultsBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setResultsBackgroundColor(resultsBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setResultsSeparatorColor(resultsSeparatorColor: string): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setResultsSeparatorStyle(resultsSeparatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setResultsSeparatorInsets(resultsSeparatorInsets: any): void; + } /** @@ -16473,11 +15103,21 @@ declare namespace Titanium { */ keyboardType: number; + /** + * Number of lines tall the text area height will be, if set. + */ + lines: number; + /** * Maximum length of text field input. */ maxLength: number; + /** + * Maximum line count of text field input. + */ + maxLines: number; + /** * Sets the left and right padding of this TextArea. The text will always be vertically centered. */ @@ -16784,6 +15424,16 @@ declare namespace Titanium { */ setKeyboardType(keyboardType: number): void; + /** + * Gets the value of the property. + */ + getLines(): number; + + /** + * Sets the value of the property. + */ + setLines(lines: number): void; + /** * Gets the value of the property. */ @@ -16794,6 +15444,16 @@ declare namespace Titanium { */ setMaxLength(maxLength: number): void; + /** + * Gets the value of the property. + */ + getMaxLines(): number; + + /** + * Sets the value of the property. + */ + setMaxLines(maxLines: number): void; + /** * Gets the value of the property. */ @@ -17079,6 +15739,11 @@ declare namespace Titanium { */ passwordMask: boolean; + /** + * Set password rules that should be used for this text field. + */ + passwordRules: string; + /** * Specifies the text to display on the keyboard `Return` key when this field is focused. */ @@ -17500,6 +16165,16 @@ declare namespace Titanium { */ setPasswordMask(passwordMask: boolean): void; + /** + * Gets the value of the property. + */ + getPasswordRules(): string; + + /** + * Sets the value of the property. + */ + setPasswordRules(passwordRules: string): void; + /** * Gets the value of the property. */ @@ -18044,6 +16719,11 @@ declare namespace Titanium { */ requestHeaders: any; + /** + * Manage the zoom-level of the current page. + */ + zoomLevel: number; + /** * Sets the value of [html](Titanium.UI.WebView.html) property. */ @@ -18355,6 +17035,16 @@ declare namespace Titanium { */ setRequestHeaders(requestHeaders: any): void; + /** + * Gets the value of the property. + */ + getZoomLevel(): number; + + /** + * Sets the value of the property. + */ + setZoomLevel(zoomLevel: number): void; + } /** @@ -18396,7 +17086,7 @@ declare namespace Titanium { exitOnClose: boolean; /** - * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + * An array of supported values specified using the EXTEND_EDGE constants in . */ extendEdges: number[]; @@ -18406,12 +17096,12 @@ declare namespace Titanium { flagSecure: boolean; /** - * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). */ includeOpaqueBars: boolean; /** - * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + * Specifies whether or not the view controller should automatically adjust its scroll view insets. */ autoAdjustScrollViewInsets: boolean; @@ -18426,6 +17116,11 @@ declare namespace Titanium { */ fullscreen: boolean; + /** + * Boolean value indicating whether the system is allowed to hide the visual indicator for returning to the Home screen. + */ + homeIndicatorAutoHidden: boolean; + /** * Set this to true to hide the shadow image of the navigation bar. */ @@ -18446,6 +17141,11 @@ declare namespace Titanium { */ hidesBarsWhenKeyboardAppears: boolean; + /** + * Set this to true to hide the back button of navigation bar. + */ + hidesBackButton: boolean; + /** * A Boolean value indicating whether the title should be displayed in a large format. */ @@ -18477,10 +17177,15 @@ declare namespace Titanium { navBarHidden: boolean; /** - * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + * The tintColor to apply to the navigation bar. */ navTintColor: string; + /** + * The instance hosting this window. + */ + readonly navigationWindow: Titanium.UI.iOS.NavigationWindow; + /** * Callback function that overrides the default behavior when the user presses the **Back** * button. @@ -18826,6 +17531,16 @@ declare namespace Titanium { */ setFullscreen(fullscreen: boolean): void; + /** + * Gets the value of the property. + */ + getHomeIndicatorAutoHidden(): boolean; + + /** + * Sets the value of the property. + */ + setHomeIndicatorAutoHidden(homeIndicatorAutoHidden: boolean): void; + /** * Gets the value of the property. */ @@ -18866,6 +17581,16 @@ declare namespace Titanium { */ setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + /** + * Gets the value of the property. + */ + getHidesBackButton(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBackButton(hidesBackButton: boolean): void; + /** * Gets the value of the property. */ @@ -18936,6 +17661,11 @@ declare namespace Titanium { */ setNavTintColor(navTintColor: string): void; + /** + * Gets the value of the property. + */ + getNavigationWindow(): Titanium.UI.iOS.NavigationWindow; + /** * Gets the value of the property. */ @@ -19925,7 +18655,7 @@ declare namespace Titanium { function createSearchView(parameters?: any): Titanium.UI.Android.SearchView; /** - * An elevated view with rounded corners. + * CardView provides a layout container with rounded corners and a shadow indicating the view is elevated. */ interface CardView extends Titanium.Proxy { /** @@ -19973,21 +18703,6 @@ declare namespace Titanium { */ backgroundFocusedImage: string; - /** - * A background gradient for the view. - */ - backgroundGradient: Gradient; - - /** - * Background image for the view, specified as a local file path or URL. - */ - backgroundImage: string; - - /** - * Determines whether to tile a background across a view. - */ - backgroundRepeat: boolean; - /** * Selected background color of the view, as a color name or hex triplet. */ @@ -19998,11 +18713,6 @@ declare namespace Titanium { */ backgroundSelectedImage: string; - /** - * Border color of the view, as a color name or hex triplet. - */ - borderColor: string; - /** * Corner radius for CardView. */ @@ -20448,36 +19158,6 @@ declare namespace Titanium { */ setBackgroundFocusedImage(backgroundFocusedImage: string): void; - /** - * Gets the value of the property. - */ - getBackgroundGradient(): Gradient; - - /** - * Sets the value of the property. - */ - setBackgroundGradient(backgroundGradient: Gradient): void; - - /** - * Gets the value of the property. - */ - getBackgroundImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundImage(backgroundImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundRepeat(): boolean; - - /** - * Sets the value of the property. - */ - setBackgroundRepeat(backgroundRepeat: boolean): void; - /** * Gets the value of the property. */ @@ -20498,16 +19178,6 @@ declare namespace Titanium { */ setBackgroundSelectedImage(backgroundSelectedImage: string): void; - /** - * Gets the value of the property. - */ - getBorderColor(): string; - - /** - * Sets the value of the property. - */ - setBorderColor(borderColor: string): void; - /** * Gets the value of the property. */ @@ -22832,6 +21502,11 @@ declare namespace Titanium { */ hintText: string; + /** + * Color of hint text that displays when field is empty. + */ + hintTextColor: string; + /** * Value of the search view. */ @@ -23479,6 +22154,16 @@ declare namespace Titanium { */ setHintText(hintText: string): void; + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + /** * Gets the value of the property. */ @@ -24188,26 +22873,6 @@ declare namespace Titanium { */ const COLLISION_MODE_ITEM: number; - /** - * Returns the iOS system texture used to render the background on a group table view. - */ - const COLOR_GROUP_TABLEVIEW_BACKGROUND: string; - - /** - * Returns the iOS system texture used to render the area behind scrollable content. - */ - const COLOR_SCROLLVIEW_BACKGROUND: string; - - /** - * Returns the iOS system texture used for the back side of a view while it is being flipped. - */ - const COLOR_VIEW_FLIPSIDE_BACKGROUND: string; - - /** - * Returns the iOS system texture used to render the background of a page. - */ - const COLOR_UNDER_PAGE_BACKGROUND: string; - /** * Determines if the 3D-Touch capability "Force Touch" is supported (`true`) or not (`false`) by the device. */ @@ -24302,6 +22967,16 @@ declare namespace Titanium { */ let MODAL_PRESENTATION_CURRENT_CONTEXT: number; + /** + * View presented over its parent window. + */ + let MODAL_PRESENTATION_OVER_CURRENT_CONTEXT: number; + + /** + * Presented view covers the screen. + */ + let MODAL_PRESENTATION_OVER_CURRENT_FULL_SCREEN: number; + /** * Window width and height are smaller than those of the screen and the view is centered on * the screen. @@ -24412,12 +23087,12 @@ declare namespace Titanium { const KEYBOARD_DISMISS_MODE_INTERACTIVE: number; /** - * Use with to change the search bar style. + * Use with to change the search bar style. */ const SEARCH_BAR_STYLE_PROMINENT: number; /** - * Use with to change the search bar style. + * Use with to change the search bar style. */ const SEARCH_BAR_STYLE_MINIMAL: number; @@ -24808,6 +23483,16 @@ declare namespace Titanium { */ function setMODAL_PRESENTATION_CURRENT_CONTEXT(MODAL_PRESENTATION_CURRENT_CONTEXT: number): void; + /** + * Sets the value of the property. + */ + function setMODAL_PRESENTATION_OVER_CURRENT_CONTEXT(MODAL_PRESENTATION_OVER_CURRENT_CONTEXT: number): void; + + /** + * Sets the value of the property. + */ + function setMODAL_PRESENTATION_OVER_CURRENT_FULL_SCREEN(MODAL_PRESENTATION_OVER_CURRENT_FULL_SCREEN: number): void; + /** * Gets the value of the property. */ @@ -25213,6 +23898,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -25255,7 +23945,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -25274,6 +23964,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -25596,6 +24291,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -25726,6 +24431,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -26124,7 +24839,7 @@ declare namespace Titanium { * A object gives you an easy way implement some complex visual effects. * The blur effect is applied to every view the blur view is added to by default. You can also place the * blur view above other views and all visible views layered under the blur view are blurred as well. - * For more information on BlurView, please refer to the official [Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/). + * For more information on BlurView, please refer to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uivisualeffectview). * Note: Apple introduced two new constants and in * iOS 10. These are internally mapped to and . */ @@ -26229,6 +24944,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -26271,7 +24991,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -26290,6 +25010,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -26607,6 +25332,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -26737,6 +25472,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -27010,11 +25755,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -27025,6 +25765,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -27067,7 +25812,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -27086,6 +25831,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -27131,16 +25881,6 @@ declare namespace Titanium { */ selected: number; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -27162,21 +25902,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -27398,11 +26123,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -27428,6 +26148,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -27558,6 +26288,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -27675,202 +26415,6 @@ declare namespace Titanium { * local system. */ interface DocumentViewer extends Titanium.Proxy { - /** - * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. - */ - accessibilityHidden: boolean; - - /** - * Briefly describes what performing an action (such as a click) on the view will do. - */ - accessibilityHint: string; - - /** - * A succint label identifying the view for the device's accessibility service. - */ - accessibilityLabel: string; - - /** - * A string describing the value (if any) of the view for the device's accessibility service. - */ - accessibilityValue: string; - - /** - * Coordinate of the view about which to pivot an animation. - */ - anchorPoint: Point; - - /** - * Current position of the view during an animation. - */ - readonly animatedCenter: Point; - - /** - * Background color of the view, as a color name or hex triplet. - */ - backgroundColor: string; - - /** - * A background gradient for the view. - */ - backgroundGradient: Gradient; - - /** - * Background image for the view, specified as a local file path or URL. - */ - backgroundImage: string; - - /** - * Determines whether to tile a background across a view. - */ - backgroundRepeat: boolean; - - /** - * Size of the left end cap. - */ - backgroundLeftCap: number; - - /** - * Size of the top end cap. - */ - backgroundTopCap: number; - - /** - * Border color of the view, as a color name or hex triplet. - */ - borderColor: string; - - /** - * Radius for the rounded corners of the view's border. - */ - borderRadius: number; - - /** - * Border width of the view. - */ - borderWidth: number; - - /** - * View's bottom position, in platform-specific units. - */ - bottom: number | string; - - /** - * View's center position, in the parent view's coordinates. - */ - center: Point; - - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - - /** - * View's clipping behavior. - */ - clipMode: number; - - /** - * View height, in platform-specific units. - */ - height: number | string; - - /** - * View's left position, in platform-specific units. - */ - left: number | string; - - /** - * Specifies how the view positions its children. - * One of: 'composite', 'vertical', or 'horizontal'. - */ - layout: string; - - /** - * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). - */ - opacity: number; - - /** - * Background color of the wrapper view when this view is used as either or . - */ - pullBackgroundColor: string; - - /** - * The preview context used in the 3D-Touch feature "Peek and Pop". - */ - previewContext: Titanium.UI.iOS.PreviewContext; - - /** - * View's right position, in platform-specific units. - */ - right: number | string; - - /** - * The bounding box of the view relative to its parent, in system units. - */ - readonly rect: Dimension; - - /** - * The size of the view in system units. - */ - readonly size: Dimension; - - /** - * The view's tintColor. This property is applicable on iOS 7 and greater. - */ - tintColor: string; - - /** - * The view's top position. - */ - top: number | string; - - /** - * Determines whether view should receive touch events. - */ - touchEnabled: boolean; - - /** - * Transformation matrix to apply to the view. - */ - transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Determines the blur radius used to create the shadow. - */ - viewShadowRadius: number; - - /** - * Determines the color of the shadow. - */ - viewShadowColor: string; - - /** - * Determines the offset for the shadow of the view. - */ - viewShadowOffset: Point; - - /** - * Determines whether the view is visible. - */ - visible: boolean; - - /** - * View's width, in platform-specific units. - */ - width: number | string; - - /** - * Determines whether the layout has wrapping behavior. - */ - horizontalWrap: boolean; - - /** - * Z-index stack order position, relative to other sibling views. - */ - zIndex: number; - /** * Name of the file (without the path). */ @@ -27881,488 +26425,16 @@ declare namespace Titanium { */ url: string; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - - /** - * Animates this view. - */ - animate(animation: any, callback?: (param0: any) => any): void; - - /** - * Finishes a batch update of the View's layout properties and schedules a layout pass of the - * view tree. - */ - finishLayout(): void; - /** * Dismisses the document viewer. */ hide(options?: DocumentViewerOptions): void; - /** - * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - insertAt(params: any): void; - - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Displays the document viewer over the current view. */ show(options?: DocumentViewerOptions): void; - /** - * Starts a batch update of this view's layout properties. - */ - startLayout(): void; - - /** - * Returns an image of the rendered view, as a Blob. - */ - toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; - - /** - * Performs a batch update of all supplied layout properties and schedules a layout pass after - * they have been updated. - */ - updateLayout(params: any): void; - - /** - * Translates a point from this view's coordinate system to another view's coordinate system. - */ - convertPointToView(point: Point, destinationView: any): Point; - - /** - * Returns the matching view of a given view ID. - */ - getViewById(id: string): Titanium.UI.View; - - /** - * Gets the value of the property. - */ - getAccessibilityHidden(): boolean; - - /** - * Sets the value of the property. - */ - setAccessibilityHidden(accessibilityHidden: boolean): void; - - /** - * Gets the value of the property. - */ - getAccessibilityHint(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityHint(accessibilityHint: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityLabel(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityLabel(accessibilityLabel: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityValue(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityValue(accessibilityValue: string): void; - - /** - * Gets the value of the property. - */ - getAnchorPoint(): Point; - - /** - * Sets the value of the property. - */ - setAnchorPoint(anchorPoint: Point): void; - - /** - * Gets the value of the property. - */ - getAnimatedCenter(): Point; - - /** - * Gets the value of the property. - */ - getBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundColor(backgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundGradient(): Gradient; - - /** - * Sets the value of the property. - */ - setBackgroundGradient(backgroundGradient: Gradient): void; - - /** - * Gets the value of the property. - */ - getBackgroundImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundImage(backgroundImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundRepeat(): boolean; - - /** - * Sets the value of the property. - */ - setBackgroundRepeat(backgroundRepeat: boolean): void; - - /** - * Gets the value of the property. - */ - getBackgroundLeftCap(): number; - - /** - * Sets the value of the property. - */ - setBackgroundLeftCap(backgroundLeftCap: number): void; - - /** - * Gets the value of the property. - */ - getBackgroundTopCap(): number; - - /** - * Sets the value of the property. - */ - setBackgroundTopCap(backgroundTopCap: number): void; - - /** - * Gets the value of the property. - */ - getBorderColor(): string; - - /** - * Sets the value of the property. - */ - setBorderColor(borderColor: string): void; - - /** - * Gets the value of the property. - */ - getBorderRadius(): number; - - /** - * Sets the value of the property. - */ - setBorderRadius(borderRadius: number): void; - - /** - * Gets the value of the property. - */ - getBorderWidth(): number; - - /** - * Sets the value of the property. - */ - setBorderWidth(borderWidth: number): void; - - /** - * Gets the value of the property. - */ - getBottom(): number | string; - - /** - * Sets the value of the property. - */ - setBottom(bottom: number): void; - - /** - * Sets the value of the property. - */ - setBottom(bottom: string): void; - - /** - * Gets the value of the property. - */ - getCenter(): Point; - - /** - * Sets the value of the property. - */ - setCenter(center: Point): void; - - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - - /** - * Gets the value of the property. - */ - getClipMode(): number; - - /** - * Sets the value of the property. - */ - setClipMode(clipMode: number): void; - - /** - * Gets the value of the property. - */ - getHeight(): number | string; - - /** - * Sets the value of the property. - */ - setHeight(height: number): void; - - /** - * Sets the value of the property. - */ - setHeight(height: string): void; - - /** - * Gets the value of the property. - */ - getLeft(): number | string; - - /** - * Sets the value of the property. - */ - setLeft(left: number): void; - - /** - * Sets the value of the property. - */ - setLeft(left: string): void; - - /** - * Gets the value of the property. - */ - getLayout(): string; - - /** - * Sets the value of the property. - */ - setLayout(layout: string): void; - - /** - * Gets the value of the property. - */ - getOpacity(): number; - - /** - * Sets the value of the property. - */ - setOpacity(opacity: number): void; - - /** - * Gets the value of the property. - */ - getPullBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setPullBackgroundColor(pullBackgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getPreviewContext(): Titanium.UI.iOS.PreviewContext; - - /** - * Sets the value of the property. - */ - setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; - - /** - * Gets the value of the property. - */ - getRight(): number | string; - - /** - * Sets the value of the property. - */ - setRight(right: number): void; - - /** - * Sets the value of the property. - */ - setRight(right: string): void; - - /** - * Gets the value of the property. - */ - getRect(): Dimension; - - /** - * Gets the value of the property. - */ - getSize(): Dimension; - - /** - * Gets the value of the property. - */ - getTintColor(): string; - - /** - * Sets the value of the property. - */ - setTintColor(tintColor: string): void; - - /** - * Gets the value of the property. - */ - getTop(): number | string; - - /** - * Sets the value of the property. - */ - setTop(top: number): void; - - /** - * Sets the value of the property. - */ - setTop(top: string): void; - - /** - * Gets the value of the property. - */ - getTouchEnabled(): boolean; - - /** - * Sets the value of the property. - */ - setTouchEnabled(touchEnabled: boolean): void; - - /** - * Gets the value of the property. - */ - getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix2D): void; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix3D): void; - - /** - * Gets the value of the property. - */ - getViewShadowRadius(): number; - - /** - * Sets the value of the property. - */ - setViewShadowRadius(viewShadowRadius: number): void; - - /** - * Gets the value of the property. - */ - getViewShadowColor(): string; - - /** - * Sets the value of the property. - */ - setViewShadowColor(viewShadowColor: string): void; - - /** - * Gets the value of the property. - */ - getViewShadowOffset(): Point; - - /** - * Sets the value of the property. - */ - setViewShadowOffset(viewShadowOffset: Point): void; - - /** - * Gets the value of the property. - */ - getVisible(): boolean; - - /** - * Sets the value of the property. - */ - setVisible(visible: boolean): void; - - /** - * Gets the value of the property. - */ - getWidth(): number | string; - - /** - * Sets the value of the property. - */ - setWidth(width: number): void; - - /** - * Sets the value of the property. - */ - setWidth(width: string): void; - - /** - * Gets the value of the property. - */ - getHorizontalWrap(): boolean; - - /** - * Sets the value of the property. - */ - setHorizontalWrap(horizontalWrap: boolean): void; - - /** - * Gets the value of the property. - */ - getZIndex(): number; - - /** - * Sets the value of the property. - */ - setZIndex(zIndex: number): void; - /** * Gets the value of the property. */ @@ -28811,6 +26883,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -28853,7 +26930,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -28872,6 +26949,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -29204,6 +27286,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -29334,6 +27426,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -29435,7 +27537,7 @@ declare namespace Titanium { * A menu popup provides the ability to create custom tooltip options using the `items` property * covering the native `UIMenuController` class. * See also: - * * [iOS Developer Library: UIMenuController](https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Reference/UIMenuController_Class/index.html) + * * [iOS Developer Library: UIMenuController](https://developer.apple.com/documentation/uikit/uimenucontroller) */ interface MenuPopup extends Titanium.Proxy { /** @@ -29575,6 +27677,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * Window's left position, in platform-specific units. */ @@ -29617,7 +27724,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -29636,6 +27743,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -29672,17 +27784,17 @@ declare namespace Titanium { zIndex: number; /** - * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + * An array of supported values specified using the EXTEND_EDGE constants in . */ extendEdges: number[]; /** - * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). */ includeOpaqueBars: boolean; /** - * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + * Specifies whether or not the view controller should automatically adjust its scroll view insets. */ autoAdjustScrollViewInsets: boolean; @@ -29697,6 +27809,11 @@ declare namespace Titanium { */ fullscreen: boolean; + /** + * Boolean value indicating whether the system is allowed to hide the visual indicator for returning to the Home screen. + */ + homeIndicatorAutoHidden: boolean; + /** * Set this to true to hide the navigation bar on swipe. */ @@ -29712,6 +27829,11 @@ declare namespace Titanium { */ hidesBarsWhenKeyboardAppears: boolean; + /** + * Set this to true to hide the back button of navigation bar. + */ + hidesBackButton: boolean; + /** * A Boolean value indicating whether the title should be displayed in a large format. */ @@ -29732,6 +27854,11 @@ declare namespace Titanium { */ modal: boolean; + /** + * The instance hosting this window. + */ + readonly navigationWindow: Titanium.UI.iOS.NavigationWindow; + /** * Array of supported orientation modes, specified using the orientation * constants defined in . @@ -30080,6 +28207,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -30210,6 +28347,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -30335,6 +28482,16 @@ declare namespace Titanium { */ setFullscreen(fullscreen: boolean): void; + /** + * Gets the value of the property. + */ + getHomeIndicatorAutoHidden(): boolean; + + /** + * Sets the value of the property. + */ + setHomeIndicatorAutoHidden(homeIndicatorAutoHidden: boolean): void; + /** * Gets the value of the property. */ @@ -30365,6 +28522,16 @@ declare namespace Titanium { */ setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + /** + * Gets the value of the property. + */ + getHidesBackButton(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBackButton(hidesBackButton: boolean): void; + /** * Gets the value of the property. */ @@ -30405,6 +28572,11 @@ declare namespace Titanium { */ setModal(modal: boolean): void; + /** + * Gets the value of the property. + */ + getNavigationWindow(): Titanium.UI.iOS.NavigationWindow; + /** * Gets the value of the property. */ @@ -30859,6 +29031,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * Window's left position, in platform-specific units. */ @@ -30901,7 +29078,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -30920,6 +29097,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -30976,17 +29158,17 @@ declare namespace Titanium { barImage: string; /** - * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + * An array of supported values specified using the EXTEND_EDGE constants in . */ extendEdges: number[]; /** - * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). */ includeOpaqueBars: boolean; /** - * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + * Specifies whether or not the view controller should automatically adjust its scroll view insets. */ autoAdjustScrollViewInsets: boolean; @@ -31001,6 +29183,11 @@ declare namespace Titanium { */ fullscreen: boolean; + /** + * Boolean value indicating whether the system is allowed to hide the visual indicator for returning to the Home screen. + */ + homeIndicatorAutoHidden: boolean; + /** * Set this to true to hide the shadow image of the navigation bar. */ @@ -31021,6 +29208,11 @@ declare namespace Titanium { */ hidesBarsWhenKeyboardAppears: boolean; + /** + * Set this to true to hide the back button of navigation bar. + */ + hidesBackButton: boolean; + /** * A Boolean value indicating whether the title should be displayed in a large format. */ @@ -31052,10 +29244,15 @@ declare namespace Titanium { navBarHidden: boolean; /** - * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + * The tintColor to apply to the navigation bar. */ navTintColor: string; + /** + * The instance hosting this window. + */ + readonly navigationWindow: Titanium.UI.iOS.NavigationWindow; + /** * Array of supported orientation modes, specified using the orientation * constants defined in . @@ -31143,14 +29340,14 @@ declare namespace Titanium { url: string; /** - * View for the detail view section of the SplitWindow. + * Window for the detail view section of the SplitWindow. */ - detailView: Titanium.UI.View; + detailView: Titanium.UI.Window; /** - * View for the master view section of the SplitWindow. + * Window for the master view section of the SplitWindow. */ - masterView: Titanium.UI.View; + masterView: Titanium.UI.Window; /** * Determines whether to show the master view in portrait orientation. @@ -31494,6 +29691,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -31624,6 +29831,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -31794,6 +30011,16 @@ declare namespace Titanium { */ setFullscreen(fullscreen: boolean): void; + /** + * Gets the value of the property. + */ + getHomeIndicatorAutoHidden(): boolean; + + /** + * Sets the value of the property. + */ + setHomeIndicatorAutoHidden(homeIndicatorAutoHidden: boolean): void; + /** * Gets the value of the property. */ @@ -31834,6 +30061,16 @@ declare namespace Titanium { */ setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + /** + * Gets the value of the property. + */ + getHidesBackButton(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBackButton(hidesBackButton: boolean): void; + /** * Gets the value of the property. */ @@ -31904,6 +30141,11 @@ declare namespace Titanium { */ setNavTintColor(navTintColor: string): void; + /** + * Gets the value of the property. + */ + getNavigationWindow(): Titanium.UI.iOS.NavigationWindow; + /** * Gets the value of the property. */ @@ -32072,22 +30314,22 @@ declare namespace Titanium { /** * Gets the value of the property. */ - getDetailView(): Titanium.UI.View; + getDetailView(): Titanium.UI.Window; /** * Sets the value of the property. */ - setDetailView(detailView: any): void; + setDetailView(detailView: Titanium.UI.Window): void; /** * Gets the value of the property. */ - getMasterView(): Titanium.UI.View; + getMasterView(): Titanium.UI.Window; /** * Sets the value of the property. */ - setMasterView(masterView: any): void; + setMasterView(masterView: Titanium.UI.Window): void; /** * Gets the value of the property. @@ -32220,11 +30462,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -32235,6 +30472,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -32296,6 +30538,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -32355,9 +30602,9 @@ declare namespace Titanium { autorepeat: boolean; /** - * If YES, incrementing beyond sets value to . likewise, decrementing below - * sets value to . If NO, the stepper does not increment beyond nor - * does it decrement below but rather holds at those values. + * If YES, incrementing beyond sets value to . likewise, decrementing below + * sets value to . If NO, the stepper does not increment beyond nor + * does it decrement below but rather holds at those values. * The default value is NO. */ wraps: boolean; @@ -32408,16 +30655,6 @@ declare namespace Titanium { */ incrementDisabledImage: string; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -32439,21 +30676,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -32655,11 +30877,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -32685,6 +30902,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -32815,6 +31042,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -33101,11 +31338,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -33116,6 +31348,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -33158,7 +31395,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -33177,6 +31414,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -33227,16 +31469,6 @@ declare namespace Titanium { */ style: number; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -33258,21 +31490,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -33474,11 +31691,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -33504,6 +31716,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -33634,6 +31856,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -33815,11 +32047,6 @@ declare namespace Titanium { */ center: Point; - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - /** * View's clipping behavior. */ @@ -33830,6 +32057,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * View's left position, in platform-specific units. */ @@ -33866,7 +32098,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -33885,6 +32117,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -33940,16 +32177,6 @@ declare namespace Titanium { */ translucent: boolean; - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - /** * Animates this view. */ @@ -33971,21 +32198,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Makes this view visible. */ @@ -34147,11 +32359,6 @@ declare namespace Titanium { */ setCenter(center: Point): void; - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - /** * Gets the value of the property. */ @@ -34177,6 +32384,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -34297,6 +32514,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -34963,7 +33190,7 @@ declare namespace Titanium { const GREY: number; /** - * Status bar style to use with dark backgrounds. Valid on iOS 7 and above. + * Status bar style to use with dark backgrounds. */ const LIGHT_CONTENT: number; @@ -35669,674 +33896,16 @@ declare namespace Titanium { * local system. */ interface DocumentViewer extends Titanium.Proxy { - /** - * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. - */ - accessibilityHidden: boolean; - - /** - * Briefly describes what performing an action (such as a click) on the view will do. - */ - accessibilityHint: string; - - /** - * A succint label identifying the view for the device's accessibility service. - */ - accessibilityLabel: string; - - /** - * A string describing the value (if any) of the view for the device's accessibility service. - */ - accessibilityValue: string; - - /** - * Coordinate of the view about which to pivot an animation. - */ - anchorPoint: Point; - - /** - * Current position of the view during an animation. - */ - readonly animatedCenter: Point; - - /** - * Background color of the view, as a color name or hex triplet. - */ - backgroundColor: string; - - /** - * A background gradient for the view. - */ - backgroundGradient: Gradient; - - /** - * Background image for the view, specified as a local file path or URL. - */ - backgroundImage: string; - - /** - * Determines whether to tile a background across a view. - */ - backgroundRepeat: boolean; - - /** - * Size of the left end cap. - */ - backgroundLeftCap: number; - - /** - * Size of the top end cap. - */ - backgroundTopCap: number; - - /** - * Border color of the view, as a color name or hex triplet. - */ - borderColor: string; - - /** - * Radius for the rounded corners of the view's border. - */ - borderRadius: number; - - /** - * Border width of the view. - */ - borderWidth: number; - - /** - * View's bottom position, in platform-specific units. - */ - bottom: number | string; - - /** - * View's center position, in the parent view's coordinates. - */ - center: Point; - - /** - * Array of this view's child views. - */ - readonly children: Titanium.UI.View[]; - - /** - * View's clipping behavior. - */ - clipMode: number; - - /** - * View height, in platform-specific units. - */ - height: number | string; - - /** - * View's left position, in platform-specific units. - */ - left: number | string; - - /** - * Specifies how the view positions its children. - * One of: 'composite', 'vertical', or 'horizontal'. - */ - layout: string; - - /** - * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). - */ - opacity: number; - - /** - * Background color of the wrapper view when this view is used as either or . - */ - pullBackgroundColor: string; - - /** - * View's right position, in platform-specific units. - */ - right: number | string; - - /** - * The bounding box of the view relative to its parent, in system units. - */ - readonly rect: Dimension; - - /** - * The size of the view in system units. - */ - readonly size: Dimension; - - /** - * The view's tintColor. This property is applicable on iOS 7 and greater. - */ - tintColor: string; - - /** - * The view's top position. - */ - top: number | string; - - /** - * Determines whether view should receive touch events. - */ - touchEnabled: boolean; - - /** - * Transformation matrix to apply to the view. - */ - transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Determines the blur radius used to create the shadow. - */ - viewShadowRadius: number; - - /** - * Determines the color of the shadow. - */ - viewShadowColor: string; - - /** - * Determines the offset for the shadow of the view. - */ - viewShadowOffset: Point; - - /** - * Determines whether the view is visible. - */ - visible: boolean; - - /** - * View's width, in platform-specific units. - */ - width: number | string; - - /** - * Determines whether the layout has wrapping behavior. - */ - horizontalWrap: boolean; - - /** - * Z-index stack order position, relative to other sibling views. - */ - zIndex: number; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any): void; - - /** - * Adds a child to this view's hierarchy. - */ - add(view: any[]): void; - - /** - * Animates this view. - */ - animate(animation: any, callback?: (param0: any) => any): void; - - /** - * Finishes a batch update of the View's layout properties and schedules a layout pass of the - * view tree. - */ - finishLayout(): void; - - /** - * Hides this view. - */ - hide(options?: AnimationOption): void; - - /** - * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - insertAt(params: any): void; - - /** - * Removes a child view from this view's hierarchy. - */ - remove(view: any): void; - - /** - * Removes all child views from this view's hierarchy. - */ - removeAllChildren(): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Displays the document viewer over the current view. */ show(animated: boolean, view: any): void; - /** - * Starts a batch update of this view's layout properties. - */ - startLayout(): void; - - /** - * Returns an image of the rendered view, as a Blob. - */ - toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; - - /** - * Performs a batch update of all supplied layout properties and schedules a layout pass after - * they have been updated. - */ - updateLayout(params: any): void; - - /** - * Translates a point from this view's coordinate system to another view's coordinate system. - */ - convertPointToView(point: Point, destinationView: any): Point; - - /** - * Returns the matching view of a given view ID. - */ - getViewById(id: string): Titanium.UI.View; - /** * Sets the url of the document viewer. */ setUrl(url: string): void; - /** - * Gets the value of the property. - */ - getAccessibilityHidden(): boolean; - - /** - * Sets the value of the property. - */ - setAccessibilityHidden(accessibilityHidden: boolean): void; - - /** - * Gets the value of the property. - */ - getAccessibilityHint(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityHint(accessibilityHint: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityLabel(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityLabel(accessibilityLabel: string): void; - - /** - * Gets the value of the property. - */ - getAccessibilityValue(): string; - - /** - * Sets the value of the property. - */ - setAccessibilityValue(accessibilityValue: string): void; - - /** - * Gets the value of the property. - */ - getAnchorPoint(): Point; - - /** - * Sets the value of the property. - */ - setAnchorPoint(anchorPoint: Point): void; - - /** - * Gets the value of the property. - */ - getAnimatedCenter(): Point; - - /** - * Gets the value of the property. - */ - getBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setBackgroundColor(backgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundGradient(): Gradient; - - /** - * Sets the value of the property. - */ - setBackgroundGradient(backgroundGradient: Gradient): void; - - /** - * Gets the value of the property. - */ - getBackgroundImage(): string; - - /** - * Sets the value of the property. - */ - setBackgroundImage(backgroundImage: string): void; - - /** - * Gets the value of the property. - */ - getBackgroundRepeat(): boolean; - - /** - * Sets the value of the property. - */ - setBackgroundRepeat(backgroundRepeat: boolean): void; - - /** - * Gets the value of the property. - */ - getBackgroundLeftCap(): number; - - /** - * Sets the value of the property. - */ - setBackgroundLeftCap(backgroundLeftCap: number): void; - - /** - * Gets the value of the property. - */ - getBackgroundTopCap(): number; - - /** - * Sets the value of the property. - */ - setBackgroundTopCap(backgroundTopCap: number): void; - - /** - * Gets the value of the property. - */ - getBorderColor(): string; - - /** - * Sets the value of the property. - */ - setBorderColor(borderColor: string): void; - - /** - * Gets the value of the property. - */ - getBorderRadius(): number; - - /** - * Sets the value of the property. - */ - setBorderRadius(borderRadius: number): void; - - /** - * Gets the value of the property. - */ - getBorderWidth(): number; - - /** - * Sets the value of the property. - */ - setBorderWidth(borderWidth: number): void; - - /** - * Gets the value of the property. - */ - getBottom(): number | string; - - /** - * Sets the value of the property. - */ - setBottom(bottom: number): void; - - /** - * Sets the value of the property. - */ - setBottom(bottom: string): void; - - /** - * Gets the value of the property. - */ - getCenter(): Point; - - /** - * Sets the value of the property. - */ - setCenter(center: Point): void; - - /** - * Gets the value of the property. - */ - getChildren(): Titanium.UI.View[]; - - /** - * Gets the value of the property. - */ - getClipMode(): number; - - /** - * Sets the value of the property. - */ - setClipMode(clipMode: number): void; - - /** - * Gets the value of the property. - */ - getHeight(): number | string; - - /** - * Sets the value of the property. - */ - setHeight(height: number): void; - - /** - * Sets the value of the property. - */ - setHeight(height: string): void; - - /** - * Gets the value of the property. - */ - getLeft(): number | string; - - /** - * Sets the value of the property. - */ - setLeft(left: number): void; - - /** - * Sets the value of the property. - */ - setLeft(left: string): void; - - /** - * Gets the value of the property. - */ - getLayout(): string; - - /** - * Sets the value of the property. - */ - setLayout(layout: string): void; - - /** - * Gets the value of the property. - */ - getOpacity(): number; - - /** - * Sets the value of the property. - */ - setOpacity(opacity: number): void; - - /** - * Gets the value of the property. - */ - getPullBackgroundColor(): string; - - /** - * Sets the value of the property. - */ - setPullBackgroundColor(pullBackgroundColor: string): void; - - /** - * Gets the value of the property. - */ - getRight(): number | string; - - /** - * Sets the value of the property. - */ - setRight(right: number): void; - - /** - * Sets the value of the property. - */ - setRight(right: string): void; - - /** - * Gets the value of the property. - */ - getRect(): Dimension; - - /** - * Gets the value of the property. - */ - getSize(): Dimension; - - /** - * Gets the value of the property. - */ - getTintColor(): string; - - /** - * Sets the value of the property. - */ - setTintColor(tintColor: string): void; - - /** - * Gets the value of the property. - */ - getTop(): number | string; - - /** - * Sets the value of the property. - */ - setTop(top: number): void; - - /** - * Sets the value of the property. - */ - setTop(top: string): void; - - /** - * Gets the value of the property. - */ - getTouchEnabled(): boolean; - - /** - * Sets the value of the property. - */ - setTouchEnabled(touchEnabled: boolean): void; - - /** - * Gets the value of the property. - */ - getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix2D): void; - - /** - * Sets the value of the property. - */ - setTransform(transform: Titanium.UI.Matrix3D): void; - - /** - * Gets the value of the property. - */ - getViewShadowRadius(): number; - - /** - * Sets the value of the property. - */ - setViewShadowRadius(viewShadowRadius: number): void; - - /** - * Gets the value of the property. - */ - getViewShadowColor(): string; - - /** - * Sets the value of the property. - */ - setViewShadowColor(viewShadowColor: string): void; - - /** - * Gets the value of the property. - */ - getViewShadowOffset(): Point; - - /** - * Sets the value of the property. - */ - setViewShadowOffset(viewShadowOffset: Point): void; - - /** - * Gets the value of the property. - */ - getVisible(): boolean; - - /** - * Sets the value of the property. - */ - setVisible(visible: boolean): void; - - /** - * Gets the value of the property. - */ - getWidth(): number | string; - - /** - * Sets the value of the property. - */ - setWidth(width: number): void; - - /** - * Sets the value of the property. - */ - setWidth(width: string): void; - - /** - * Gets the value of the property. - */ - getHorizontalWrap(): boolean; - - /** - * Sets the value of the property. - */ - setHorizontalWrap(horizontalWrap: boolean): void; - - /** - * Gets the value of the property. - */ - getZIndex(): number; - - /** - * Sets the value of the property. - */ - setZIndex(zIndex: number): void; - } /** @@ -36353,6 +33922,16 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Width of the popover. */ @@ -36388,16 +33967,6 @@ declare namespace Titanium { */ title: string; - /** - * Adds a child to the popover. - */ - add(view: any): void; - - /** - * Adds a child to the popover. - */ - add(view: any[]): void; - /** * Finishes a batch update of the View's layout properties and schedules a layout pass of the * view tree. @@ -36414,16 +33983,6 @@ declare namespace Titanium { */ insertAt(params: any): void; - /** - * Removes a child from the popover. - */ - remove(view: any): void; - - /** - * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. - */ - replaceAt(params: any): void; - /** * Displays the popover. */ @@ -36470,6 +34029,26 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -36652,6 +34231,11 @@ declare namespace Titanium { */ height: number | string; + /** + * Adds a horizontal parallax effect to the view + */ + horizontalMotionEffect: any; + /** * Window's left position, in platform-specific units. */ @@ -36689,7 +34273,7 @@ declare namespace Titanium { readonly size: Dimension; /** - * The view's tintColor. This property is applicable on iOS 7 and greater. + * The view's tintColor */ tintColor: string; @@ -36708,6 +34292,11 @@ declare namespace Titanium { */ transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + /** + * Adds a vertical parallax effect to the view + */ + verticalMotionEffect: any; + /** * Determines the blur radius used to create the shadow. */ @@ -36764,17 +34353,17 @@ declare namespace Titanium { barImage: string; /** - * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + * An array of supported values specified using the EXTEND_EDGE constants in . */ extendEdges: number[]; /** - * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). */ includeOpaqueBars: boolean; /** - * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + * Specifies whether or not the view controller should automatically adjust its scroll view insets. */ autoAdjustScrollViewInsets: boolean; @@ -36789,6 +34378,11 @@ declare namespace Titanium { */ fullscreen: boolean; + /** + * Boolean value indicating whether the system is allowed to hide the visual indicator for returning to the Home screen. + */ + homeIndicatorAutoHidden: boolean; + /** * Set this to true to hide the shadow image of the navigation bar. */ @@ -36809,6 +34403,11 @@ declare namespace Titanium { */ hidesBarsWhenKeyboardAppears: boolean; + /** + * Set this to true to hide the back button of navigation bar. + */ + hidesBackButton: boolean; + /** * A Boolean value indicating whether the title should be displayed in a large format. */ @@ -36840,10 +34439,15 @@ declare namespace Titanium { navBarHidden: boolean; /** - * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + * The tintColor to apply to the navigation bar. */ navTintColor: string; + /** + * The instance hosting this window. + */ + readonly navigationWindow: Titanium.UI.iOS.NavigationWindow; + /** * Array of supported orientation modes, specified using the orientation * constants defined in . @@ -37257,6 +34861,16 @@ declare namespace Titanium { */ setHeight(height: string): void; + /** + * Gets the value of the property. + */ + getHorizontalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setHorizontalMotionEffect(horizontalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -37377,6 +34991,16 @@ declare namespace Titanium { */ setTransform(transform: Titanium.UI.Matrix3D): void; + /** + * Gets the value of the property. + */ + getVerticalMotionEffect(): any; + + /** + * Sets the value of the property. + */ + setVerticalMotionEffect(verticalMotionEffect: any): void; + /** * Gets the value of the property. */ @@ -37547,6 +35171,16 @@ declare namespace Titanium { */ setFullscreen(fullscreen: boolean): void; + /** + * Gets the value of the property. + */ + getHomeIndicatorAutoHidden(): boolean; + + /** + * Sets the value of the property. + */ + setHomeIndicatorAutoHidden(homeIndicatorAutoHidden: boolean): void; + /** * Gets the value of the property. */ @@ -37587,6 +35221,16 @@ declare namespace Titanium { */ setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + /** + * Gets the value of the property. + */ + getHidesBackButton(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBackButton(hidesBackButton: boolean): void; + /** * Gets the value of the property. */ @@ -37657,6 +35301,11 @@ declare namespace Titanium { */ setNavTintColor(navTintColor: string): void; + /** + * Gets the value of the property. + */ + getNavigationWindow(): Titanium.UI.iOS.NavigationWindow; + /** * Gets the value of the property. */ @@ -37930,16 +35579,6 @@ declare namespace Titanium { */ let appSupportsShakeToEdit: boolean; - /** - * Determines whether the status bar is hidden. - */ - const statusBarHidden: boolean; - - /** - * Determines the status bar color style. - */ - const statusBarStyle: number; - /** * Adds the specified callback as an event listener for the named event. */ @@ -37960,16 +35599,6 @@ declare namespace Titanium { */ function applyProperties(props: any): void; - /** - * Hides the status bar. - */ - function hideStatusBar(params?: hideStatusBarParams): void; - - /** - * Shows the status bar. - */ - function showStatusBar(params?: showStatusBarParams): void; - /** * Gets the value of the property. */ @@ -38005,16 +35634,6 @@ declare namespace Titanium { */ function setAppSupportsShakeToEdit(appSupportsShakeToEdit: boolean): void; - /** - * Gets the value of the property. - */ - function getStatusBarHidden(): boolean; - - /** - * Gets the value of the property. - */ - function getStatusBarStyle(): number; - /** * A set of constants for the style that can be used for the `selectionStyle` property of a * ListItem, which is set in the `properties` dictionary of either the or @@ -38584,103 +36203,6 @@ declare namespace Titanium { } - /** - * A set of constants for the status bar style. - */ - namespace StatusBar { - /** - * Indicates if the proxy will bubble an event to its parent. - */ - let bubbleParent: boolean; - - /** - * The name of the API that this proxy corresponds to. - */ - const apiName: string; - - /** - * No animation style, when the status bar is hidden or shown. - */ - const ANIMATION_STYLE_NONE: number; - - /** - * Slide animation style, when the status bar is hidden or shown. - */ - const ANIMATION_STYLE_SLIDE: number; - - /** - * Fade animation style, when the status bar is hidden or shown. - */ - const ANIMATION_STYLE_FADE: number; - - /** - * Default status bar style. - */ - const DEFAULT: number; - - /** - * Gray-colored status bar style. - */ - const GRAY: number; - - /** - * Gray-colored status bar style. - */ - const GREY: number; - - /** - * Status bar style to use with dark backgrounds. Valid on iOS 7 and above. - */ - const LIGHT_CONTENT: number; - - /** - * Opaque black-colored status bar style. - */ - const OPAQUE_BLACK: number; - - /** - * Translucent black-colored status bar style, which provides some degree of transparency to - * the device background. - */ - const TRANSLUCENT_BLACK: number; - - /** - * Adds the specified callback as an event listener for the named event. - */ - function addEventListener(name: string, callback: (param0: any) => any): void; - - /** - * Removes the specified callback as an event listener for the named event. - */ - function removeEventListener(name: string, callback: (param0: any) => any): void; - - /** - * Fires a synthesized event to any registered listeners. - */ - function fireEvent(name: string, event: any): void; - - /** - * Applies the properties to the proxy. - */ - function applyProperties(props: any): void; - - /** - * Gets the value of the property. - */ - function getBubbleParent(): boolean; - - /** - * Sets the value of the property. - */ - function setBubbleParent(bubbleParent: boolean): void; - - /** - * Gets the value of the property. - */ - function getApiName(): string; - - } - /** * A set of constants for creating standard iOS system buttons. */ @@ -39621,10 +37143,15 @@ declare namespace Titanium { let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; /** - * JSON representation of the last analytics event generated. + * JSON representation of the last Analytics event generated. */ const lastEvent: string; + /** + * Allows the user to opt out from Analytics during runtime to comply to GPDR. + */ + let optedOut: boolean; + /** * Sends a generic event for this application session. * **Not displayed in Analytics UI**. @@ -39637,7 +37164,7 @@ declare namespace Titanium { function featureEvent(name: string, data?: any): number; /** - * Sets a list of events that will not be sent to the analytics server. + * Sets a list of events that will not be sent to the Analytics server. */ function filterEvents(events: ReadonlyArray): void; @@ -39699,6 +37226,16 @@ declare namespace Titanium { */ function getLastEvent(): string; + /** + * Gets the value of the property. + */ + function getOptedOut(): boolean; + + /** + * Sets the value of the property. + */ + function setOptedOut(optedOut: boolean): void; + } /** @@ -39960,11 +37497,6 @@ declare namespace Titanium { */ const ACTION_PACKAGE_DATA_CLEARED: string; - /** - * Trigger the download and eventual installation of a package. - */ - const ACTION_PACKAGE_INSTALL: string; - /** * An existing application package has been removed from the device. */ @@ -40090,16 +37622,6 @@ declare namespace Titanium { */ const ACTION_UID_REMOVED: string; - /** - * The device has entered USB Mass Storage mode. - */ - const ACTION_UMS_CONNECTED: string; - - /** - * The device has exited USB Mass Storage mode. - */ - const ACTION_UMS_DISCONNECTED: string; - /** * Sent when the user is present after device wakes up. */ @@ -40387,7 +37909,7 @@ declare namespace Titanium { const FLAG_ACTIVITY_NO_HISTORY: number; /** - * Disables the [onUserLeaveHint()](http://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()) callback. + * Disables the [onUserLeaveHint()](https://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()) callback. */ const FLAG_ACTIVITY_NO_USER_ACTION: number; @@ -41685,7 +39207,7 @@ declare namespace Titanium { /** * Get a boolean property from this Intent. */ - getBooleanExtra(name: string): boolean; + getBooleanExtra(name: string, defaultValue: boolean): boolean; /** * Get the Data URI from this `Intent`. @@ -41695,17 +39217,17 @@ declare namespace Titanium { /** * Get a double property from this `Intent`. */ - getDoubleExtra(name: string): number; + getDoubleExtra(name: string, defaultValue: number): number; /** * Get an integer property from this `Intent`. */ - getIntExtra(name: string): number; + getIntExtra(name: string, defaultValue: number): number; /** * Get a long property from this `Intent`. */ - getLongExtra(name: string): number; + getLongExtra(name: string, defaultValue: number): number; /** * Get a string property from this `Intent`. @@ -42718,6 +40240,16 @@ declare namespace Titanium { */ readonly serviceInstanceId: number; + /** + * Puts the service into the "background" state and removes its foreground notification. + */ + foregroundCancel(): void; + + /** + * Puts the service into the "foreground" state and displays a notification. + */ + foregroundNotify(id: number, notification: Titanium.Android.Notification): void; + /** * Starts the Service. */ @@ -42768,6 +40300,16 @@ declare namespace Titanium { */ getState(): number; + /** + * Returns the Tile's current label. + */ + getLabel(): string; + + /** + * Returns 'true' if the device is currently locked, 'false' otherwise. + */ + isLocked(): boolean; + /** * Returns 'true' if the device is in secure state, 'false' otherwise. */ @@ -42801,7 +40343,7 @@ declare namespace Titanium { } /** - * The Titanium binding of [Android RemoteViews](http://developer.android.com/reference/android/widget/RemoteViews.html). + * The Titanium binding of [Android RemoteViews](https://developer.android.com/reference/android/widget/RemoteViews.html). */ interface RemoteViews extends Titanium.Proxy { /** @@ -42817,7 +40359,7 @@ declare namespace Titanium { /** * Calls a method taking a single `boolean` argument on a view in the remote view * hierarchy. See Android's documentation for - * [setBoolean](http://developer.android.com/reference/android/widget/RemoteViews.html#setBoolean(int, java.lang.String, boolean)). + * [setBoolean](https://developer.android.com/reference/android/widget/RemoteViews.html#setBoolean(int, java.lang.String, boolean)). */ setBoolean(viewId: number, methodName: string, value: boolean): void; @@ -42922,6 +40464,16 @@ declare namespace Titanium { */ readonly serviceInstanceId: number; + /** + * Puts the service into the "background" state and removes its foreground notification. + */ + foregroundCancel(): void; + + /** + * Puts the service into the "foreground" state and displays a notification. + */ + foregroundNotify(id: number, notification: Titanium.Android.Notification): void; + /** * Starts the Service. */ @@ -43651,89 +41203,157 @@ declare namespace Titanium { /** * Animation resources. See - * [R.anim](http://developer.android.com/reference/android/R.anim.html) + * [R.anim](https://developer.android.com/reference/android/R.anim.html) * in the Android Developer Reference. */ const anim: any; /** - * Array resources. See [R.array](http://developer.android.com/reference/android/R.array.html) + * Animator resources. See + * [R.animator](https://developer.android.com/reference/android/R.animator.html) + * in the Android Developer Reference. + */ + const animator: any; + + /** + * Array resources. See [R.array](https://developer.android.com/reference/android/R.array.html) * in the Android Developer Reference. */ const array: any; /** * Attribute resources. See - * [R.attr](http://developer.android.com/reference/android/R.attr.html) + * [R.attr](https://developer.android.com/reference/android/R.attr.html) * in the Android Developer Reference. */ const attr: any; + /** + * Boolean resources. See + * [R.bool](https://developer.android.com/reference/android/R.bool.html) + * in the Android Developer Reference. + */ + const bool: any; + /** * Color resources. See - * [R.color](http://developer.android.com/reference/android/R.color.html) + * [R.color](https://developer.android.com/reference/android/R.color.html) * in the Android Developer Reference. */ const color: any; /** * Dimension resources. See - * [http://developer.android.com/reference/android/R.dimen.html](http://developer.android.com/reference/android/R.dimen.html) + * [https://developer.android.com/reference/android/R.dimen.html](https://developer.android.com/reference/android/R.dimen.html) * in the Android Developer Reference. */ const dimen: any; /** * Drawable resources. See - * [R.drawable](http://developer.android.com/reference/android/R.drawable.html) + * [R.drawable](https://developer.android.com/reference/android/R.drawable.html) * in the Android Developer Reference. - * Accessing drawables using Ti.Android.R.drawable is deprecated and not a recommended practice since the system provided - * drawables can be removed across Android versions. Prefer to copy the images to application res folder. */ const drawable: any; + /** + * Fraction resources. See + * [R.fraction](https://developer.android.com/reference/android/R.fraction.html) + * in the Android Developer Reference. + */ + const fraction: any; + /** * ID resources. See - * [R.id](http://developer.android.com/reference/android/R.id.html) + * [R.id](https://developer.android.com/reference/android/R.id.html) * in the Android Developer Reference. */ const id: any; /** * Integer resources. See - * [R.integer](http://developer.android.com/reference/android/R.integer.html) + * [R.integer](https://developer.android.com/reference/android/R.integer.html) * in the Android Developer Reference. */ const integer: any; + /** + * Interpolator resources. See + * [R.fraction](https://developer.android.com/reference/android/R.interpolator.html) + * in the Android Developer Reference. + */ + const interpolator: any; + /** * Layout resources. See - * [R.layout](http://developer.android.com/reference/android/R.layout.html) + * [R.layout](https://developer.android.com/reference/android/R.layout.html) * in the Android Developer Reference. */ const layout: any; + /** + * Menu resources. See + * [R.menu](https://developer.android.com/reference/android/R.menu.html) + * in the Android Developer Reference. + */ + const menu: any; + + /** + * Mipmap resources. See + * [R.mipmap](https://developer.android.com/reference/android/R.mipmap.html) + * in the Android Developer Reference. + */ + const mipmap: any; + + /** + * Plurals resources. See + * [R.plurals](https://developer.android.com/reference/android/R.plurals.html) + * in the Android Developer Reference. + */ + const plurals: any; + + /** + * Raw resources. See + * [R.raw](https://developer.android.com/reference/android/R.raw.html) + * in the Android Developer Reference. + */ + const raw: any; + /** * String resources. See - * [R.string](http://developer.android.com/reference/android/R.string.html) + * [R.string](https://developer.android.com/reference/android/R.string.html) * in the Android Developer Reference. */ const string: any; /** * Style resources. See - * [R.style](http://developer.android.com/reference/android/R.style.html) + * [R.style](https://developer.android.com/reference/android/R.style.html) * in the Android Developer Reference. */ const style: any; /** * Styleable reosurces. See - * [R.styleable](http://developer.android.com/reference/android/R.styleable.html) + * [R.styleable](https://developer.android.com/reference/android/R.styleable.html) * in the Android Developer Reference. */ const styleable: any; + /** + * Transition resources. See + * [R.transition](https://developer.android.com/reference/android/R.transition.html) + * in the Android Developer Reference. + */ + const transition: any; + + /** + * XML resources. See + * [R.xml](https://developer.android.com/reference/android/R.xml.html) + * in the Android Developer Reference. + */ + const xml: any; + /** * Adds the specified callback as an event listener for the named event. */ @@ -44425,7 +42045,25 @@ declare namespace Titanium { const USER_NOTIFICATION_TYPE_ALERT: number; /** - * The action will execute in background. Use with the + * The ability to play sounds for critical alerts. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_CRITICAL_ALERT: number; + + /** + * The ability to post non-interrupting notifications provisionally to the Notification Center. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_PROVISIONAL: number; + + /** + * An option indicating the system should display a button for in-app notification settings. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_PROVIDES_APP_NOTIFICATION_SETTINGS: number; + + /** + * The action will execute in background. Use with the * [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property. */ const USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND: number; @@ -44446,6 +42084,82 @@ declare namespace Titanium { */ const USER_NOTIFICATION_BEHAVIOR_TEXTINPUT: number; + /** + * The user has not yet made a choice regarding whether the application may post + * user notifications. + */ + const USER_NOTIFICATION_AUTHORIZATION_STATUS_NOT_DETERMINED: number; + + /** + * The application is authorized to post user notifications. + */ + const USER_NOTIFICATION_AUTHORIZATION_STATUS_AUTHORIZED: number; + + /** + * The application is not authorized to post user notifications. + */ + const USER_NOTIFICATION_AUTHORIZATION_STATUS_DENIED: number; + + /** + * The application is provisionally authorized to post non-interruptive user notifications. + */ + const USER_NOTIFICATION_AUTHORIZATION_STATUS_PROVISIONAL: number; + + /** + * The application does not support this notification type. + */ + const USER_NOTIFICATION_SETTING_NOT_SUPPORTED: number; + + /** + * The notification setting is turned on. + */ + const USER_NOTIFICATION_SETTING_ENABLED: number; + + /** + * The notification setting is turned off. + */ + const USER_NOTIFICATION_SETTING_DISABLED: number; + + /** + * No banner or alert dialog is presented when the notification is received. + */ + const USER_NOTIFICATION_ALERT_STYLE_NONE: number; + + /** + * A alert dialog is presented when the notification is received. + */ + const USER_NOTIFICATION_ALERT_STYLE_ALERT: number; + + /** + * A banner is presented when the notification is received. + */ + const USER_NOTIFICATION_ALERT_STYLE_BANNER: number; + + /** + * No options. + */ + const USER_NOTIFICATION_CATEGORY_OPTION_NONE: number; + + /** + * Send dismiss actions to the UNUserNotificationCenter object's delegate for handling. + */ + const USER_NOTIFICATION_CATEGORY_OPTION_CUSTOM_DISMISS_ACTION: number; + + /** + * Allow CarPlay to display notifications of this type. + */ + const USER_NOTIFICATION_CATEGORY_OPTION_ALLOW_IN_CARPLAY: number; + + /** + * Show the notification's title, even if the user has disabled notification previews for the app. + */ + const USER_NOTIFICATION_CATEGORY_OPTION_HIDEEN_PREVIEWS_SHOW_TITLE: number; + + /** + * Show the notification's subtitle, even if the user has disabled notification previews for the app. + */ + const USER_NOTIFICATION_CATEGORY_OPTION_HIDEEN_PREVIEWS_SHOW_SUBTITLE: number; + /** * Uniform type identifier for all text types. */ @@ -44613,14 +42327,12 @@ declare namespace Titanium { const UTTYPE_APPLE_PROTECTED_MPEG4_AUDIO: string; /** - * Notification types and user notification categories the application is registered to use - * (available on iOS 8 and later). + * Notification types and user notification categories the application is registered to use. */ const currentUserNotificationSettings: UserNotificationSettings; /** * Provides an Array of the NSUserActivityTypes keys defined within your Titanium project. - * (available on iOS 8 and later). */ const supportedUserActivityTypes: string[]; @@ -44675,8 +42387,7 @@ declare namespace Titanium { function registerBackgroundService(params: any): Titanium.App.iOS.BackgroundService; /** - * Registers the application to use the requested notification types and categories - * (for devices running iOS 8 or later). + * Registers the application to use the requested notification types and categories. */ function registerUserNotificationSettings(params: UserNotificationSettings): void; @@ -46729,13 +44440,112 @@ declare namespace Titanium { */ actionsForMinimalContext: Titanium.App.iOS.UserNotificationAction[]; + /** + * A format string for the summary description used when the system groups the category's notifications. + */ + categorySummaryFormat: string; + /** * Identifier for this category. */ identifier: string; + /** + * The intents related to notifications of this category. + */ + intentIdentifiers: string[]; + + /** + * The placeholder text to display when notification previews are disabled for the app. + */ + hiddenPreviewsBodyPlaceholder: string; + + /** + * Options for how to handle notifications of this type. + */ + options: number[]; + } + + /** + * The top-level App iOS Notification Center module. It is used to control scheduled notifications + * and receive details about the system-wide notification settings. + */ + namespace UserNotificationCenter { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Fetches the pending notifications asynchronously. + */ + function getPendingNotifications(callback: (param0: UserNotificationCallbackResponse) => any): void; + + /** + * Fetches the delivered notifications asynchronously. + */ + function getDeliveredNotifications(callback: (param0: UserNotificationCallbackResponse) => any): void; + + /** + * Removes the specified pending notifications to prevent them from being triggered. + * If no notifications are specified, all pending notifications will be removed. + */ + function removePendingNotifications(notifications: ReadonlyArray): void; + + /** + * Removes the specified delivered notifications from the notification-center. + * If no notifications are specified, all delivered notifications will be removed. + */ + function removeDeliveredNotifications(): void; + + /** + * Notification types and user notification categories the application is registered to use. + */ + function requestUserNotificationSettings(callback: (param0: GetUserNotificationSettings) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } } } @@ -47439,7 +45249,7 @@ declare namespace Titanium { readonly hidden: boolean; /** - * Identifier of this calendar. Available only in iOS 5.0 and above. + * Identifier of this calendar. */ readonly id: string; @@ -47631,12 +45441,7 @@ declare namespace Titanium { title: string; /** - * Recurrence rule associated with the event. (Available in iOS 4.0 through iOS 5.1.) - */ - recurrenceRule: Titanium.Calendar.RecurrenceRule; - - /** - * The recurrence rules for the calendar item. (Available in iOS 5.1 and above.) + * The recurrence rules for the calendar item. */ recurrenceRules: Titanium.Calendar.RecurrenceRule[]; @@ -47812,16 +45617,6 @@ declare namespace Titanium { */ setTitle(title: string): void; - /** - * Gets the value of the property. - */ - getRecurrenceRule(): Titanium.Calendar.RecurrenceRule; - - /** - * Sets the value of the property. - */ - setRecurrenceRule(recurrenceRule: Titanium.Calendar.RecurrenceRule): void; - /** * Gets the value of the property. */ @@ -48391,7 +46186,7 @@ declare namespace Titanium { name: string; /** - * Record identifier of the group. Single value. Deprecated for >= iOS9. + * Record identifier of the group. Single value. Deprecated for iOS 9 and later. */ recordId: number; @@ -49299,6 +47094,11 @@ declare namespace Titanium { */ function getFile(...paths: string[]): Titanium.Filesystem.File; + /** + * Returns a `File` object representing the file identified by the path arguments. + */ + function getFile(...paths: string[]): Titanium.Filesystem.File; + /** * Returns a `Blob` object representing the asset catalog image identified by the path arguments. */ @@ -49491,7 +47291,7 @@ declare namespace Titanium { /** * Creates a directory at the path identified by this file object. */ - createDirectory(): boolean; + createDirectory(recursive?: boolean): boolean; /** * Creates a file at the path identified by this file object. @@ -49503,6 +47303,11 @@ declare namespace Titanium { */ createTimestamp(): number; + /** + * Returns the creation Date for the file identified by this file object. + */ + createdAt(): Date; + /** * Deletes the directory identified by this file object. */ @@ -49556,6 +47361,11 @@ declare namespace Titanium { */ modificationTimestamp(): number; + /** + * Returns the last modification Date for the file identified by this file object. + */ + modifiedAt(): Date; + /** * Moves the file identified by this file object to another path. */ @@ -49923,17 +47733,17 @@ declare namespace Titanium { */ let preferredProvider: string; - /** - * Text to display in the permission dialog when requesting location - * services. - */ - let purpose: string; - /** * Determines whether the compass calibration UI is shown if needed. */ let showCalibration: boolean; + /** + * Specifies that an indicator be shown when the app makes use of continuous + * background location updates. + */ + let showBackgroundLocationIndicator: boolean; + /** * Indicates if the location changes should be updated only when a significant change * in location occurs. @@ -49946,12 +47756,12 @@ declare namespace Titanium { let allowsBackgroundLocationUpdates: boolean; /** - * The type of user activity to be associated with the location updates. Available in iOS 6.0 and later. + * The type of user activity to be associated with the location updates. */ let activityType: number; /** - * Indicates whether the location updates may be paused. Available in iOS 6.0 and later. + * Indicates whether the location updates may be paused. */ let pauseLocationUpdateAutomatically: boolean; @@ -50110,16 +47920,6 @@ declare namespace Titanium { */ function setPreferredProvider(preferredProvider: string): void; - /** - * Gets the value of the property. - */ - function getPurpose(): string; - - /** - * Sets the value of the property. - */ - function setPurpose(purpose: string): void; - /** * Gets the value of the property. */ @@ -50130,6 +47930,16 @@ declare namespace Titanium { */ function setShowCalibration(showCalibration: boolean): void; + /** + * Gets the value of the property. + */ + function getShowBackgroundLocationIndicator(): boolean; + + /** + * Sets the value of the property. + */ + function setShowBackgroundLocationIndicator(showBackgroundLocationIndicator: boolean): void; + /** * Gets the value of the property. */ @@ -50649,657 +48459,6 @@ declare namespace Titanium { } - /** - * The top level Map module. The Map module is used for creating in-application native maps. - */ - namespace Map { - /** - * Indicates if the proxy will bubble an event to its parent. - */ - let bubbleParent: boolean; - - /** - * The name of the API that this proxy corresponds to. - */ - const apiName: string; - - /** - * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. - */ - let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; - - /** - * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event - * to indicate that the annotation is not being dragged. - */ - const ANNOTATION_DRAG_STATE_NONE: number; - - /** - * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event - * to indicate that the user started dragging the annotation. - */ - const ANNOTATION_DRAG_STATE_START: number; - - /** - * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event - * to indicate that the user moved the annotation. - */ - const ANNOTATION_DRAG_STATE_DRAG: number; - - /** - * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event - * to indicate that the user canceled the drag action. - */ - const ANNOTATION_DRAG_STATE_CANCEL: number; - - /** - * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event - * to indicate that the user finished moving the annotation. - */ - const ANNOTATION_DRAG_STATE_END: number; - - /** - * Color constant used to set a map annotation to green via the - * property. - */ - const ANNOTATION_GREEN: number; - - /** - * Color constant used to set a map annotation to purple via the - * property. - */ - const ANNOTATION_PURPLE: number; - - /** - * Color constant used to set a map annotation to red via the - * property. - */ - const ANNOTATION_RED: number; - - /** - * Used with [mapType](Titanium.Map.View.mapType) to display a satellite image of the area with road and road name information layered on top. - */ - const HYBRID_TYPE: number; - - /** - * Used with [mapType](Titanium.Map.View.mapType) to display satellite imagery of the area. - */ - const SATELLITE_TYPE: number; - - /** - * Used with [mapType](Titanium.Map.View.mapType) to display a street map that shows the position of all roads and some road names. - */ - const STANDARD_TYPE: number; - - /** - * Adds the specified callback as an event listener for the named event. - */ - function addEventListener(name: string, callback: (param0: any) => any): void; - - /** - * Removes the specified callback as an event listener for the named event. - */ - function removeEventListener(name: string, callback: (param0: any) => any): void; - - /** - * Fires a synthesized event to any registered listeners. - */ - function fireEvent(name: string, event: any): void; - - /** - * Applies the properties to the proxy. - */ - function applyProperties(props: any): void; - - /** - * Creates and returns an instance of . - */ - function createAnnotation(parameters?: any): Titanium.Map.Annotation; - - /** - * Gets the value of the property. - */ - function getBubbleParent(): boolean; - - /** - * Sets the value of the property. - */ - function setBubbleParent(bubbleParent: boolean): void; - - /** - * Gets the value of the property. - */ - function getApiName(): string; - - /** - * Gets the value of the property. - */ - function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; - - /** - * Sets the value of the property. - */ - function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; - - /** - * Sets the value of the property. - */ - function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; - - /** - * Creates and returns an instance of . - */ - function createView(parameters?: any): Titanium.Map.View; - - /** - * Represents a labeled point of interest on the map that the user can click on. - */ - interface Annotation extends Titanium.Proxy { - /** - * Boolean to indicate whether the pin should animate when dropped. - */ - animate: boolean; - - /** - * Defines whether the annotation view is able to display extra information in a callout bubble. - */ - canShowCallout: boolean; - - /** - * Defines a center offset point for the annotation. - */ - centerOffset: Point; - - /** - * Defines a custom view to be used by the annotation. - */ - customView: Titanium.UI.View; - - /** - * Determines whether the pin can be dragged by the user. - */ - draggable: boolean; - - /** - * Image to use for the the pin. - */ - image: string | Titanium.Blob; - - /** - * Latitude of the annotation, in decimal degrees. - */ - latitude: number; - - /** - * Longitude of the annotation, in decimal degrees. - */ - longitude: number; - - /** - * Left button image on the annotation, specified as an image URL or an iOS - * button constant. - */ - leftButton: number | string; - - /** - * Left view that is displayed on the annotation. - */ - leftView: Titanium.UI.View; - - /** - * Image for the pin instead of the default image. - */ - pinImage: string; - - /** - * Pin color. Specify one of: , - * or . - */ - pincolor: number; - - /** - * Right button image on the annotation, specified as an image URL or an iOS - * button constant. - */ - rightButton: number | string; - - /** - * Right view that is displayed on the annotation. - */ - rightView: Titanium.UI.View; - - /** - * Secondary title of the annotation view. - */ - subtitle: string; - - /** - * Key in the locale file to use for the subtitle property. - */ - subtitleid: string; - - /** - * Primary title of the annotation view. - */ - title: string; - - /** - * Key in the locale file to use for the title property. - */ - titleid: string; - - /** - * Gets the value of the property. - */ - getAnimate(): boolean; - - /** - * Sets the value of the property. - */ - setAnimate(animate: boolean): void; - - /** - * Gets the value of the property. - */ - getCanShowCallout(): boolean; - - /** - * Sets the value of the property. - */ - setCanShowCallout(canShowCallout: boolean): void; - - /** - * Gets the value of the property. - */ - getCenterOffset(): Point; - - /** - * Sets the value of the property. - */ - setCenterOffset(centerOffset: Point): void; - - /** - * Gets the value of the property. - */ - getCustomView(): Titanium.UI.View; - - /** - * Sets the value of the property. - */ - setCustomView(customView: any): void; - - /** - * Gets the value of the property. - */ - getDraggable(): boolean; - - /** - * Sets the value of the property. - */ - setDraggable(draggable: boolean): void; - - /** - * Gets the value of the property. - */ - getImage(): string | Titanium.Blob; - - /** - * Sets the value of the property. - */ - setImage(image: string): void; - - /** - * Sets the value of the property. - */ - setImage(image: Titanium.Blob): void; - - /** - * Gets the value of the property. - */ - getLatitude(): number; - - /** - * Sets the value of the property. - */ - setLatitude(latitude: number): void; - - /** - * Gets the value of the property. - */ - getLongitude(): number; - - /** - * Sets the value of the property. - */ - setLongitude(longitude: number): void; - - /** - * Gets the value of the property. - */ - getLeftButton(): number | string; - - /** - * Sets the value of the property. - */ - setLeftButton(leftButton: number): void; - - /** - * Sets the value of the property. - */ - setLeftButton(leftButton: string): void; - - /** - * Gets the value of the property. - */ - getLeftView(): Titanium.UI.View; - - /** - * Sets the value of the property. - */ - setLeftView(leftView: any): void; - - /** - * Gets the value of the property. - */ - getPinImage(): string; - - /** - * Sets the value of the property. - */ - setPinImage(pinImage: string): void; - - /** - * Gets the value of the property. - */ - getPincolor(): number; - - /** - * Sets the value of the property. - */ - setPincolor(pincolor: number): void; - - /** - * Gets the value of the property. - */ - getRightButton(): number | string; - - /** - * Sets the value of the property. - */ - setRightButton(rightButton: number): void; - - /** - * Sets the value of the property. - */ - setRightButton(rightButton: string): void; - - /** - * Gets the value of the property. - */ - getRightView(): Titanium.UI.View; - - /** - * Sets the value of the property. - */ - setRightView(rightView: any): void; - - /** - * Gets the value of the property. - */ - getSubtitle(): string; - - /** - * Sets the value of the property. - */ - setSubtitle(subtitle: string): void; - - /** - * Gets the value of the property. - */ - getSubtitleid(): string; - - /** - * Sets the value of the property. - */ - setSubtitleid(subtitleid: string): void; - - /** - * Gets the value of the property. - */ - getTitle(): string; - - /** - * Sets the value of the property. - */ - setTitle(title: string): void; - - /** - * Gets the value of the property. - */ - getTitleid(): string; - - /** - * Sets the value of the property. - */ - setTitleid(titleid: string): void; - - } - - /** - * Map view is used for embedding native mapping capabilities as a view in your application. - */ - interface View extends Titanium.UI.View { - /** - * An array of annotations to add to the map. - */ - annotations: Titanium.Map.Annotation[]; - - /** - * Hide the annotation when clicking in the map view outside of the annotation. - */ - hideAnnotationWhenTouchMap: boolean; - - /** - * Map type, either: , or . - */ - mapType: number; - - /** - * A dictionary specifying the location and zoom level of the map. - * On the iOS platform, this property can only be set after the map view is loaded. - * To ensure this property is set when the application starts, wait for the - * [complete][Titanium.UI.Map-event-complete] event. - */ - region: MapRegionType; - - /** - * Boolean indicating if the map region should be modified - * to fit the map view's aspect ratio. - */ - regionFit: boolean; - - /** - * Boolean indicating if the user's current device location should be shown on the - * map. - */ - userLocation: boolean; - - /** - * The amount of north-to-south distance displayed on the map, measured in decimal degrees. - */ - readonly latitudeDelta: number; - - /** - * The amount of east-to-west distance displayed on the map, measured in decimal degrees. - */ - readonly longitudeDelta: number; - - /** - * Adds a new annotation to the map. - */ - addAnnotation(annotation: any): void; - - /** - * Adds one or more new annotations to the map. - */ - addAnnotations(annotations: any): void; - - /** - * Adds a route to the map. - */ - addRoute(route: MapRouteType): void; - - /** - * Deselects the specified annotation, so the main annotation is hidden and only - * a pin image is shown. - */ - deselectAnnotation(annotation: string): void; - - /** - * Deselects the specified annotation, so the main annotation is hidden and only - * a pin image is shown. - */ - deselectAnnotation(annotation: Titanium.Map.Annotation): void; - - /** - * Removes all annotations from the map. - */ - removeAllAnnotations(): void; - - /** - * Removes an existing annotation from the map. - */ - removeAnnotation(annotation: string): void; - - /** - * Removes an existing annotation from the map. - */ - removeAnnotation(annotation: Titanium.Map.Annotation): void; - - /** - * Removes one or more existing annotations from the map. - */ - removeAnnotations(annotations: ReadonlyArray): void; - - /** - * Removes one or more existing annotations from the map. - */ - removeAnnotations(annotations: ReadonlyArray): void; - - /** - * Remove a previously added route. - */ - removeRoute(route: MapRouteType): void; - - /** - * Selects the annoation, showing the full annotation. - */ - selectAnnotation(annotation: string): void; - - /** - * Selects the annoation, showing the full annotation. - */ - selectAnnotation(annotation: Titanium.Map.Annotation): void; - - /** - * Sets the map location and zoom level. - */ - setLocation(location: MapLocationType): void; - - /** - * Sets the type of map (satellite, hybrid, or standard). - */ - setMapType(mapType: number): void; - - /** - * Zooms in or out of the map. - */ - zoom(level: number): void; - - /** - * Gets the value of the property. - */ - getAnimate(): boolean; - - /** - * Sets the value of the property. - */ - setAnimate(animate: boolean): void; - - /** - * Gets the value of the property. - */ - getAnnotations(): Titanium.Map.Annotation[]; - - /** - * Sets the value of the property. - */ - setAnnotations(annotations: ReadonlyArray): void; - - /** - * Gets the value of the property. - */ - getHideAnnotationWhenTouchMap(): boolean; - - /** - * Sets the value of the property. - */ - setHideAnnotationWhenTouchMap(hideAnnotationWhenTouchMap: boolean): void; - - /** - * Gets the value of the property. - */ - getMapType(): number; - - /** - * Sets the value of the property. - */ - setMapType(mapType: number): void; - - /** - * Gets the value of the property. - */ - getRegion(): MapRegionType; - - /** - * Sets the value of the property. - */ - setRegion(region: MapRegionType): void; - - /** - * Gets the value of the property. - */ - getRegionFit(): boolean; - - /** - * Sets the value of the property. - */ - setRegionFit(regionFit: boolean): void; - - /** - * Gets the value of the property. - */ - getUserLocation(): boolean; - - /** - * Sets the value of the property. - */ - setUserLocation(userLocation: boolean): void; - - /** - * Gets the value of the property. - */ - getLatitudeDelta(): number; - - /** - * Gets the value of the property. - */ - getLongitudeDelta(): number; - - } - - } - /** * The top-level Media module. */ @@ -51370,7 +48529,7 @@ declare namespace Titanium { const AUDIO_FORMAT_AAC: number; /** - * Audio format 8-bit aLaw encoding. + * Audio format 8-bit [aLaw encoding](https://en.wikipedia.org/wiki/A-law_algorithm). */ const AUDIO_FORMAT_ALAW: number; @@ -51380,7 +48539,7 @@ declare namespace Titanium { const AUDIO_FORMAT_APPLE_LOSSLESS: number; /** - * Audio format iLBC encoding. + * Audio format [iLBC encoding](https://en.wikipedia.org/wiki/Internet_Low_Bitrate_Codec). */ const AUDIO_FORMAT_ILBC: number; @@ -51390,12 +48549,12 @@ declare namespace Titanium { const AUDIO_FORMAT_IMA4: number; /** - * Audio format 16-bit, linear PCM encoding. + * Audio format 16-bit, [linear PCM encoding](https://en.wikipedia.org/wiki/Pulse-code_modulation). */ const AUDIO_FORMAT_LINEAR_PCM: number; /** - * Audio format 8-bit muLaw encoding. + * Audio format 8-bit [muLaw encoding](https://en.wikipedia.org/wiki/M-law_algorithm). */ const AUDIO_FORMAT_ULAW: number; @@ -51579,6 +48738,51 @@ declare namespace Titanium { */ const AUDIO_UNKNOWN: number; + /** + * Audio data is being buffered from the network. + */ + const AUDIO_STATE_BUFFERING: number; + + /** + * Audio playback is being initialized. + */ + const AUDIO_STATE_INITIALIZED: number; + + /** + * Playback is paused. + */ + const AUDIO_STATE_PAUSED: number; + + /** + * Audio playback is active. + */ + const AUDIO_STATE_PLAYING: number; + + /** + * Audio playback is starting. + */ + const AUDIO_STATE_STARTING: number; + + /** + * Audio playback is stopped. + */ + const AUDIO_STATE_STOPPED: number; + + /** + * Audio playback is stopping. + */ + const AUDIO_STATE_STOPPING: number; + + /** + * Player is waiting for audio data from the network. + */ + const AUDIO_STATE_WAITING_FOR_DATA: number; + + /** + * Player is waiting for audio data to fill the queue. + */ + const AUDIO_STATE_WAITING_FOR_QUEUE: number; + /** * Constant specifying to have the device determine to use the flash or not. */ @@ -52200,7 +49404,7 @@ declare namespace Titanium { function showCamera(options: CameraOptionsType): void; /** - * Returns `true` if the app has camera access. + * Returns `true` if the app has music library access. */ function hasMusicLibraryPermissions(): boolean; @@ -52615,6 +49819,28 @@ declare namespace Titanium { */ readonly idle: boolean; + /** + * Indicates whether or not audio output of the player is muted. + */ + muted: boolean; + + /** + * Indicates whether the player is currently playing video in "external playback" mode. + */ + readonly externalPlaybackActive: boolean; + + /** + * Indicates whether the player allows switching to "external playback" mode. + */ + allowsExternalPlayback: boolean; + + /** + * Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a + * desire to play at the natural rate of the current item. In addition, 2.0 + * would mean that the audio plays twice as fast. + */ + rate: number; + /** * Boolean indicating if audio playback is paused. */ @@ -52651,7 +49877,7 @@ declare namespace Titanium { readonly waiting: boolean; /** - * Size of the buffer used for streaming, in bytes. + * Size of the buffer used for streaming, in milliseconds. */ bufferSize: number; @@ -52695,6 +49921,12 @@ declare namespace Titanium { */ setPaused(paused: boolean): void; + /** + * Moves the playback cursor and invokes the specified block when the seek + * operation has either been completed or been interrupted. + */ + seekToTime(time: number): void; + /** * Stops buffering audio data and releases audio resources. */ @@ -52710,6 +49942,11 @@ declare namespace Titanium { */ start(): void; + /** + * Restarts (stops and stars) audio playback. + */ + restart(): void; + /** * Converts a [state](Titanium.Media.AudioPlayer.state) value into a text description * suitable for display. @@ -52771,6 +50008,41 @@ declare namespace Titanium { */ getIdle(): boolean; + /** + * Gets the value of the property. + */ + getMuted(): boolean; + + /** + * Sets the value of the property. + */ + setMuted(muted: boolean): void; + + /** + * Gets the value of the property. + */ + getExternalPlaybackActive(): boolean; + + /** + * Gets the value of the property. + */ + getAllowsExternalPlayback(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsExternalPlayback(allowsExternalPlayback: boolean): void; + + /** + * Gets the value of the property. + */ + getRate(): number; + + /** + * Sets the value of the property. + */ + setRate(rate: number): void; + /** * Gets the value of the property. */ @@ -53328,11 +50600,6 @@ declare namespace Titanium { */ shuffleMode: number; - /** - * Volume level for the music player from 0.0 (muted) to 1.0 (loudest). - */ - volume: number; - /** * Pauses playback of the current media item. */ @@ -53435,16 +50702,6 @@ declare namespace Titanium { */ setShuffleMode(shuffleMode: number): void; - /** - * Gets the value of the property. - */ - getVolume(): number; - - /** - * Sets the value of the property. - */ - setVolume(volume: number): void; - } /** @@ -53763,11 +51020,6 @@ declare namespace Titanium { */ mediaTypes: number; - /** - * Style of the media playback controls. - */ - movieControlMode: number; - /** * Returns the status of the movie player. */ @@ -53815,7 +51067,7 @@ declare namespace Titanium { scalingMode: number; /** - * Whether or not the receiver shows playback controls. Default is YES. + * Whether or not the receiver shows playback controls. Default is true. */ showsControls: boolean; @@ -53829,12 +51081,6 @@ declare namespace Titanium { */ url: string | string[]; - /** - * Indicates if the movie player should inherit the application's audio session - * instead of creating a new session. - */ - useApplicationAudioSession: boolean; - /** * Volume of the audio portion of the video. */ @@ -54005,16 +51251,6 @@ declare namespace Titanium { */ setMediaTypes(mediaTypes: number): void; - /** - * Gets the value of the property. - */ - getMovieControlMode(): number; - - /** - * Sets the value of the property. - */ - setMovieControlMode(movieControlMode: number): void; - /** * Gets the value of the property. */ @@ -54120,16 +51356,6 @@ declare namespace Titanium { */ setUrl(url: ReadonlyArray): void; - /** - * Gets the value of the property. - */ - getUseApplicationAudioSession(): boolean; - - /** - * Sets the value of the property. - */ - setUseApplicationAudioSession(useApplicationAudioSession: boolean): void; - /** * Gets the value of the property. */ @@ -54377,7 +51603,7 @@ declare namespace Titanium { const networkTypeName: string; /** - * Boolean value indicating if the device can reach the Internet. + * Boolean value indicating if the device is connected to the network. */ const online: boolean; @@ -54503,11 +51729,6 @@ declare namespace Titanium { */ function registerForPushNotifications(config: PushNotificationConfig): void; - /** - * Legacy method to remove a connectivity listener. - */ - function removeConnectivityListener(callback: (param0: any) => any): void; - /** * Unregisters the application for push notifications. */ @@ -55943,7 +53164,7 @@ declare namespace Titanium { /** * Opens this URL using the system's default application for its protocol. */ - function openURL(url: string): boolean; + function openURL(url: string, options: any, callback: () => any): boolean; /** * Returns whether the system settings are configured to show times in 24-hour format. @@ -57362,7 +54583,7 @@ declare namespace Titanium { /** * An interface extending with a set of attributes and methods for accessing character data in the DOM. - * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-FF21A306) on Android and iOS. For reasons of compatibility with the javascript engine, text is represented by UTF-8 instead of UTF-16 on Android and iOS. + * Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-FF21A306) on Android and iOS. For reasons of compatibility with the javascript engine, text is represented by UTF-8 instead of UTF-16 on Android and iOS. */ interface CharacterData extends Titanium.Proxy { /** @@ -57882,7 +55103,7 @@ declare namespace Titanium { } /** - * The interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490) on Android and iOS. + * The interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490) on Android and iOS. */ interface DOMImplementation extends Titanium.Proxy { /** @@ -58696,7 +55917,7 @@ declare namespace Titanium { /** * Represents an element in a DOM document, a defined by a start-tag and end-tag (or an empty tag). Elements may have [attributes](Titanium.XML.Attr) associated with them. - * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614) on Android and iOS with some non-standard extensions. + * Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614) on Android and iOS with some non-standard extensions. */ interface Element extends Titanium.Proxy { /** @@ -58992,7 +56213,7 @@ declare namespace Titanium { /** * This interface represents an entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration. The nodeName attribute that is inherited from Node contains the name of the entity. An Entity node does not have any parent. - * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-527DCFF2) on Android and iOS. + * Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-527DCFF2) on Android and iOS. */ interface Entity extends Titanium.Proxy { /** @@ -59443,7 +56664,7 @@ declare namespace Titanium { /** * A key-value paired map that maps String objects to objects. - * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922) on Android and iOS. + * Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922) on Android and iOS. */ interface NamedNodeMap extends Titanium.Proxy { /** @@ -59704,7 +56925,7 @@ declare namespace Titanium { } /** - * A list of objects. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177) on Android and iOS. + * A list of objects. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177) on Android and iOS. */ interface NodeList extends Titanium.Proxy { /** @@ -59725,7 +56946,7 @@ declare namespace Titanium { } /** - * Represents a notation declared in the DTD. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-5431D1B9) on Android and iOS. + * Represents a notation declared in the DTD. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-5431D1B9) on Android and iOS. */ interface Notation extends Titanium.Proxy { /** @@ -59751,7 +56972,7 @@ declare namespace Titanium { } /** - * A way to keep processor-specific information in the text of the document. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1004215813) on Android and iOS. + * A way to keep processor-specific information in the text of the document. Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1004215813) on Android and iOS. */ interface ProcessingInstruction extends Titanium.Proxy { /** @@ -59782,7 +57003,7 @@ declare namespace Titanium { } /** - * Represents the textual content of an or Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1312295772) on Android and iOS. + * Represents the textual content of an or Implements the [DOM Level 2 API](https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1312295772) on Android and iOS. */ interface Text extends Titanium.Proxy { /** @@ -61132,7 +58353,7 @@ interface CloudPushSchedulesResponse { message?: string; /** - * Array of [schedules push notifications](http://docs.appcelerator.com/arrowdb/latest/#!/api/PushSchedules), if any exist. + * Array of [schedules push notifications](https://docs.appcelerator.com/arrowdb/latest/#!/api/PushSchedules), if any exist. */ push_schedules?: any[]; @@ -61542,13 +58763,175 @@ interface launchOptions { } +/** + * Response when receiving pending or local notifications + * in and + * . + */ +interface UserNotificationCallbackResponse { + /** + * An array of identifiers used to create notifications. + */ + notifications?: UserNotificationDictionary[]; + +} + +/** + * Dictionary of notification data used in the array of `notifications` + * when receiving pending or local notifications in + * and + * . + */ +interface UserNotificationDictionary { + /** + * Title of the notification. + */ + alertTitle?: string; + + /** + * Subtitle of the notification. + */ + alertSubtitle?: string; + + /** + * Alert button text ('Open', by default) or home text ('Press Home to unlock', by default) + * type: String + */ + alertAction?: string; + + /** + * Alert message. + */ + alertBody?: string; + + /** + * Image displayed instead of `Default.png` when launching the application. + */ + alertLaunchImage?: string; + + /** + * Application badge value. + */ + badge?: number; + + /** + * Date and time when the notification was configured to fire. + */ + date?: Date; + + /** + * Path to the sound file configured to play when the notification was fired. + */ + sound?: string; + + /** + * Timezone of the date when the notification was configured to fire. + */ + timezone?: string; + + /** + * Custom data object. + */ + userInfo?: any; + + /** + * Category identifier of the notification. + */ + category?: string; + + /** + * The notification identifier. + */ + identifier: string; + + /** + * Region of the notification. + */ + region?: any; + +} + +/** + * Dictionary object of parameters used to register the application with local notifications using + * the method. + */ +interface GetUserNotificationSettings { + /** + * Notification types to use. + */ + types?: number[]; + + /** + * Set of categories of user notification actions required by the applicaiton to use. + */ + categories?: Titanium.App.iOS.UserNotificationCategory[]; + + /** + * The current authorization status for using notifications. + */ + authorizationStatus?: number; + + /** + * The current sound settings. + */ + soundSetting?: number; + + /** + * The current badge settings. + */ + badgeSetting?: number; + + /** + * The current alert settings. + */ + alertSetting?: number; + + /** + * The current notication-center settings. + */ + notificationCenterSetting?: number; + + /** + * The current lock-screen settings. + */ + lockScreenSetting?: number; + + /** + * The current CarPlay settings. + */ + carPlaySetting?: number; + + /** + * The authorization status to play sounds for critical alerts. + * Available in Titanium SDK 7.4.0 and later. + */ + criticalAlertSetting?: number; + + /** + * A Boolean value indicating the system displays a button for in-app notification settings. + * Available in Titanium SDK 7.4.0 and later. + */ + providesAppNotificationSettings?: number; + + /** + * The current alert style used to display notifications. + */ + alertStyle?: number; + +} + /** * Dictionary object of parameters used to create a notification using * . */ interface NotificationParams { /** - * Alert button text ('Open', by default) or slider text ('slide to unlock...', by default) + * The notification identifier. + */ + identifier: string; + + /** + * Alert button text ('Open', by default) or home text ('Press Home to unlock', by default) * to display. */ alertAction?: string; @@ -61559,23 +58942,32 @@ interface NotificationParams { alertBody?: string; /** - * Alert title to display. Available since Titanium SDK 5.4.0. + * Alert title to display. */ alertTitle?: string; + /** + * Alert subtitle to display. + */ + alertSubtitle?: string; + /** * Image to display instead of `Default.png` when launching the application. */ alertLaunchImage?: string; + /** + * Notification attachments to display. + */ + attachments?: UserNotificationAttachment[]; + /** * Application badge value. */ badge?: number; /** - * String identifier of category of actions to be displayed for an interactive - * notification (only for iOS 8 and above). + * String identifier of category of actions to be displayed for an interactive notification. */ category?: string; @@ -61609,10 +59001,43 @@ interface NotificationParams { * - `latitude`: Latitude of the location center, in decimal degrees (required). * - `longitude`: Longitude of the location center, in decimal degrees (required). * - `triggersOnce`: Whether or not the notification will only fire once (optional, default: true). - * - `identifier`: Identifier of the region (optional). */ region?: any; + /** + * The string the notification adds to the category's summary format string. + */ + summaryArgument?: string; + + /** + * The number of items the notification adds to the category's summary format string. + */ + summaryArgumentCount?: string; + +} + +/** + * Provide at least the property `identifier` and `url` property to identify a local + * image, sound or video. If your media is invalid, the API will throw an error log and + * skip the invalid attachment. + */ +interface UserNotificationAttachment { + /** + * The identifier of this attachment. + */ + identifier: string; + + /** + * The URL to the attachment's data. If you have obtained this attachment from + * the notification-center then the URL will be security-scoped. + */ + url: string; + + /** + * An additional dictionary of options to provide. + */ + options?: any; + } /** @@ -61636,7 +59061,7 @@ interface LaunchOptionsType { * Dictionary object of parameters used to register the application with local notifications using * the method. * To retrieve the current notification settings, use the - * property. + * method. */ interface UserNotificationSettings { /** @@ -62076,7 +59501,7 @@ interface LocationCoordinates { timestamp?: number; /** - * The floor of the building on which the user is located. Available in iOS 8.0 and later. + * The floor of the building on which the user is located. */ floor?: LocationCoordinatesFloor; @@ -62084,7 +59509,6 @@ interface LocationCoordinates { /** * Simple object holding floor of the building on which the user is located. - * In places where floor information can be determined. */ interface LocationCoordinatesFloor { /** @@ -62400,111 +59824,6 @@ interface LocationAuthorizationResponse { } -/** - * Simple object representing a map location and zoom level. - */ -interface MapRegionType { - /** - * Longitude value for the center point of the map, in decimal degrees. - */ - longitude?: number; - - /** - * Latitude value for the center point of the map, in decimal degrees. - */ - latitude?: number; - - /** - * The amount of east-to-west distance displayed on the map, measured in decimal degrees. - */ - longitudeDelta?: number; - - /** - * The amount of north-to-south distance displayed on the map, measured in decimal degrees. - */ - latitudeDelta?: number; - -} - -/** - * Simple object used as an argument to [setLocation](Titanium.Map.View.setLocation). - */ -interface MapLocationType { - /** - * Longitude value for the center point of the map, in decimal degrees. - */ - longitude?: number; - - /** - * Latitude value for the center point of the map, in decimal degrees. - */ - latitude?: number; - - /** - * The amount of east-to-west distance displayed on the map, measured in decimal degrees. - */ - longitudeDelta?: number; - - /** - * The amount of north-to-south distance displayed on the map, measured in decimal degrees. - */ - latitudeDelta?: number; - - /** - * Set to `true` to animate the move to the new location. - */ - animate?: boolean; - - /** - * If `true`, the specified region is modified to fit the aspect ratio of the - * map view, while remaining centered on `latitude`,`longitude`. - */ - regionFit?: boolean; - -} - -/** - * Simple object defining a map route. - */ -interface MapRouteType { - /** - * Route name. - */ - name: string; - - /** - * Array of map points making up the route. - */ - points: MapPointType[]; - - /** - * Color to use when drawing the route, as a color name or hex triplet. - */ - color?: string; - - /** - * Line width to use when drawing the route. - */ - width?: number; - -} - -/** - * Simple object representing a point on the map. - */ -interface MapPointType { - /** - * Longitude value of the map point, in decimal degrees. - */ - longitude?: number; - - /** - * Latitude value of the map point, in decimal degrees. - */ - latitude?: number; - -} - /** * Simple object passed to the [scanMediaFiles](Titanium.Media.Android.scanMediaFiles) callback. */ @@ -62522,6 +59841,32 @@ interface MediaScannerResponse { } +/** + * An abstract type to represent a metadata item inside the `metadata` event (iOS only). + */ +interface TiMetadataItemType { + /** + * The key of the metadata item, e.g. "title". + */ + key?: string; + + /** + * The key-path of the metadata item. + */ + keySpace?: string; + + /** + * The value of the metadata item. Can be represented as various types. + */ + value?: string | number | boolean; + + /** + * A dictionary of the additional attributes. + */ + extraAttributes?: any; + +} + /** * Simple object for specifying options to [openMusicLibrary](Titanium.Media.openMusicLibrary). */ @@ -62841,10 +60186,11 @@ interface PhotoGalleryOptionsType { allowEditing?: boolean; /** - * Array of media type constants to allow. If you want to allow live photos with - * on iOS 9.1 and later, you also need to specify + * Array of media type constants to allow. + * Live photos is only supported on the iOS platform, starting with iOS 9.1. If you want + * to allow live photos with , you also need to specify * at least as a fallback. If you do not allow live - * photos, they still can be selected, but will be represented as a normal photo (static). + * photos, they still can be selected, but will be represented as a normal static photo. */ mediaTypes?: string[]; @@ -63176,12 +60522,12 @@ interface SecurityManagerProtocol { connectionDelegateForUrl(url: any): APSConnectionDelegate; /** - * Returns an array of objects implementing the [X509TrustManager](http://developer.android.com/reference/javax/net/ssl/X509TrustManager.html) protocol for the SSL Context. + * Returns an array of objects implementing the [X509TrustManager](https://developer.android.com/reference/javax/net/ssl/X509TrustManager.html) protocol for the SSL Context. */ getTrustManagers(proxy: any): any[]; /** - * Returns an array of objects implementing the [X509KeyManager](http://developer.android.com/reference/javax/net/ssl/X509KeyManager.html) protocol for the SSL Context. + * Returns an array of objects implementing the [X509KeyManager](https://developer.android.com/reference/javax/net/ssl/X509KeyManager.html) protocol for the SSL Context. */ getKeyManagers(proxy: any): any[]; @@ -64371,7 +61717,7 @@ interface windowToolbarParam { barColor?: string; /** - * The tintColor to apply to the tool bar. Applicable on iOS 7 and above. + * The tintColor to apply to the tool bar. */ tintColor?: string; @@ -64635,7 +61981,6 @@ interface BarItemType { /** * Dictionary specifying the transition animation used with the method. - * Only supported on iOS 7 and later. */ interface transitionAnimationParam { /** @@ -64677,38 +62022,6 @@ interface PopoverParams { } -/** - * Dictionary of options for the method. - */ -interface hideStatusBarParams { - /** - * Determines whether to animate the dialog as it is hidden. - */ - animated?: boolean; - - /** - * Style of the animation. - */ - animationStyle?: number; - -} - -/** - * Dictionary of options for the method. - */ -interface showStatusBarParams { - /** - * Determines whether to animate the dialog as it is shown. - */ - animated?: boolean; - - /** - * Style of the animation. - */ - animationStyle?: number; - -} - /** * Reply message received from watch app. */ diff --git a/types/titanium/titanium-tests.ts b/types/titanium/titanium-tests.ts index bc5f4794c2..4d546f1848 100644 --- a/types/titanium/titanium-tests.ts +++ b/types/titanium/titanium-tests.ts @@ -5,7 +5,7 @@ function test_window() { borderRadius: 10 }); - window.setBackgroundColor('blue'); + window.backgroundColor = 'blue'; window.opacity = 0.92; const matrix = Ti.UI.create2DMatrix().scale(1.1, 1); @@ -17,8 +17,8 @@ function test_window() { text: 'Simple label' }); label.textAlign = Ti.UI.TEXT_ALIGNMENT_LEFT; - label.setWidth(Ti.UI.SIZE); - label.setHeight(Ti.UI.SIZE); + label.width = Ti.UI.SIZE; + label.height = Ti.UI.SIZE; window.add(label); window.open(); } @@ -68,7 +68,7 @@ function test_fs() { } function test_network() { - const url = "http://www.appcelerator.com"; + const url = 'https://www.appcelerator.com'; const client = Ti.Network.createHTTPClient({ // function called when the response data is available onload: (e: SuccessResponse) => { @@ -85,36 +85,3 @@ function test_network() { // Send the request. client.send(); } - -function test_map() { - const win = Ti.UI.createWindow(); - const mountainView = Ti.Map.createAnnotation({ - animate: true, - leftButton: '../images/appcelerator_small.png', - myid: 1 - }); - mountainView.setLatitude(37.390749); - mountainView.setLongitude(-122.081651); - mountainView.setTitle('Appcelerator'); - mountainView.setSubtitle('Mountain View, CA'); - mountainView.setPincolor(Ti.Map.ANNOTATION_RED); - - const mapview = Ti.Map.createView({ - mapType: Ti.Map.STANDARD_TYPE, - region: { - latitude: 37.390749, longitude: -122.081651, - latitudeDelta: 0.01, longitudeDelta: 0.01 - }, - animate: true, - }); - mapview.regionFit = true; - mapview.userLocation = true; - mapview.annotations = [mountainView]; - mapview.addEventListener('click', event => { - if (event.clicksource === 'leftButton' || event.clicksource === 'leftPane') { - alert(event.title + ' left button clicked'); - } - }); - win.add(mapview); - win.open(); -} From aa7626908fb31fb4f2385e2ad9f98dca78e3ddf3 Mon Sep 17 00:00:00 2001 From: Gregory Ristow Date: Fri, 10 Aug 2018 08:41:30 -0400 Subject: [PATCH 114/346] fix(rethinkdb): compound index not optional in getAll --- types/rethinkdb/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index 820c1b5f11..87293230a9 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -317,7 +317,7 @@ declare module "rethinkdb" { * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) */ - getAll(compoundKey: string[], compoundKey2: string[], index?: Index): Sequence; // without index defaults to primary key + getAll(compoundKey: string[], compoundKey2: string[], index: Index): Sequence; // without index defaults to primary key /** * Get all documents matching 2 or more compound index keys. * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and From 25b51166162b36e5aa372d635b58606a8ff178ea Mon Sep 17 00:00:00 2001 From: wznuk Date: Fri, 10 Aug 2018 09:44:35 -0500 Subject: [PATCH 115/346] Added the "ImageryClarity" Basemaps The current version of this file is missing the "ImageryClartiy" basemap option, despite the fact the esri-leaflet supports it. --- types/esri-leaflet/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/esri-leaflet/index.d.ts b/types/esri-leaflet/index.d.ts index 3dbd351cb5..df1a9c3752 100644 --- a/types/esri-leaflet/index.d.ts +++ b/types/esri-leaflet/index.d.ts @@ -44,6 +44,7 @@ declare module 'leaflet' { | 'GrayLabels' | 'DarkGrayLabels' | 'ImageryLabels' + | 'ImageryClarity' | 'ImageryTransportation' | 'ShadedReliefLabels' | 'TerrainLabels'; From 1e20dc1407129d5b46eaa98078398c7a2c54ed25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Fri, 10 Aug 2018 16:57:28 +0200 Subject: [PATCH 116/346] [i18n-js] Added toTime --- types/i18n-js/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/i18n-js/index.d.ts b/types/i18n-js/index.d.ts index 4800125087..70a197772d 100644 --- a/types/i18n-js/index.d.ts +++ b/types/i18n-js/index.d.ts @@ -70,6 +70,8 @@ declare namespace I18n { } function toCurrency(num: number, options?: ToCurrencyOptions): string; + function toTime(scope: Scope, value: string | number | Date): string; + interface ToHumanSizeOptions extends ToNumberOptions { format?: string; } From b6bcd18205bce035692d9c4dc202e24c4a39c551 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Fri, 10 Aug 2018 17:21:20 +0200 Subject: [PATCH 117/346] [node] Fix typings for various child_process methods (#28025) * node: add strong typing and a few missed types for methods on child_process * node: child_process method stdio array can take null or undefined values * node child_process: add back argv0 option for spawnSync, probably bad docs --- types/hexo-util/index.d.ts | 6 ++--- types/node/index.d.ts | 47 ++++++++++++++++++++------------------ types/node/node-tests.ts | 1 + 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/types/hexo-util/index.d.ts b/types/hexo-util/index.d.ts index aed429f0ce..5a6be7f5a2 100644 --- a/types/hexo-util/index.d.ts +++ b/types/hexo-util/index.d.ts @@ -7,7 +7,7 @@ /// import { Transform } from "stream"; -import { SpawnOptions } from 'child_process'; +import { SpawnOptions, StdioOptions } from 'child_process'; export class CacheStream extends Transform { destroy(): void; @@ -79,11 +79,11 @@ export interface hexoSpawnDisableEncodingOptions extends SpawnOptions { } export interface hexoSpawnOverrideStdioOptions extends hexoSpawnOptions { - stdio: any[] | string; + stdio: StdioOptions; } export interface hexoSpawnDisableEncodingAndOverrideStdioOptions extends hexoSpawnDisableEncodingOptions { - stdio: any[] | string; + stdio: StdioOptions; } export function spawn(command: string, args: string[], options: hexoSpawnDisableEncodingAndOverrideStdioOptions): Promise; diff --git a/types/node/index.d.ts b/types/node/index.d.ts index ed04749756..cb71b625b9 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2190,11 +2190,13 @@ declare module "child_process" { keepOpen?: boolean; } + export type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | stream.Stream | number | null | undefined)>; + export interface SpawnOptions { - argv0?: string; cwd?: string; - env?: any; - stdio?: any; + env?: NodeJS.ProcessEnv; + argv0?: string; + stdio?: StdioOptions; detached?: boolean; uid?: number; gid?: number; @@ -2207,7 +2209,7 @@ declare module "child_process" { export interface ExecOptions { cwd?: string; - env?: any; + env?: NodeJS.ProcessEnv; shell?: string; timeout?: number; maxBuffer?: number; @@ -2262,7 +2264,7 @@ declare module "child_process" { export interface ExecFileOptions { cwd?: string; - env?: any; + env?: NodeJS.ProcessEnv; timeout?: number; maxBuffer?: number; killSignal?: string; @@ -2329,32 +2331,32 @@ declare module "child_process" { export interface ForkOptions { cwd?: string; - env?: any; + env?: NodeJS.ProcessEnv; execPath?: string; execArgv?: string[]; silent?: boolean; - stdio?: any[]; + stdio?: StdioOptions; + windowsVerbatimArguments?: boolean; uid?: number; gid?: number; - windowsVerbatimArguments?: boolean; } export function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; export interface SpawnSyncOptions { - argv0?: string; + argv0?: string; // Not specified in the docs cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; + input?: string | Buffer | Uint8Array; + stdio?: StdioOptions; + env?: NodeJS.ProcessEnv; uid?: number; gid?: number; timeout?: number; - killSignal?: string; + killSignal?: string | number; maxBuffer?: number; encoding?: string; shell?: boolean | string; - windowsHide?: boolean; windowsVerbatimArguments?: boolean; + windowsHide?: boolean; } export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { encoding: BufferEncoding; @@ -2381,14 +2383,14 @@ declare module "child_process" { export interface ExecSyncOptions { cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; + input?: string | Buffer | Uint8Array; + stdio?: StdioOptions; + env?: NodeJS.ProcessEnv; shell?: string; uid?: number; gid?: number; timeout?: number; - killSignal?: string; + killSignal?: string | number; maxBuffer?: number; encoding?: string; windowsHide?: boolean; @@ -2406,16 +2408,17 @@ declare module "child_process" { export interface ExecFileSyncOptions { cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; + input?: string | Buffer | Uint8Array; + stdio?: StdioOptions; + env?: NodeJS.ProcessEnv; uid?: number; gid?: number; timeout?: number; - killSignal?: string; + killSignal?: string | number; maxBuffer?: number; encoding?: string; windowsHide?: boolean; + shell?: boolean | string; } export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { encoding: BufferEncoding; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 9c38a5672e..654b7f3901 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -2322,6 +2322,7 @@ namespace child_process_tests { childProcess.exec("echo test", { windowsHide: true }); childProcess.spawn("echo", ["test"], { windowsHide: true }); childProcess.spawn("echo", ["test"], { windowsHide: true, argv0: "echo-test" }); + childProcess.spawn("echo", ["test"], { stdio: [0xdeadbeef, undefined, "pipe"] }); childProcess.spawnSync("echo test"); childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); childProcess.spawnSync("echo test", {windowsVerbatimArguments: false, argv0: "echo-test"}); From c3101e546fdb9c8da768a464d8a0eaa013a11d3b Mon Sep 17 00:00:00 2001 From: YangusKhan <9inchsamurai@gmail.com> Date: Fri, 10 Aug 2018 09:26:20 -0600 Subject: [PATCH 118/346] update typings to 0.33. add History class. change RenderNodeProps to accept a Node instead of Block. add methods to Data class. --- types/slate-react/index.d.ts | 2 +- types/slate-react/slate-react-tests.tsx | 23 +++++- types/slate/index.d.ts | 94 +++++++++++++++++-------- types/slate/slate-tests.ts | 68 ++++++++++++------ 4 files changed, 135 insertions(+), 52 deletions(-) diff --git a/types/slate-react/index.d.ts b/types/slate-react/index.d.ts index 0bf5c255a9..c79b945a5b 100644 --- a/types/slate-react/index.d.ts +++ b/types/slate-react/index.d.ts @@ -33,7 +33,7 @@ export interface RenderNodeProps { editor: Editor; isSelected: boolean; key: string; - node: Block; + node: Node; parent: Node; } diff --git a/types/slate-react/slate-react-tests.tsx b/types/slate-react/slate-react-tests.tsx index 074f6caa9b..d8c8ea0073 100644 --- a/types/slate-react/slate-react-tests.tsx +++ b/types/slate-react/slate-react-tests.tsx @@ -1,8 +1,24 @@ -import { Editor, Plugin, EditorProps } from "slate-react"; +import { Editor, Plugin, EditorProps, RenderNodeProps } from "slate-react"; import { Change, Value } from "slate"; import * as React from "react"; class MyPlugin implements Plugin { + renderNode(props: RenderNodeProps) { + const { node } = props; + if (node) { + switch (node.object) { + case "block": + return
; + case "inline": + return Hello world; + case "text": + return

Hello world

; + default: + return undefined; + } + } + } + onChange(change: Change): void { change.blur(); } @@ -23,6 +39,9 @@ class MyEditor extends React.Component { } render() { - return ; + return ; } } diff --git a/types/slate/index.d.ts b/types/slate/index.d.ts index 781257488a..4eaa88a123 100644 --- a/types/slate/index.d.ts +++ b/types/slate/index.d.ts @@ -5,48 +5,54 @@ // Jan Löbel // Brandon Shelton // Kalley Powell +// Francesco Agnoletto // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as Immutable from 'immutable'; -export interface Data { +type StringObject = Record; + +export class Data { [key: string]: any; + static create(options: Data): Data; + static fromJSON(object: StringObject): Data; + static fromJS(object: StringObject): Data; } export interface RulesByNodeType { [key: string]: Rules; } -export interface KindsAndTypes { - kinds?: string[]; +export interface ObjectsAndTypes { + objects?: string[]; types?: string[]; } export type InvalidReason = - | 'child_kind_invalid' + | 'child_object_invalid' | 'child_required' | 'child_type_invalid' | 'child_unknown' - | 'first_child_kind_invalid' + | 'first_child_object_invalid' | 'first_child_type_invalid' - | 'last_child_kind_invalid' + | 'last_child_object_invalid' | 'last_child_type_invalid' | 'node_data_invalid' | 'node_is_void_invalid' | 'node_mark_invalid' | 'node_text_invalid' - | 'parent_kind_invalid' + | 'parent_object_invalid' | 'parent_type_invalid'; export interface Rules { data?: { [key: string]: (v: any) => boolean; }; - first?: KindsAndTypes; + first?: ObjectsAndTypes; isVoid?: boolean; - last?: KindsAndTypes; + last?: ObjectsAndTypes; nodes?: Array<{ - kinds?: string[]; + objects?: string[]; types?: string[]; min?: number; max?: number; @@ -54,9 +60,9 @@ export interface Rules { normalize?: ( change: Change, reason: InvalidReason, - context: { [key: string]: any } + context: StringObject ) => void; - parent?: KindsAndTypes; + parent?: ObjectsAndTypes; text?: RegExp; } @@ -73,17 +79,37 @@ export class Schema extends Immutable.Record({}) { static create(properties: SchemaProperties | Schema): Schema; static fromJSON(object: SchemaProperties): Schema; + static fromJS(object: SchemaProperties): Schema; static isSchema(maybeSchema: any): maybeSchema is Schema; toJSON(): SchemaProperties; } +export interface HistoryJSON { + object?: 'history'; + redos?: Immutable.Stack; + undos?: Immutable.Stack; +} + +export class History extends Immutable.Record({ redos: Immutable.Stack(), undos: Immutable.Stack() }) { + object: 'history'; + + static create(properties: HistoryJSON | History): History; + static createOperationsList(operations: Operation[] | Immutable.List): Immutable.List; + static fromJSON(object: HistoryJSON): History; + static fromJS(object: HistoryJSON): History; + static isHistory(maybeHistory: any): maybeHistory is History; + + save(operation: Operation, options: { merge?: boolean, skip?: boolean }): History; + toJSON(): HistoryJSON; +} + export interface ValueProperties { document?: Document; selection?: Range; history?: History; schema?: Schema; - data?: Data; + data?: StringObject; decorations?: Immutable.List | null; } @@ -92,7 +118,7 @@ export interface ValueJSON { selection?: Range; history?: History; schema?: Schema; - data?: Data; + data?: StringObject; decorations?: Immutable.List | null; object?: 'value'; } @@ -102,7 +128,7 @@ export class Value extends Immutable.Record({}) { selection: Range; history: History; schema: Schema; - data: Data; + data: StringObject; object: 'value'; decorations: Immutable.List | null; @@ -148,6 +174,7 @@ export class Value extends Immutable.Record({}) { static create(properties?: ValueProperties | Value): Value; static fromJSON(properties: ValueJSON): Value; + static fromJS(properties: ValueJSON): Value; static isValue(maybeValue: any): maybeValue is Value; change(): Change; @@ -157,17 +184,17 @@ export class Value extends Immutable.Record({}) { export interface DocumentProperties { nodes?: Immutable.List | Node[]; key?: string; - data?: Immutable.Map | { [key: string]: any }; + data?: Immutable.Map | StringObject; } export interface DocumentJSON { nodes?: NodeJSON[]; key?: string; - data?: { [key: string]: any }; + data?: StringObject; object?: 'document'; } -export class Document extends BaseNode< +export class Document extends BaseNode< DataMap > { object: 'document'; @@ -176,7 +203,8 @@ export class Document extends BaseNode< static create( properties: DocumentProperties | Document | Immutable.List | Node[] ): Document; - static fromJSON(properties: DocumentProperties | Document): Document; + static fromJSON(properties: DocumentJSON | Document): Document; + static fromJS(properties: DocumentJSON | Document): Document; static isDocument(maybeDocument: any): maybeDocument is Document; toJSON(): DocumentJSON; @@ -187,7 +215,7 @@ export interface BlockProperties { key?: string; nodes?: Immutable.List; isVoid?: boolean; - data?: Immutable.Map | { [key: string]: any }; + data?: Immutable.Map | StringObject; } export interface BlockJSON { @@ -195,7 +223,7 @@ export interface BlockJSON { key?: string; nodes?: NodeJSON[]; isVoid?: boolean; - data?: { [key: string]: any }; + data?: StringObject; object: 'block'; } @@ -208,7 +236,8 @@ export class Block extends BaseNode { static createList( array: (BlockProperties[] | Block[] | string[]) ): Immutable.List; - static fromJSON(properties: BlockProperties | Block): Block; + static fromJSON(properties: BlockJSON | Block): Block; + static fromJS(properties: BlockJSON | Block): Block; static isBlock(maybeBlock: any): maybeBlock is Block; toJSON(): BlockJSON; @@ -219,7 +248,7 @@ export interface InlineProperties { key?: string; nodes?: Immutable.List; isVoid?: boolean; - data?: Immutable.Map | { [key: string]: any }; + data?: Immutable.Map | StringObject; } export interface InlineJSON { @@ -227,7 +256,7 @@ export interface InlineJSON { key?: string; nodes?: NodeJSON[]; isVoid?: boolean; - data?: { [key: string]: any }; + data?: StringObject; object: 'inline'; } @@ -240,13 +269,15 @@ export class Inline extends BaseNode { static createList( array: (InlineProperties[] | Inline[] | string[]) ): Immutable.List; - static fromJSON(properties: InlineProperties | Inline): Inline; + static fromJSON(properties: InlineJSON | Inline): Inline; + static fromJS(properties: InlineJSON | Inline): Inline; static isInline(maybeInline: any): maybeInline is Inline; toJSON(): InlineJSON; } export interface Leaf { + object: 'leaf'; marks?: Mark[]; text: string; } @@ -270,7 +301,8 @@ export class Text extends Immutable.Record({}) { text: string; static create(properties: TextProperties | Text | string): Text; - static fromJSON(properties: TextProperties | Text): Text; + static fromJSON(properties: TextJSON | Text): Text; + static fromJS(properties: TextJSON | Text): Text; static isText(maybeText: any): maybeText is Text; toJSON(): TextJSON; @@ -280,7 +312,7 @@ export type Node = Document | Block | Inline | Text; export type NodeJSON = DocumentJSON | BlockJSON | InlineJSON | TextJSON; // tslint:disable-next-line strict-export-declare-modifiers -declare class BaseNode extends Immutable.Record( +declare class BaseNode extends Immutable.Record( {} ) { data: Immutable.Map; @@ -343,6 +375,7 @@ export class Character extends Immutable.Record({}) { array: (CharacterProperties[] | Character[] | string[]) ): Immutable.List; static fromJSON(properties: CharacterProperties | Character): Character; + static fromJS(properties: CharacterProperties | Character): Character; static isCharacter(maybeCharacter: any): maybeCharacter is Character; toJSON(): CharacterProperties; @@ -350,12 +383,12 @@ export class Character extends Immutable.Record({}) { export interface MarkProperties { type: string; - data?: Immutable.Map | { [key: string]: any }; + data?: Immutable.Map | StringObject; } export interface MarkJSON { type: string; - data?: { [key: string]: any }; + data?: StringObject; } export class Mark extends Immutable.Record({}) { @@ -368,6 +401,7 @@ export class Mark extends Immutable.Record({}) { array: (MarkProperties[] | Mark[] | string[]) ): Immutable.Set; static fromJSON(properties: MarkJSON | Mark): Mark; + static fromJS(properties: MarkJSON | Mark): Mark; static isMark(maybeMark: any): maybeMark is Mark; toJSON(): MarkProperties; @@ -379,6 +413,7 @@ export class Change extends Immutable.Record({}) { operations: Immutable.List; call(customChange: (change: Change, ...args: any[]) => Change): Change; + withoutNormalization(customChange: (change: Change) => void): Change; applyOperations(operations: Operation[]): Change; applyOperation(operation: Operation): Change; @@ -577,6 +612,7 @@ export class Range extends Immutable.Record({}) { static create(properties: RangeProperties | Range): Range; static fromJSON(properties: RangeJSON): Range; + static fromJS(properties: RangeJSON): Range; static isRange(maybeRange: any): maybeRange is Range; toJSON(): RangeProperties; diff --git a/types/slate/slate-tests.ts b/types/slate/slate-tests.ts index 2c07a4571b..25f222b4e1 100644 --- a/types/slate/slate-tests.ts +++ b/types/slate/slate-tests.ts @@ -1,21 +1,49 @@ -import { Value } from "slate"; +import { Value, Data, NodeJSON, Document } from "slate"; -const value = Value.create(); -value.change() - .focus() - .selectAll() - .delete() - .insertText('A bit of rich text, followed by...') - .moveOffsetsTo(10, 14) - .addMark('bold') - .collapseToEndOfNextBlock() - .insertBlock({ - type: 'image', - isVoid: true, - data: { - src: 'http://placekitten.com/200/300', - alt: 'Kittens', - className: 'img-responsive', - }, - }) - .insertBlock('paragraph'); +const data = Data.create({ foo: "bar "}); +const value = Value.create({ data }); +const change = value.change() +.focus() +.selectAll() +.delete() +.insertText('A bit of rich text, followed by...') +.moveOffsetsTo(10, 14) +.addMark('bold') +.collapseToEndOfNextBlock() +.insertBlock({ + type: 'image', + isVoid: true, + data: { + src: 'http://placekitten.com/200/300', + alt: 'Kittens', + className: 'img-responsive', + }, +}) +.insertBlock('paragraph'); + +const node: NodeJSON = { + object: "block", + type: "paragraph", + isVoid: false, + data: {}, + nodes: [ + { + object: "text", + leaves: [ + { + object: 'leaf', + text: "example", + marks: [], + } + ] + } + ] +}; + +const doc = Document.fromJSON({ + object: "document", + data: {}, + nodes: [ + node + ], +}); From c94a5307e3beaab79eeadfb35d1422ed3bcb44b8 Mon Sep 17 00:00:00 2001 From: YangusKhan <9inchsamurai@gmail.com> Date: Fri, 10 Aug 2018 09:32:28 -0600 Subject: [PATCH 119/346] remove type alias and use Record directly --- types/slate/index.d.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/types/slate/index.d.ts b/types/slate/index.d.ts index 4eaa88a123..c5d92e0e80 100644 --- a/types/slate/index.d.ts +++ b/types/slate/index.d.ts @@ -10,13 +10,11 @@ // TypeScript Version: 2.3 import * as Immutable from 'immutable'; -type StringObject = Record; - export class Data { [key: string]: any; static create(options: Data): Data; - static fromJSON(object: StringObject): Data; - static fromJS(object: StringObject): Data; + static fromJSON(object: Record): Data; + static fromJS(object: Record): Data; } export interface RulesByNodeType { @@ -60,7 +58,7 @@ export interface Rules { normalize?: ( change: Change, reason: InvalidReason, - context: StringObject + context: Record ) => void; parent?: ObjectsAndTypes; text?: RegExp; @@ -109,7 +107,7 @@ export interface ValueProperties { selection?: Range; history?: History; schema?: Schema; - data?: StringObject; + data?: Record; decorations?: Immutable.List | null; } @@ -118,7 +116,7 @@ export interface ValueJSON { selection?: Range; history?: History; schema?: Schema; - data?: StringObject; + data?: Record; decorations?: Immutable.List | null; object?: 'value'; } @@ -128,7 +126,7 @@ export class Value extends Immutable.Record({}) { selection: Range; history: History; schema: Schema; - data: StringObject; + data: Record; object: 'value'; decorations: Immutable.List | null; @@ -184,17 +182,17 @@ export class Value extends Immutable.Record({}) { export interface DocumentProperties { nodes?: Immutable.List | Node[]; key?: string; - data?: Immutable.Map | StringObject; + data?: Immutable.Map | Record; } export interface DocumentJSON { nodes?: NodeJSON[]; key?: string; - data?: StringObject; + data?: Record; object?: 'document'; } -export class Document extends BaseNode< +export class Document> extends BaseNode< DataMap > { object: 'document'; @@ -215,7 +213,7 @@ export interface BlockProperties { key?: string; nodes?: Immutable.List; isVoid?: boolean; - data?: Immutable.Map | StringObject; + data?: Immutable.Map | Record; } export interface BlockJSON { @@ -223,7 +221,7 @@ export interface BlockJSON { key?: string; nodes?: NodeJSON[]; isVoid?: boolean; - data?: StringObject; + data?: Record; object: 'block'; } @@ -248,7 +246,7 @@ export interface InlineProperties { key?: string; nodes?: Immutable.List; isVoid?: boolean; - data?: Immutable.Map | StringObject; + data?: Immutable.Map | Record; } export interface InlineJSON { @@ -256,7 +254,7 @@ export interface InlineJSON { key?: string; nodes?: NodeJSON[]; isVoid?: boolean; - data?: StringObject; + data?: Record; object: 'inline'; } @@ -312,7 +310,7 @@ export type Node = Document | Block | Inline | Text; export type NodeJSON = DocumentJSON | BlockJSON | InlineJSON | TextJSON; // tslint:disable-next-line strict-export-declare-modifiers -declare class BaseNode extends Immutable.Record( +declare class BaseNode> extends Immutable.Record( {} ) { data: Immutable.Map; @@ -383,12 +381,12 @@ export class Character extends Immutable.Record({}) { export interface MarkProperties { type: string; - data?: Immutable.Map | StringObject; + data?: Immutable.Map | Record; } export interface MarkJSON { type: string; - data?: StringObject; + data?: Record; } export class Mark extends Immutable.Record({}) { From 8f1ce6502bdbfde6179e19c2a27d284a3d1be04e Mon Sep 17 00:00:00 2001 From: thomas-b Date: Fri, 10 Aug 2018 15:56:02 +0200 Subject: [PATCH 120/346] [hapi] Correct the server.table() return type --- types/hapi/index.d.ts | 2 +- types/hapi/test/server/server-table.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 23aaf3608c..9f348332ea 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -3790,7 +3790,7 @@ export class Server extends Podium { * * path - the route path. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servertablehost) */ - table(host?: string): Array<{settings: ServerRoute; method: Util.HTTP_METHODS_PARTIAL_LOWERCASE, path: string}>; // TODO I am not sure if the ServerRoute is the object expected here + table(host?: string): RequestRoute[]; } /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/types/hapi/test/server/server-table.ts b/types/hapi/test/server/server-table.ts index ab14938be4..79726118b5 100644 --- a/types/hapi/test/server/server-table.ts +++ b/types/hapi/test/server/server-table.ts @@ -19,4 +19,11 @@ server.route({ server.start(); const table = server.table(); console.log(table); +console.log(table[0].method); +console.log(table[0].path); +console.log(table[0].vhost); +console.log(table[0].realm); +console.log(table[0].settings); +console.log(table[0].fingerprint); +console.log(table[0].auth); console.log('Server started at: ' + server.info.uri); From c8617e06e6125533299734bfb96efe31b238e815 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Fri, 10 Aug 2018 08:49:48 -0700 Subject: [PATCH 121/346] Add orderable --- types/webpack-chain/index.d.ts | 17 +++++++++++++++-- types/webpack-chain/webpack-chain-tests.ts | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/types/webpack-chain/index.d.ts b/types/webpack-chain/index.d.ts index 691e4be9b9..033ef9951f 100644 --- a/types/webpack-chain/index.d.ts +++ b/types/webpack-chain/index.d.ts @@ -85,10 +85,14 @@ declare namespace Config { class Plugins extends TypedChainedMap> {} - class Plugin extends ChainedMap { + class Plugin extends ChainedMap implements Orderable { init(value: (plugin: PluginClass, args: any[]) => webpack.Plugin): this; use(plugin: PluginClass, args?: any[]): this; tap(f: (args: any[]) => any[]): this; + + // Orderable + before(name: string): this; + after(name: string): this; } class Module extends ChainedMap { @@ -231,11 +235,15 @@ declare namespace Config { interface LoaderOptions { [name: string]: any; } - class Use extends ChainedMap { + class Use extends ChainedMap implements Orderable { loader(value: string): this; options(value: LoaderOptions): this; tap(f: (options: LoaderOptions) => LoaderOptions): this; + + // Orderable + before(name: string): this; + after(name: string): this; } type DevTool = 'eval' | 'inline-source-map' | 'cheap-eval-source-map' | 'cheap-source-map' | @@ -255,4 +263,9 @@ declare namespace Config { interface PluginClass { new (...opts: any[]): webpack.Plugin; } + + interface Orderable { + before(name: string): this; + after(name: string): this; + } } diff --git a/types/webpack-chain/webpack-chain-tests.ts b/types/webpack-chain/webpack-chain-tests.ts index 8775fec7f9..e61cd4e304 100644 --- a/types/webpack-chain/webpack-chain-tests.ts +++ b/types/webpack-chain/webpack-chain-tests.ts @@ -46,8 +46,20 @@ config .use(webpack.DefinePlugin, []) .end() + .plugin('bar') + .use(webpack.DefinePlugin, []) + .before('foo') + .end() + + .plugin('baz') + .use(webpack.DefinePlugin, []) + .after('bar') + .end() + .plugins .delete('foo') + .delete('bar') + .delete('baz') .end() .devServer @@ -113,6 +125,14 @@ config .pre() .post() .end() + .rule('lint') + .test(/.js$/) + .use('eslint') + .loader('eslint-loader') + .options({}) + .after('compile') + .end() + .end() .rules .delete('compile') .end() From 3221d9567c1359e6a701674131edea8608481ea4 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Fri, 10 Aug 2018 08:52:20 -0700 Subject: [PATCH 122/346] Fix tests --- types/webpack-chain/webpack-chain-tests.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/types/webpack-chain/webpack-chain-tests.ts b/types/webpack-chain/webpack-chain-tests.ts index e61cd4e304..ffeeba1248 100644 --- a/types/webpack-chain/webpack-chain-tests.ts +++ b/types/webpack-chain/webpack-chain-tests.ts @@ -119,19 +119,17 @@ config .loader('babel-loader') .options({}) .end() - .uses - .delete('babel') - .end() - .pre() - .post() - .end() - .rule('lint') - .test(/.js$/) .use('eslint') .loader('eslint-loader') .options({}) .after('compile') .end() + .uses + .delete('babel') + .delete('eslint') + .end() + .pre() + .post() .end() .rules .delete('compile') From dee63e3c68dcc887549fd227be95ba6a27396ba9 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Fri, 10 Aug 2018 08:54:30 -0700 Subject: [PATCH 123/346] Fix tests --- types/webpack-chain/webpack-chain-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack-chain/webpack-chain-tests.ts b/types/webpack-chain/webpack-chain-tests.ts index ffeeba1248..f1d0daa5e2 100644 --- a/types/webpack-chain/webpack-chain-tests.ts +++ b/types/webpack-chain/webpack-chain-tests.ts @@ -122,7 +122,7 @@ config .use('eslint') .loader('eslint-loader') .options({}) - .after('compile') + .after('babel') .end() .uses .delete('babel') From 559a849830e6d72e1186dde320f77f37718f6c89 Mon Sep 17 00:00:00 2001 From: gcangussu Date: Fri, 10 Aug 2018 13:35:15 -0300 Subject: [PATCH 124/346] Fix zone method return type The method `moment.tz.zone()` returns `null` or a `MomentZone`: https://momentjs.com/timezone/docs/#/data-loading/checking-if-a-zone-exists/ --- types/moment-timezone/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/moment-timezone/index.d.ts b/types/moment-timezone/index.d.ts index 395ab77c82..1d05b96f36 100644 --- a/types/moment-timezone/index.d.ts +++ b/types/moment-timezone/index.d.ts @@ -36,7 +36,7 @@ declare module "moment" { (date: moment.Moment, timezone: string): moment.Moment; (date: any, timezone: string): moment.Moment; - zone(timezone: string): MomentZone; + zone(timezone: string): MomentZone | null; add(packedZoneString: string): void; add(packedZoneString: string[]): void; From bd5b0e03197a02014d9d0c41508f1d0dd16c14c2 Mon Sep 17 00:00:00 2001 From: fhelwanger Date: Fri, 10 Aug 2018 14:18:00 -0300 Subject: [PATCH 125/346] [expo] ImageManipulator height or width optional --- types/expo/expo-tests.tsx | 9 ++++++--- types/expo/index.d.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 210c3400a9..0098a14489 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -374,9 +374,12 @@ async () => { }; async () => { - const result = await ImageManipulator.manipulate('url', [{ - rotate: 90 - }], { + const result = await ImageManipulator.manipulate('url', [ + { rotate: 90 }, + { resize: { width: 300 } }, + { resize: { height: 300 } }, + { resize: { height: 300, width: 300 } }, + ], { compress: 0.75 }); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8ad088763d..868afd5e56 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1519,7 +1519,7 @@ export namespace ImageManipulator { type Action = Resize | Rotate | Flip | Crop; interface Resize { - resize: { width: number, height: number }; + resize: { width?: number, height?: number }; } interface Rotate { From b33fba3a4503b572f0fc41f350e3e4b11c61d821 Mon Sep 17 00:00:00 2001 From: Monroe Ekilah Date: Fri, 10 Aug 2018 12:09:30 -0700 Subject: [PATCH 126/346] https://github.com/react-dropzone/react-dropzone/blob/master/README.md links to https://react-dropzone.netlify.com/#proptypes which describes the `accept` prop as optional and accepts: > One of type: string, string[] comes from https://github.com/okonet/attr-accept 's ability to take an array of strings. --- types/react-dropzone/index.d.ts | 6 ++++-- types/react-dropzone/react-dropzone-tests.tsx | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/types/react-dropzone/index.d.ts b/types/react-dropzone/index.d.ts index 116fcbdb57..77ddd9faa8 100644 --- a/types/react-dropzone/index.d.ts +++ b/types/react-dropzone/index.d.ts @@ -6,7 +6,8 @@ // Ben Bayard , // Karol Janyst , // Andris Causs , -// Juraj Husar +// Juraj Husar , +// Monroe Ekilah // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -19,9 +20,10 @@ export interface ImageFile extends File { export type DropFileEventHandler = (acceptedOrRejected: ImageFile[], event: DragEvent) => void; export type DropFilesEventHandler = (accepted: ImageFile[], rejected: ImageFile[], event: DragEvent) => void; -type PickedAttributes = "accept" | "className" | "multiple" | "name" | "onClick" | "onDragStart" | "onDragEnter" | "onDragOver" | "onDragLeave" | "style"; +type PickedAttributes = "className" | "multiple" | "name" | "onClick" | "onDragStart" | "onDragEnter" | "onDragOver" | "onDragLeave" | "style"; export interface DropzoneProps extends Pick, PickedAttributes> { + accept?: string | ReadonlyArray; disableClick?: boolean; disabled?: boolean; disablePreview?: boolean; diff --git a/types/react-dropzone/react-dropzone-tests.tsx b/types/react-dropzone/react-dropzone-tests.tsx index 67fa8eadb3..6b7179f2f5 100644 --- a/types/react-dropzone/react-dropzone-tests.tsx +++ b/types/react-dropzone/react-dropzone-tests.tsx @@ -14,9 +14,11 @@ class Test extends React.Component { handleDropFiles = (accepted: File[], rejected: File[], event: DragEvent) => {}; - handleDefault = (e: SyntheticEvent) => {} + handleDefault = (e: SyntheticEvent) => {}; - handleFileDialog = () => {} + handleFileDialog = () => {}; + + accept: string | ReadonlyArray = ["*.png", "application/pdf"]; render() { return ( @@ -47,7 +49,7 @@ class Test extends React.Component { disableClick disabled multiple={false} - accept="*.png" + accept={this.accept} name="dropzone" inputProps={{ id : "dropzone" }} /> From c9f9d46d4bca22adbfbebd5d4bac0162014f30fa Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Fri, 10 Aug 2018 23:00:47 +0200 Subject: [PATCH 127/346] chore(fork-ts-checker-webpack-plugin): remove typings (#27968) --- notNeededPackages.json | 6 + .../fork-ts-checker-webpack-plugin-tests.ts | 36 ------ .../fork-ts-checker-webpack-plugin/index.d.ts | 110 ------------------ .../package.json | 7 -- .../tsconfig.json | 23 ---- .../tslint.json | 1 - 6 files changed, 6 insertions(+), 177 deletions(-) delete mode 100644 types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts delete mode 100644 types/fork-ts-checker-webpack-plugin/index.d.ts delete mode 100644 types/fork-ts-checker-webpack-plugin/package.json delete mode 100644 types/fork-ts-checker-webpack-plugin/tsconfig.json delete mode 100644 types/fork-ts-checker-webpack-plugin/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 8b56dbd9b5..f630c4e59e 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -570,6 +570,12 @@ "sourceRepoURL": "https://github.com/acdlite/flux-standard-action", "asOfVersion": "1.1.0" }, + { + "libraryName": "fork-ts-checker-webpack-plugin", + "typingsPackageName": "fork-ts-checker-webpack-plugin", + "sourceRepoURL": "https://github.com/Realytics/fork-ts-checker-webpack-plugin", + "asOfVersion": "0.4.5" + }, { "libraryName": "Foundation Sites", "typingsPackageName": "foundation-sites", diff --git a/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts b/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts deleted file mode 100644 index 7f28a37597..0000000000 --- a/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Configuration } from 'webpack'; -import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; - -let config: Configuration = { - plugins: [ - new ForkTsCheckerWebpackPlugin() - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({}) - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({ - vue: true - }) - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({ - logger: { - error: message => console.error(message), - warn: message => console.warn(message), - info: message => console.info(message), - } - }) - ] -}; - -export default config; diff --git a/types/fork-ts-checker-webpack-plugin/index.d.ts b/types/fork-ts-checker-webpack-plugin/index.d.ts deleted file mode 100644 index 715b1fe41b..0000000000 --- a/types/fork-ts-checker-webpack-plugin/index.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Type definitions for fork-ts-checker-webpack-plugin 0.4 -// Project: https://github.com/Realytics/fork-ts-checker-webpack-plugin#readme -// Definitions by: JounQin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - -import { RuleFailure } from 'tslint'; -import { Diagnostic } from 'typescript'; -import { Plugin } from 'webpack'; - -declare namespace ForkTsCheckerWebpackPlugin { - type ErrorType = 'diagnostic' | 'lint'; - type Severity = 'error' | 'warning'; - - interface NormalizedMessageJson { - type: ErrorType; - code: string | number; - severity: Severity; - content: string; - file: string; - line: number; - character: number; - } - - class NormalizedMessage { - static TYPE_DIAGNOSTIC: ErrorType; - static TYPE_LINT: ErrorType; - static SEVERITY_ERROR: Severity; - static SEVERITY_WARNING: Severity; - type: ErrorType; - code: string | number; - severity: Severity; - content: string; - file: string; - line: number; - character: number; - constructor(data: NormalizedMessageJson); - static createFromDiagnostic(diagnostic: Diagnostic): NormalizedMessage; - static createFromLint(lint: RuleFailure): NormalizedMessage; - static createFromJSON(json: NormalizedMessageJson): NormalizedMessage; - static compare( - messageA: NormalizedMessage, - messageB: NormalizedMessage, - ): number; - static equals( - messageA: NormalizedMessage, - messageB: NormalizedMessage, - ): boolean; - static deduplicate(messages: NormalizedMessage[]): NormalizedMessage[]; - static compareTypes(typeA: ErrorType, typeB: ErrorType): number; - static compareSeverities( - severityA: Severity, - severityB: Severity, - ): number; - static compareOptionalStrings(stringA: string, stringB: string): number; - static compareNumbers(numberA: number, numberB: number): number; - toJSON(): NormalizedMessageJson; - getType(): ErrorType; - isDiagnosticType(): boolean; - isLintType(): boolean; - getCode(): string | number; - getFormattedCode(): string | number; - getSeverity(): Severity; - isErrorSeverity(): boolean; - isWarningSeverity(): boolean; - getContent(): string; - getFile(): string; - getLine(): number; - getCharacter(): number; - } - - type Formatter = (message: NormalizedMessage, useColors: boolean) => string; - - interface Logger { - error(message?: any): void; - warn(message?: any): void; - info(message?: any): void; - } - - interface Options { - tsconfig?: string; - tslint?: string | true; - watch?: string | string[]; - async?: boolean; - ignoreDiagnostics?: number[]; - ignoreLints?: string[]; - colors?: boolean; - logger?: Logger; - formatter?: 'default' | 'codeframe' | Formatter; - formatterOptions?: { - highlightCode?: boolean - linesAbove?: number - linesBelow?: number - forceColor?: boolean - }; - silent?: boolean; - checkSyntacticErrors?: boolean; - memoryLimit?: number; - workers?: number; - vue?: boolean; - } -} - -declare class ForkTsCheckerWebpackPlugin extends Plugin { - constructor(options?: ForkTsCheckerWebpackPlugin.Options); -} - -export = ForkTsCheckerWebpackPlugin; diff --git a/types/fork-ts-checker-webpack-plugin/package.json b/types/fork-ts-checker-webpack-plugin/package.json deleted file mode 100644 index 2371372125..0000000000 --- a/types/fork-ts-checker-webpack-plugin/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "dependencies": { - "tslint": "*", - "typescript": "*" - } -} diff --git a/types/fork-ts-checker-webpack-plugin/tsconfig.json b/types/fork-ts-checker-webpack-plugin/tsconfig.json deleted file mode 100644 index cfd6ee81db..0000000000 --- a/types/fork-ts-checker-webpack-plugin/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "fork-ts-checker-webpack-plugin-tests.ts" - ] -} diff --git a/types/fork-ts-checker-webpack-plugin/tslint.json b/types/fork-ts-checker-webpack-plugin/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/fork-ts-checker-webpack-plugin/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 872f1cee16d8350e3a999aa25807377b4534b9ba Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 10 Aug 2018 14:11:26 -0700 Subject: [PATCH 128/346] minor cleanup --- types/office-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index f3bd6b3681..31b2571a5e 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -987,7 +987,7 @@ declare namespace Office { * * * AsyncResult.error - * Access an Error object that provides error information if the operation failed. + * Access an Error object that provides error information if the operation failed. * * * AsyncResult.asyncContext From 085c22780aa401ab903530116e4afb9ad949f229 Mon Sep 17 00:00:00 2001 From: Ricky Kirkham Date: Fri, 10 Aug 2018 14:22:27 -0700 Subject: [PATCH 129/346] document openBrowserWindow method --- types/office-js/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index f3bd6b3681..7975cd2a0a 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1020,6 +1020,11 @@ declare namespace Office { * - Called from a module extension: No effect. */ closeContainer(): void; + /** + * Opens a browser window and loads the specified URL. + * @param url The full URL to be opened including protocol (e.g., https), and port number, if any. + */ + openBrowserWindow(url: string): void; } /** From 8aad19dfb14764fd2f99b3d90eb3b89875d0cecb Mon Sep 17 00:00:00 2001 From: Alex Van Camp Date: Fri, 10 Aug 2018 17:09:15 -0500 Subject: [PATCH 130/346] p-retry: Update for v2.0 --- types/p-retry/index.d.ts | 13 +++++++++++-- types/p-retry/p-retry-tests.ts | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/types/p-retry/index.d.ts b/types/p-retry/index.d.ts index 784f637549..c1791fcc63 100644 --- a/types/p-retry/index.d.ts +++ b/types/p-retry/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for p-retry 1.0 +// Type definitions for p-retry 2.0 // Project: https://github.com/sindresorhus/p-retry#readme // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ import { OperationOptions } from 'retry'; export = pRetry; -declare function pRetry(input: (attemptCount: number) => PromiseLike | T, options?: OperationOptions): Promise; +declare function pRetry(input: (attemptCount: number) => PromiseLike | T, options?: pRetry.Options): Promise; declare namespace pRetry { class AbortError extends Error { @@ -16,4 +16,13 @@ declare namespace pRetry { readonly originalError: Error; constructor(message: string | Error); } + + interface FailedAttemptError extends Error { + attemptNumber: number; + attemptsLeft: number; + } + + interface Options extends OperationOptions { + onFailedAttempt?: (error: FailedAttemptError) => void; + } } diff --git a/types/p-retry/p-retry-tests.ts b/types/p-retry/p-retry-tests.ts index 72962d553e..1b58960e95 100644 --- a/types/p-retry/p-retry-tests.ts +++ b/types/p-retry/p-retry-tests.ts @@ -11,6 +11,11 @@ const run = () => fetch('https://sindresorhus.com/unicorn') return response.text(); }); -pRetry(run, {retries: 5}).then(result => { +pRetry(run, { + retries: 5, + onFailedAttempt: error => { + console.log(`Attempt ${error.attemptNumber} failed. There are ${error.attemptsLeft} attempts left.`); + } +}).then(result => { const str: string = result; }); From b3387d6338b737e54053a36e2680c7eb017dc7f1 Mon Sep 17 00:00:00 2001 From: ikokostya Date: Sat, 11 Aug 2018 01:39:39 +0300 Subject: [PATCH 131/346] [node] Update declarations for dns.resolveAny (#27950) * [node] Update declarations for dns.resolveAny * Fix dns.resolve test * Add CNAME record type * Use @deprecated tag for AnyRecordWithTtl interface --- types/node/index.d.ts | 82 ++++++++++++++++++++++++++++++--- types/node/node-tests.ts | 2 +- types/node/v8/index.d.ts | 97 +++++++++++++++++++++++++++++++++++++++- types/node/v9/index.d.ts | 97 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 266 insertions(+), 12 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index cb71b625b9..d94de3d10a 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2582,8 +2582,15 @@ declare module "dns" { ttl: number; } - export interface AnyRecordWithTtl extends RecordWithTtl { - type: "A" | "AAAA"; + /** @deprecated Use AnyARecord or AnyAaaaRecord instead. */ + export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + + export interface AnyARecord extends RecordWithTtl { + type: "A"; + } + + export interface AnyAaaaRecord extends RecordWithTtl { + type: "AAAA"; } export interface MxRecord { @@ -2638,10 +2645,36 @@ declare module "dns" { entries: string[]; } + export interface AnyNsRecord { + type: "NS"; + value: string; + } + + export interface AnyPtrRecord { + type: "PTR"; + value: string; + } + + export interface AnyCnameRecord { + type: "CNAME"; + value: string; + } + + export type AnyRecord = AnyARecord | + AnyAaaaRecord | + AnyCnameRecord | + AnyMxRecord | + AnyNaptrRecord | + AnyNsRecord | + AnyPtrRecord | + AnySoaRecord | + AnySrvRecord | + AnyTxtRecord; + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: AnyRecord[]) => void): void; export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; @@ -2650,18 +2683,18 @@ declare module "dns" { export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; - export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void): void; // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. export namespace resolve { export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - export function __promisify__(hostname: string, rrtype: "ANY"): Promise>; + export function __promisify__(hostname: string, rrtype: "ANY"): Promise; export function __promisify__(hostname: string, rrtype: "MX"): Promise; export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; export function __promisify__(hostname: string, rrtype: "SOA"): Promise; export function __promisify__(hostname: string, rrtype: "SRV"): Promise; export function __promisify__(hostname: string, rrtype: "TXT"): Promise; - export function __promisify__(hostname: string, rrtype?: string): Promise; + export function __promisify__(hostname: string, rrtype: string): Promise; } export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; @@ -2686,15 +2719,50 @@ declare module "dns" { export function __promisify__(hostname: string, options?: ResolveOptions): Promise; } - export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolveCname { + export function __promisify__(hostname: string): Promise; + } + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + export function __promisify__(hostname: string): Promise; + } + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + export function __promisify__(hostname: string): Promise; + } + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolveNs { + export function __promisify__(hostname: string): Promise; + } + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolvePtr { + export function __promisify__(hostname: string): Promise; + } + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export namespace resolveSoa { + export function __promisify__(hostname: string): Promise; + } + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + export function __promisify__(hostname: string): Promise; + } + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export namespace resolveTxt { + export function __promisify__(hostname: string): Promise; + } + + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + export function __promisify__(hostname: string): Promise; + } export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; export function setServers(servers: string[]): void; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 654b7f3901..c6ab3f9551 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -3355,7 +3355,7 @@ namespace dns_tests { const _addresses: string[] = addresses; }); dns.resolve("nodejs.org", "ANY", (err, addresses) => { - const _addresses: ReadonlyArray = addresses; + const _addresses: dns.AnyRecord[] = addresses; }); dns.resolve("nodejs.org", "MX", (err, addresses) => { const _addresses: dns.MxRecord[] = addresses; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 06283dd1dd..d8a1cb431c 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -2465,11 +2465,23 @@ declare module "dns" { ttl: number; } + export interface AnyARecord extends RecordWithTtl { + type: "A"; + } + + export interface AnyAaaaRecord extends RecordWithTtl { + type: "AAAA"; + } + export interface MxRecord { priority: number; exchange: string; } + export interface AnyMxRecord extends MxRecord { + type: "MX"; + } + export interface NaptrRecord { flags: string; service: string; @@ -2479,6 +2491,10 @@ declare module "dns" { preference: number; } + export interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR"; + } + export interface SoaRecord { nsname: string; hostmaster: string; @@ -2489,6 +2505,10 @@ declare module "dns" { minttl: number; } + export interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + export interface SrvRecord { priority: number; weight: number; @@ -2496,9 +2516,45 @@ declare module "dns" { name: string; } + export interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + + export interface AnyTxtRecord { + type: "TXT"; + entries: string[]; + } + + export interface AnyNsRecord { + type: "NS"; + value: string; + } + + export interface AnyPtrRecord { + type: "PTR"; + value: string; + } + + export interface AnyCnameRecord { + type: "CNAME"; + value: string; + } + + export type AnyRecord = AnyARecord | + AnyAaaaRecord | + AnyCnameRecord | + AnyMxRecord | + AnyNaptrRecord | + AnyNsRecord | + AnyPtrRecord | + AnySoaRecord | + AnySrvRecord | + AnyTxtRecord; + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: AnyRecord[]) => void): void; export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; @@ -2507,17 +2563,18 @@ declare module "dns" { export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; - export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void): void; // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. export namespace resolve { export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + export function __promisify__(hostname: string, rrtype: "ANY"): Promise; export function __promisify__(hostname: string, rrtype: "MX"): Promise; export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; export function __promisify__(hostname: string, rrtype: "SOA"): Promise; export function __promisify__(hostname: string, rrtype: "SRV"): Promise; export function __promisify__(hostname: string, rrtype: "TXT"): Promise; - export function __promisify__(hostname: string, rrtype?: string): Promise; + export function __promisify__(hostname: string, rrtype: string): Promise; } export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; @@ -2543,13 +2600,49 @@ declare module "dns" { } export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolveCname { + export function __promisify__(hostname: string): Promise; + } + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + export function __promisify__(hostname: string): Promise; + } + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + export function __promisify__(hostname: string): Promise; + } + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolveNs { + export function __promisify__(hostname: string): Promise; + } + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolvePtr { + export function __promisify__(hostname: string): Promise; + } + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export namespace resolveSoa { + export function __promisify__(hostname: string): Promise; + } + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + export function __promisify__(hostname: string): Promise; + } + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export namespace resolveTxt { + export function __promisify__(hostname: string): Promise; + } + + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + export function __promisify__(hostname: string): Promise; + } export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; export function setServers(servers: string[]): void; diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index aed5a0f9a0..8150a68294 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -2547,11 +2547,23 @@ declare module "dns" { ttl: number; } + export interface AnyARecord extends RecordWithTtl { + type: "A"; + } + + export interface AnyAaaaRecord extends RecordWithTtl { + type: "AAAA"; + } + export interface MxRecord { priority: number; exchange: string; } + export interface AnyMxRecord extends MxRecord { + type: "MX"; + } + export interface NaptrRecord { flags: string; service: string; @@ -2561,6 +2573,10 @@ declare module "dns" { preference: number; } + export interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR"; + } + export interface SoaRecord { nsname: string; hostmaster: string; @@ -2571,6 +2587,10 @@ declare module "dns" { minttl: number; } + export interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + export interface SrvRecord { priority: number; weight: number; @@ -2578,9 +2598,45 @@ declare module "dns" { name: string; } + export interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + + export interface AnyTxtRecord { + type: "TXT"; + entries: string[]; + } + + export interface AnyNsRecord { + type: "NS"; + value: string; + } + + export interface AnyPtrRecord { + type: "PTR"; + value: string; + } + + export interface AnyCnameRecord { + type: "CNAME"; + value: string; + } + + export type AnyRecord = AnyARecord | + AnyAaaaRecord | + AnyCnameRecord | + AnyMxRecord | + AnyNaptrRecord | + AnyNsRecord | + AnyPtrRecord | + AnySoaRecord | + AnySrvRecord | + AnyTxtRecord; + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: AnyRecord[]) => void): void; export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; @@ -2589,17 +2645,18 @@ declare module "dns" { export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; - export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void): void; // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. export namespace resolve { export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + export function __promisify__(hostname: string, rrtype: "ANY"): Promise; export function __promisify__(hostname: string, rrtype: "MX"): Promise; export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; export function __promisify__(hostname: string, rrtype: "SOA"): Promise; export function __promisify__(hostname: string, rrtype: "SRV"): Promise; export function __promisify__(hostname: string, rrtype: "TXT"): Promise; - export function __promisify__(hostname: string, rrtype?: string): Promise; + export function __promisify__(hostname: string, rrtype: string): Promise; } export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; @@ -2625,13 +2682,49 @@ declare module "dns" { } export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolveCname { + export function __promisify__(hostname: string): Promise; + } + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + export function __promisify__(hostname: string): Promise; + } + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + export function __promisify__(hostname: string): Promise; + } + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolveNs { + export function __promisify__(hostname: string): Promise; + } + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export namespace resolvePtr { + export function __promisify__(hostname: string): Promise; + } + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export namespace resolveSoa { + export function __promisify__(hostname: string): Promise; + } + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + export function __promisify__(hostname: string): Promise; + } + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export namespace resolveTxt { + export function __promisify__(hostname: string): Promise; + } + + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + export function __promisify__(hostname: string): Promise; + } export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; export function setServers(servers: string[]): void; From 97ac17135aa2537069bcb969453c2bc821ef9ccb Mon Sep 17 00:00:00 2001 From: Paul Huynh Date: Sat, 11 Aug 2018 12:03:53 +1000 Subject: [PATCH 132/346] Allow rules to consist of an array of sub-rules --- types/moo/index.d.ts | 2 +- types/moo/moo-tests.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/types/moo/index.d.ts b/types/moo/index.d.ts index 9cf67c3299..fa3a59d2ab 100644 --- a/types/moo/index.d.ts +++ b/types/moo/index.d.ts @@ -50,7 +50,7 @@ export interface Rule { }; } export interface Rules { - [x: string]: RegExp | string | string[] | Rule; + [x: string]: RegExp | string | string[] | Rule | Rule[]; } export interface Lexer { diff --git a/types/moo/moo-tests.ts b/types/moo/moo-tests.ts index 6f0c18ae2d..c82bedd219 100644 --- a/types/moo/moo-tests.ts +++ b/types/moo/moo-tests.ts @@ -75,3 +75,13 @@ lexer.next(); lexer.next(); lexer.reset('a different line\n', info); lexer.next(); + +// Transform: https://github.com/no-context/moo#transform +moo.compile({ + STRING: [ + { match: /"""[^]*?"""/, lineBreaks: true, value: x => x.slice(3, -3) }, + { match: /"(?:\\["\\rn]|[^"\\])*?"/, lineBreaks: true, value: x => x.slice(1, -1) }, + { match: /'(?:\\['\\rn]|[^'\\])*?'/, lineBreaks: true, value: x => x.slice(1, -1) }, + ], + // ... +}); From fa4eab07a9106a3a80c89810d062847f4f6aa501 Mon Sep 17 00:00:00 2001 From: Nathan Phillip Brink Date: Sat, 11 Aug 2018 04:10:47 +0000 Subject: [PATCH 133/346] uid-safe: Set Promise type to string. --- types/uid-safe/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/uid-safe/index.d.ts b/types/uid-safe/index.d.ts index ee7b13491f..20a85ae899 100644 --- a/types/uid-safe/index.d.ts +++ b/types/uid-safe/index.d.ts @@ -8,7 +8,7 @@ declare namespace UID { export interface Generate { (byteLength: number, callback: (err: any, str: string) => any): void; - (byteLength: number): Promise; + (byteLength: number): Promise; sync(byteLength: number): string; } From 25c5f17ca6d56284b8bc7abcf4f9449971fc8da0 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Sat, 11 Aug 2018 03:58:05 -0400 Subject: [PATCH 134/346] Add keyboardType to AlertIOS prompt --- types/react-native/index.d.ts | 3 ++- types/react-native/test/index.tsx | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 40a9375126..8d591b6bd1 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6790,7 +6790,8 @@ export interface AlertIOSStatic { message?: string, callbackOrButtons?: ((value: string) => void) | Array, type?: AlertType, - defaultValue?: string + defaultValue?: string, + keyboardType?: KeyboardType | KeyboardTypeIOS, ) => void; } diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 93eeabd985..2980ac9f62 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -16,6 +16,7 @@ import { Alert, AppState, AppStateIOS, + AlertIOS, BackAndroid, BackHandler, Button, @@ -730,3 +731,25 @@ class AccessibilityTest extends React.Component { const KeyboardAvoidingViewTest = () => ( ); + + +const AlertIOSTest = () => { + AlertIOS.prompt( + 'My Prompt', + 'Enter your email', + [ + { + text: 'Cancel', + style: 'cancel' + }, + { + text: 'Add', + onPress: (value: string) => { + console.log(value); + }, + }, + ], + 'default', + 'email-address' + ); +} From 55b27e270940c86eb1c7229124769d1013ced707 Mon Sep 17 00:00:00 2001 From: shintaro-morikawa Date: Sat, 11 Aug 2018 20:57:24 +0900 Subject: [PATCH 135/346] Fix return type React Native AsyncStorage.getItem --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 40a9375126..26c04ced1e 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6847,7 +6847,7 @@ export interface AsyncStorageStatic { /** * Fetches key and passes the result to callback, along with an Error if there is any. */ - getItem(key: string, callback?: (error?: Error, result?: string) => void): Promise; + getItem(key: string, callback?: (error?: Error, result?: string) => void): Promise; /** * Sets value for key and calls callback on completion, along with an Error if there is any From 06bd28a44f40472d00eebc7d177775f876cd2ca1 Mon Sep 17 00:00:00 2001 From: chenshidong Date: Sun, 12 Aug 2018 00:16:31 +0800 Subject: [PATCH 136/346] feat(better-scroll): add typings --- notNeededPackages.json | 6 - types/better-scroll/better-scroll-tests.ts | 68 ++++++ types/better-scroll/index.d.ts | 238 +++++++++++++++++++++ types/better-scroll/tsconfig.json | 24 +++ types/better-scroll/tslint.json | 1 + 5 files changed, 331 insertions(+), 6 deletions(-) create mode 100644 types/better-scroll/better-scroll-tests.ts create mode 100644 types/better-scroll/index.d.ts create mode 100644 types/better-scroll/tsconfig.json create mode 100644 types/better-scroll/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index f630c4e59e..8cb8b15fe4 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -156,12 +156,6 @@ "sourceRepoURL": "https://github.com/brianloveswords/base64url", "asOfVersion": "2.0.0" }, - { - "libraryName": "better-scroll", - "typingsPackageName": "better-scroll", - "sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll", - "asOfVersion": "1.5.0" - }, { "libraryName": "BigInteger.js", "typingsPackageName": "big-integer", diff --git a/types/better-scroll/better-scroll-tests.ts b/types/better-scroll/better-scroll-tests.ts new file mode 100644 index 0000000000..282e6185ab --- /dev/null +++ b/types/better-scroll/better-scroll-tests.ts @@ -0,0 +1,68 @@ +import BScroll from 'better-scroll'; + +const BScroll1 = new BScroll('#wrapper'); +const BScroll2 = new BScroll('#wrapper', { scrollX: false, scrollY: false }); +const BScroll3 = new BScroll('#wrapper', { + snap: true, + wheel: false, + scrollbar: false, + pullDownRefresh: false, +}); +const BScroll4 = new BScroll('#wrapper', { + wheel: { + selectedIndex: 0, + }, +}); +const BScroll6 = new BScroll('#wrapper', { + snap: { + loop: false, + el: document.querySelector('div-test') as Element, + threshold: 0.1, + stepX: 100, + stepY: 100, + listenFlick: true, + }, +}); +const BScroll7 = new BScroll('#wrapper', { + scrollbar: { + fade: true, + }, +}); + +const BScroll8 = new BScroll('#wrapper', { + pullDownRefresh: { + threshold: 50, + stop: 20, + }, +}); + +BScroll1.refresh(); +BScroll1.scrollTo(0, 100); +BScroll1.scrollTo(0, 100, 200); + +BScroll1.scrollToElement('selectedElement'); +BScroll1.scrollToElement('selectedElement', 250); + +BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement); +BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement, 250); + +BScroll2.on('scrollStart', () => { console.log('scroll started'); }); + +const BScroll9 = new BScroll(document.getElementById('wrapper') as HTMLElement); +const BScroll10 = new BScroll(document.getElementById('wrapper') as HTMLElement, { freeScroll: true }); +const BScroll11 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + preventDefaultException: { + tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/, + }, +}); +const BScroll12 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + preventDefaultException: { + className: /(^|\s)test(\s|$)/, + }, +}); + +const BScroll13 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + swipeBounceTime: 1000, +}); + +const BScroll14 = new BScroll('#wrapper', { disableMouse: true, disableTouch: false }); diff --git a/types/better-scroll/index.d.ts b/types/better-scroll/index.d.ts new file mode 100644 index 0000000000..4ce8b2a4c1 --- /dev/null +++ b/types/better-scroll/index.d.ts @@ -0,0 +1,238 @@ +// Type definitions for better-scroll 1.12 +// Project: https://github.com/ustbhuangyi/better-scroll +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 +export interface WheelOption { + selectedIndex: number; + rotate: number; + adjustTime: number; + wheelWrapperClass: string; + wheelItemClass: string; +} + +export interface PageOption { + x: number; + y: number; + pageX: number; + pageY: number; +} + +export interface SlideOption { + loop: boolean; + el: Element; + threshold: number; + stepX: number; + stepY: number; + speed: number; + listenFlick: boolean; +} + +export interface ScrollBarOption { + fade: boolean; +} + +export interface PullDownOption { + threshold: number; + stop: number; +} + +export interface PullUpOption { + threshold: number; +} + +export interface BounceObjectOption { + top?: boolean; + bottom?: boolean; + left?: boolean; + right?: boolean; +} + +export interface EaseOption { + swipe?: { + style: string; + fn: (t: number) => number; + }; + swipeBounce?: { + style: string; + fn: (t: number) => number; + }; + bounce?: { + style: string; + fn: (t: number) => number; + }; +} + +export interface BsOption { + startX: number; + startY: number; + scrollX: boolean; + scrollY: boolean; + freeScroll: boolean; + directionLockThreshold: number; + eventPassthrough: string | boolean; + click: boolean; + tap: boolean; + bounce: boolean | BounceObjectOption; + bounceTime: number; + momentum: boolean; + momentumLimitTime: number; + momentumLimitDistance: number; + swipeTime: number; + swipeBounceTime: number; + deceleration: number; + flickLimitTime: number; + flickLimitDistance: number; + resizePolling: number; + probeType: number; + preventDefault: boolean; + preventDefaultException: object; + HWCompositing: boolean; + useTransition: boolean; + useTransform: boolean; + bindToWrapper: boolean; + disableMouse: boolean; + disableTouch: boolean; + observeDOM: boolean; + autoBlur: boolean; + stopPropagation: boolean; + /** + * for picker + * wheel: { + * selectedIndex: 0, + * rotate: 25, + * adjustTime: 400 + * } + */ + wheel: Partial | boolean; + /** + * for slide + * snap: { + * loop: boolean, + * el: domEl, + * threshold: 0.1, + * stepX: 100, + * stepY: 100, + * listenFlick: true + * } + */ + snap: Partial | boolean; + /** + * for scrollbar + * scrollbar: { + * fade: true + * } + */ + scrollbar: Partial | boolean; + /** + * for pull down and refresh + * pullDownRefresh: { + * threshold: 50, + * stop: 20 + * } + */ + pullDownRefresh: Partial | boolean; + /** + * for pull up and load + * pullUpLoad: { + * threshold: 50 + * } + */ + pullUpLoad: Partial | boolean; +} + +export interface Position { + x: number; + y: number; +} + +export default class BScroll { + constructor(element: Element | string, options?: Partial); + + x: number; + y: number; + maxScrollX: number; + maxScrollY: number; + movingDirectionX: number; + movingDirectionY: number; + directionX: number; + directionY: number; + enabled: boolean; + isInTransition: boolean; + isAnimating: boolean; + options: BsOption; + + refresh(): void; + + enable(): void; + + disable(): void; + + scrollBy(x: number, y: number, time?: number, easing?: object): void; + + scrollTo(x: number, y: number, time?: number, easing?: object): void; + + scrollToElement(el: HTMLElement | string, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: object): void; + + stop(): void; + + destroy(): void; + + goToPage(x: number, y: number, time?: number, easing?: object): void; + + next(time?: number, easing?: object): void; + + prev(time?: number, easing?: object): void; + + getCurrentPage(): PageOption; + + wheelTo(index: number): void; + + getSelectedIndex(): number; + + finishPullDown(): void; + + finishPullUp(): void; + + on( + type: + 'beforeScrollStart' | + 'scrollStart' | + 'scrollCancel' | + 'beforeScrollStart' | + 'flick' | + 'refresh' | + 'destroy' | + 'pullingDown' | + 'pullingUp', + fn: () => any + ): void; + + on( + type: + 'scroll' | + 'scrollEnd' | + 'touchEnd', + fn: (pos: Position) => any + ): void; + + off( + type: + 'beforeScrollStart' | + 'scrollStart' | + 'scroll' | + 'scrollCancel' | + 'beforeScrollStart' | + 'scrollEnd' | + 'touchEnd' | + 'flick' | + 'refresh' | + 'destroy' | + 'pullingDown' | + 'pullingUp', + fn: (...args: any[]) => void + ): void; + + trigger(type: string): void; +} diff --git a/types/better-scroll/tsconfig.json b/types/better-scroll/tsconfig.json new file mode 100644 index 0000000000..26f43ee3bd --- /dev/null +++ b/types/better-scroll/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "better-scroll-tests.ts" + ] +} diff --git a/types/better-scroll/tslint.json b/types/better-scroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/better-scroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9963d9aed650243d24e6a3cf6ab5a4d2e44d203a Mon Sep 17 00:00:00 2001 From: Nicholas Pappagalo Date: Sat, 11 Aug 2018 11:43:32 -0700 Subject: [PATCH 137/346] enable transformValue to take a parameter --- types/styled-system/dist/util.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/styled-system/dist/util.d.ts b/types/styled-system/dist/util.d.ts index f91b2b6620..ae90de60f8 100644 --- a/types/styled-system/dist/util.d.ts +++ b/types/styled-system/dist/util.d.ts @@ -19,7 +19,7 @@ export interface LowLevelStylefunctionArguments { cssProperty?: string; key?: string; getter?: () => any; - transformValue?: () => any; + transformValue?: (n: string|number) => any; scale?: Array; } From 9bfe9a148c26cd2bcaf7d1e1c356e2b08bfdbfc6 Mon Sep 17 00:00:00 2001 From: Nicholas Pappagalo Date: Sat, 11 Aug 2018 12:11:15 -0700 Subject: [PATCH 138/346] add self to definitions by section of package header --- types/styled-system/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index d9c386242c..38cda70448 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -7,6 +7,7 @@ // Eloy Durán // Matthieu Vachon // Adam Lavin +// Nicholas Pappagalo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 From a09e943aad6944410c388789981f5a16561b691b Mon Sep 17 00:00:00 2001 From: nju33 Date: Sun, 12 Aug 2018 04:20:29 +0900 Subject: [PATCH 139/346] add type definitions for nanoevents --- types/nanoevents/index.d.ts | 14 ++++++++++++++ types/nanoevents/nanoevents-tests.ts | 8 ++++++++ types/nanoevents/tsconfig.json | 24 ++++++++++++++++++++++++ types/nanoevents/tslint.json | 1 + types/nanoevents/unbind-all.d.ts | 5 +++++ 5 files changed, 52 insertions(+) create mode 100644 types/nanoevents/index.d.ts create mode 100644 types/nanoevents/nanoevents-tests.ts create mode 100644 types/nanoevents/tsconfig.json create mode 100644 types/nanoevents/tslint.json create mode 100644 types/nanoevents/unbind-all.d.ts diff --git a/types/nanoevents/index.d.ts b/types/nanoevents/index.d.ts new file mode 100644 index 0000000000..0da2f0add3 --- /dev/null +++ b/types/nanoevents/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for nanoevents 1.0 +// Project: https://github.com/ai/nanoevents#readme +// Definitions by: nju33 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function unbind(): void; + +declare class NanoEvents { + on(name: U, callBack: (arg: T[U]) => any): typeof unbind; + emit(name: U, value: T[U]): void; +} + +export = NanoEvents; diff --git a/types/nanoevents/nanoevents-tests.ts b/types/nanoevents/nanoevents-tests.ts new file mode 100644 index 0000000000..7e6eaa8cd8 --- /dev/null +++ b/types/nanoevents/nanoevents-tests.ts @@ -0,0 +1,8 @@ +import NanoEvents = require('nanoevents'); +import unbindAll = require('nanoevents/unbind-all'); + +const emitter = new NanoEvents<{foo: {foo: string}, bar: {bar: string}}>(); +const unbind = emitter.on('foo', action => action.foo); +emitter.emit('bar', {bar: 'test'}); +unbind(); +unbindAll(emitter); diff --git a/types/nanoevents/tsconfig.json b/types/nanoevents/tsconfig.json new file mode 100644 index 0000000000..d3291ed1d9 --- /dev/null +++ b/types/nanoevents/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nanoevents-tests.ts", + "unbind-all.d.ts" + ] +} diff --git a/types/nanoevents/tslint.json b/types/nanoevents/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/nanoevents/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/nanoevents/unbind-all.d.ts b/types/nanoevents/unbind-all.d.ts new file mode 100644 index 0000000000..1f5662e493 --- /dev/null +++ b/types/nanoevents/unbind-all.d.ts @@ -0,0 +1,5 @@ +import NanoEmitter = require('.'); + +declare function unbindAll(emitter: NanoEmitter): void; + +export = unbindAll; From 6fd3f6882094c7230a4b5ff2b60d43cc765c2a07 Mon Sep 17 00:00:00 2001 From: DimaMukhin Date: Sat, 11 Aug 2018 17:39:38 -0700 Subject: [PATCH 140/346] added type definitions for koa-redis-cache --- types/koa-redis-cache/index.d.ts | 93 +++++++++++++++++++ .../koa-redis-cache/koa-redis-cache-tests.ts | 34 +++++++ types/koa-redis-cache/tsconfig.json | 22 +++++ types/koa-redis-cache/tslint.json | 1 + 4 files changed, 150 insertions(+) create mode 100644 types/koa-redis-cache/index.d.ts create mode 100644 types/koa-redis-cache/koa-redis-cache-tests.ts create mode 100644 types/koa-redis-cache/tsconfig.json create mode 100644 types/koa-redis-cache/tslint.json diff --git a/types/koa-redis-cache/index.d.ts b/types/koa-redis-cache/index.d.ts new file mode 100644 index 0000000000..2d983f862d --- /dev/null +++ b/types/koa-redis-cache/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for koa-redis-cache 3.0.1 +// Project: https://github.com/coderhaoxin/koa-redis-cache +// Definitions by: Dima Mukhin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as Koa from "koa"; +import * as Redis from "redis"; + +type onErrorCallback = (error: Error) => void; + +type getPrefixCallback = (ctx: Koa.Context) => String; + +declare namespace cache { + interface CacheOptions { + /** + * redis key prefix, default is koa-redis-cache: + * If a function is supplied, its signature should be function(ctx) {} and it should return a string to use as the redis key prefix + */ + prefix?: String | getPrefixCallback; + + /** + * redis expire time (second), default is 30 * 60 (30 min) + */ + expire?: Number; + + /** + * if the passParam exists in the query string, skip the cache + */ + passParam?: String; + + /** + * max length of body size (in bytes) to cache. + * if the size of the body exceeds maxLength, the body will not be cached. + * default is: Infinity + */ + maxLength?: Number; + + /** + * the routes to cache, default is ['(.*)']. + * can be set to an array of routes (String), or an array of RouteOptions + */ + routes?: Array | Array; + + /** + * the routes to exclude, default is []. + * example: ['/api/(.*)', '/view/:id'] + */ + exclude?: Array; + + /** + * callback function for error, default is function() {} + */ + onerror?: onErrorCallback; + + /** + * redis options + */ + redis?: RedisOptions; + } + + interface RouteOptions { + /** + * the route to cache, example: '/api/(.*)' + */ + route: String; + + /** + * expiration time in seconds for cached responses for the route + */ + expire?: Number; + } + + interface RedisOptions { + /** + * host name of the redis server, default: 'localhost' + */ + host?: String, + + /** + * port number of the redis server, default: 6379 + */ + port?: Number, + + /** + * node_redis options + */ + options?: Redis.ClientOpts + } +} + +declare function cache(opts?: cache.CacheOptions): Koa.Middleware; + +export = cache; diff --git a/types/koa-redis-cache/koa-redis-cache-tests.ts b/types/koa-redis-cache/koa-redis-cache-tests.ts new file mode 100644 index 0000000000..9c5f528ba7 --- /dev/null +++ b/types/koa-redis-cache/koa-redis-cache-tests.ts @@ -0,0 +1,34 @@ +import * as Koa from "koa"; +import * as cache from 'koa-redis-cache'; + +const app = new Koa(); + +const routeOptions: Array = [ + { + route: '/api/test', + expire: 60 + }, + { + route: '/api/users' + } +]; + +const redisOptions: cache.RedisOptions = { + port: 6379, + host: 'localhost' +}; + +const options: cache.CacheOptions = { + prefix: (ctx: Koa.Context) => 'koa-redis-cache:', + expire: 30 * 30, + passParam: 'skip', + maxLength: 1024, + routes: routeOptions, + exclude: ['/api/(.*)', '/view/:id'], + onerror: (error: Error) => console.log(error), + redis: redisOptions +}; + +app.use(cache(options)); + +app.listen(80); diff --git a/types/koa-redis-cache/tsconfig.json b/types/koa-redis-cache/tsconfig.json new file mode 100644 index 0000000000..dbf782ccae --- /dev/null +++ b/types/koa-redis-cache/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-redis-cache-tests.ts" + ] +} \ No newline at end of file diff --git a/types/koa-redis-cache/tslint.json b/types/koa-redis-cache/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-redis-cache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 748a58c8d2f69ee002cc00f6554e6af0abf826ef Mon Sep 17 00:00:00 2001 From: Zlatkovsky Date: Sat, 11 Aug 2018 17:57:11 -0700 Subject: [PATCH 141/346] Update Office.js d.ts based on latest sources of codegen truth and slight tweaks --- types/office-js/index.d.ts | 995 ++++++++++++++++++++++++------------- 1 file changed, 662 insertions(+), 333 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index f3bd6b3681..3a40742a68 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -15817,25 +15817,24 @@ declare namespace Excel { */ function run(options: Excel.RunOptions, batch: (context: Excel.RequestContext) => Promise): Promise; /** - * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. - * - * @remarks - * - * In addition to this signature, the method also has the following signatures: - * - * `run(object: OfficeExtension.ClientObject, batch: (context: Excel.RequestContext) => Promise): Promise;` - * - * `run(objects: OfficeExtension.ClientObject[], batch: (context: Excel.RequestContext) => Promise): Promise;` - * - * `run(options: Excel.RunOptions, batch: (context: Excel.RequestContext) => Promise): Promise;` - * - * `run(batch: (context: Excel.RequestContext) => Promise): Promise;` - * - * @param context - A previously-created object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". - * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. - */ - function run(context: OfficeExtension.ClientRequestContext, batch: (context: Excel.RequestContext) => Promise): Promise; - function createWorkbook(base64?: string): Promise; + * Executes a batch script that performs actions on the Excel object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. + * + * @remarks + * + * In addition to this signature, the method also has the following signatures: + * + * `run(object: OfficeExtension.ClientObject, batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * `run(objects: OfficeExtension.ClientObject[], batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * `run(options: Excel.RunOptions, batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * `run(batch: (context: Excel.RequestContext) => Promise): Promise;` + * + * @param context - A previously-created object. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()". + * @param batch - A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Excel application. Since the Office add-in and the Excel application run in two different processes, the RequestContext is required to get access to the Excel object model from the add-in. + */ + function run(context: OfficeExtension.ClientRequestContext, batch: (context: Excel.RequestContext) => Promise): Promise; /** * * Provides information about the binding that raised the SelectionChanged event. @@ -16434,7 +16433,7 @@ declare namespace Excel { getActiveCell(): Excel.Range; /** * - * Gets the currently selected range from the workbook. + * Gets the currently selected single range from the workbook. If there are multiple ranges selected, this method will throw an error. * * [Api set: ExcelApi 1.1] */ @@ -16732,11 +16731,11 @@ declare namespace Excel { getPreviousOrNullObject(visibleOnly?: boolean): Excel.Worksheet; /** * - * Gets the range object specified by the address or name. + * Gets the range object, representing a single rectangular block of cells, specified by the address or name. * * [Api set: ExcelApi 1.1] * - * @param address Optional. The address or the name of the range. If not specified, the entire worksheet range is returned. + * @param address Optional. The string representing the address or name of the range. For example, "A1:B2". If not specified, the entire worksheet range is returned. */ getRange(address?: string): Excel.Range; /** @@ -17220,7 +17219,7 @@ declare namespace Excel { readonly worksheet: Excel.Worksheet; /** * - * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. Sheet1!A1:B4). Read-only. + * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). Read-only. * * [Api set: ExcelApi 1.1] */ @@ -17449,7 +17448,7 @@ declare namespace Excel { getAbsoluteResizedRange(numRows: number, numColumns: number): Excel.Range; /** * - * Gets the smallest range object that encompasses the given ranges. For example, the GetBoundingRect of "B2:C5" and "D10:E15" is "B2:E16". + * Gets the smallest range object that encompasses the given ranges. For example, the GetBoundingRect of "B2:C5" and "D10:E15" is "B2:E15". * * [Api set: ExcelApi 1.1] * @@ -17662,7 +17661,6 @@ declare namespace Excel { /** * * Selects the specified range in the Excel UI. - If true, a multi-area range can be selected; otherwise, only the first area will be selected. Default is false. * * [Api set: ExcelApi 1.1] */ @@ -19073,10 +19071,10 @@ declare namespace Excel { * * Represents a collection of all the rows that are part of the table. - Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, - a TableRow object represent the physical location of the table row, but not the data. - That is, if the data is sorted or if new rows are added, a table row will continue - to point at the index for which it was created. + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, + a TableRow object represent the physical location of the table row, but not the data. + That is, if the data is sorted or if new rows are added, a table row will continue + to point at the index for which it was created. * * [Api set: ExcelApi 1.1] */ @@ -19094,10 +19092,10 @@ declare namespace Excel { * * Adds one or more rows to the table. The return object will be the top of the newly added row(s). - Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, - a TableRow object represent the physical location of the table row, but not the data. - That is, if the data is sorted or if new rows are added, a table row will continue - to point at the index for which it was created. + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, + a TableRow object represent the physical location of the table row, but not the data. + That is, if the data is sorted or if new rows are added, a table row will continue + to point at the index for which it was created. * * [Api set: ExcelApi 1.1 for adding a single row; 1.4 allows adding of multiple rows.] * @@ -19116,10 +19114,10 @@ declare namespace Excel { * * Gets a row based on its position in the collection. - Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, - a TableRow object represent the physical location of the table row, but not the data. - That is, if the data is sorted or if new rows are added, a table row will continue - to point at the index for which it was created. + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, + a TableRow object represent the physical location of the table row, but not the data. + That is, if the data is sorted or if new rows are added, a table row will continue + to point at the index for which it was created. * * [Api set: ExcelApi 1.1] * @@ -19150,10 +19148,10 @@ declare namespace Excel { * * Represents a row in a table. - Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, - a TableRow object represent the physical location of the table row, but not the data. - That is, if the data is sorted or if new rows are added, a table row will continue - to point at the index for which it was created. + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, + a TableRow object represent the physical location of the table row, but not the data. + That is, if the data is sorted or if new rows are added, a table row will continue + to point at the index for which it was created. * * [Api set: ExcelApi 1.1] */ @@ -19747,7 +19745,7 @@ declare namespace Excel { * @param sourceData The Range object corresponding to the source data. * @param seriesBy Optional. Specifies the way columns or rows are used as data series on the chart. See Excel.ChartSeriesBy for details. */ - add(type: "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap", sourceData: Range, seriesBy?: "Auto" | "Columns" | "Rows"): Excel.Chart; + add(type: "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel", sourceData: Range, seriesBy?: "Auto" | "Columns" | "Rows"): Excel.Chart; /** * * Returns the number of charts in the worksheet. @@ -19865,7 +19863,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.7] */ - chartType: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap"; + chartType: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"; /** * * Represents the height, in points, of the chart object. @@ -19966,7 +19964,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.1] * - * @param sourceData The range corresponding to the source data. + * @param sourceData The range object corresponding to the source data. * @param seriesBy Specifies the way columns or rows are used as data series on the chart. Can be one of the following: Auto (default), Rows, and Columns. See Excel.ChartSeriesBy for details. */ setData(sourceData: Range, seriesBy?: Excel.ChartSeriesBy): void; @@ -19976,7 +19974,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.1] * - * @param sourceData The range corresponding to the source data. + * @param sourceData The range object corresponding to the source data. * @param seriesBy Specifies the way columns or rows are used as data series on the chart. Can be one of the following: Auto (default), Rows, and Columns. See Excel.ChartSeriesBy for details. */ setData(sourceData: Range, seriesBy?: "Auto" | "Columns" | "Rows"): void; @@ -20174,7 +20172,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.7] */ - chartType: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap"; + chartType: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"; /** * * Represents the doughnut hole size of a chart series. Only valid on doughnut and doughnutExploded charts. @@ -23832,14 +23830,14 @@ declare namespace Excel { delete(): void; /** * - * Returns the range the conditonal format is applied to. Read-only. + * Returns the range the conditonal format is applied to. Throws an error if the conditional format is applied to multiple ranges. Read-only. * * [Api set: ExcelApi 1.6] */ getRange(): Excel.Range; /** * - * Returns the range the conditonal format is applied to or a null object if the range is discontiguous. Read-only. + * Returns the range the conditonal format is applied to, or a null object if the conditional format is applied to multiple ranges. Read-only. * * [Api set: ExcelApi 1.6] */ @@ -26521,7 +26519,7 @@ declare namespace Excel { worksheetCalculated = "WorksheetCalculated", /** * - * ChartActivated represents the type of event registered on Chart or ChartCollection, and occurs when chart activates. + * VisualSelectionChanged represents the type of event registered on VisualCollection, and occurs when visual selection changes. * */ visualSelectionChanged = "VisualSelectionChanged", @@ -31102,7 +31100,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.7] */ - chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap"; + chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"; /** * * Represents the height, in points, of the chart object. @@ -31182,7 +31180,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.7] */ - chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap"; + chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"; /** * * Represents the doughnut hole size of a chart series. Only valid on doughnut and doughnutExploded charts. @@ -33120,7 +33118,7 @@ declare namespace Excel { worksheet?: Excel.Interfaces.WorksheetData; /** * - * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. Sheet1!A1:B4). Read-only. + * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). Read-only. * * [Api set: ExcelApi 1.1] */ @@ -33939,7 +33937,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.7] */ - chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap"; + chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"; /** * * Represents the height, in points, of the chart object. @@ -34040,7 +34038,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.7] */ - chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap"; + chartType?: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"; /** * * Represents the doughnut hole size of a chart series. Only valid on doughnut and doughnutExploded charts. @@ -36251,7 +36249,7 @@ declare namespace Excel { worksheet?: Excel.Interfaces.WorksheetLoadOptions; /** * - * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. Sheet1!A1:B4). Read-only. + * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). Read-only. * * [Api set: ExcelApi 1.1] */ @@ -36294,7 +36292,7 @@ declare namespace Excel { /** * * Represents the formula in A1-style notation. - When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. + When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. * * [Api set: ExcelApi 1.1] */ @@ -36302,7 +36300,7 @@ declare namespace Excel { /** * * Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German. - When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. + When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. * * [Api set: ExcelApi 1.1] */ @@ -36310,7 +36308,7 @@ declare namespace Excel { /** * * Represents the formula in R1C1-style notation. - When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. + When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. * * [Api set: ExcelApi 1.2] */ @@ -36346,7 +36344,7 @@ declare namespace Excel { /** * * Represents Excel's number format code for the given range. - When setting number format to a range, the value argument can be either a single value (string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. + When setting number format to a range, the value argument can be either a single value (string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. * * [Api set: ExcelApi 1.1] */ @@ -36354,7 +36352,7 @@ declare namespace Excel { /** * * Represents Excel's number format code for the given range as a string in the language of the user. - When setting number format local to a range, the value argument can be either a single value (string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. + When setting number format local to a range, the value argument can be either a single value (string) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. * * [Api set: ExcelApi 1.7] */ @@ -36383,8 +36381,8 @@ declare namespace Excel { /** * * Represents the style of the current range. - If the styles of the cells are inconsistent, null will be returned. - For custom styles, the style name will be returned. For built-in styles, a string representing a value in the BuiltInStyle enum will be returned. + If the styles of the cells are inconsistent, null will be returned. + For custom styles, the style name will be returned. For built-in styles, a string representing a value in the BuiltInStyle enum will be returned. * * [Api set: ExcelApi 1.7] */ @@ -36406,7 +36404,7 @@ declare namespace Excel { /** * * Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string. - When setting values to a range, the value argument can be either a single value (string, number or boolean) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. + When setting values to a range, the value argument can be either a single value (string, number or boolean) or a two-dimensional array. If the argument is a single value, it will be applied to all cells in the range. * * [Api set: ExcelApi 1.1] */ @@ -37162,11 +37160,11 @@ declare namespace Excel { /** * * Represents a collection of all the rows that are part of the table. - - Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, - a TableRow object represent the physical location of the table row, but not the data. - That is, if the data is sorted or if new rows are added, a table row will continue - to point at the index for which it was created. + + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, + a TableRow object represent the physical location of the table row, but not the data. + That is, if the data is sorted or if new rows are added, a table row will continue + to point at the index for which it was created. * * [Api set: ExcelApi 1.1] */ @@ -37190,11 +37188,11 @@ declare namespace Excel { /** * * Represents a row in a table. - - Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, - a TableRow object represent the physical location of the table row, but not the data. - That is, if the data is sorted or if new rows are added, a table row will continue - to point at the index for which it was created. + + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, + a TableRow object represent the physical location of the table row, but not the data. + That is, if the data is sorted or if new rows are added, a table row will continue + to point at the index for which it was created. * * [Api set: ExcelApi 1.1] */ @@ -37275,8 +37273,8 @@ declare namespace Excel { /** * * Gets or sets the text orientation of all the cells within the range. - The text orientation should be an integer either from -90 to 90, or 180 for vertically-oriented text. - If the orientation within a range are not uniform, then null will be returned. + The text orientation should be an integer either from -90 to 90, or 180 for vertically-oriented text. + If the orientation within a range are not uniform, then null will be returned. * * [Api set: ExcelApi 1.7] */ @@ -37284,9 +37282,9 @@ declare namespace Excel { /** * * Determines if the row height of the Range object equals the standard height of the sheet. - Returns True if the row height of the Range object equals the standard height of the sheet. - Returns Null if the range contains more than one row and the rows aren't all the same height. - Returns False otherwise. + Returns True if the row height of the Range object equals the standard height of the sheet. + Returns Null if the range contains more than one row and the rows aren't all the same height. + Returns False otherwise. * * [Api set: ExcelApi 1.7] */ @@ -37294,9 +37292,9 @@ declare namespace Excel { /** * * Indicates whether the column width of the Range object equals the standard width of the sheet. - Returns True if the column width of the Range object equals the standard width of the sheet. - Returns Null if the range contains more than one column and the columns aren't all the same height. - Returns False otherwise. + Returns True if the column width of the Range object equals the standard width of the sheet. + Returns Null if the range contains more than one column and the columns aren't all the same height. + Returns False otherwise. * * [Api set: ExcelApi 1.7] */ @@ -37763,7 +37761,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Represents the doughnut hole size of a chart series. Only valid on doughnut and doughnutExploded charts. - Throws an invalid argument exception on invalid charts. + Throws an invalid argument exception on invalid charts. * * [Api set: ExcelApi 1.7] */ @@ -37778,7 +37776,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Represents the gap width of a chart series. Only valid on bar and column charts, as well as - specific classes of line and pie charts. Throws an invalid argument exception on invalid charts. + specific classes of line and pie charts. Throws an invalid argument exception on invalid charts. * * [Api set: ExcelApi 1.7] */ @@ -37879,7 +37877,7 @@ declare namespace Excel { /** * * Represents the doughnut hole size of a chart series. Only valid on doughnut and doughnutExploded charts. - Throws an invalid argument exception on invalid charts. + Throws an invalid argument exception on invalid charts. * * [Api set: ExcelApi 1.7] */ @@ -37894,7 +37892,7 @@ declare namespace Excel { /** * * Represents the gap width of a chart series. Only valid on bar and column charts, as well as - specific classes of line and pie charts. Throws an invalid argument exception on invalid charts. + specific classes of line and pie charts. Throws an invalid argument exception on invalid charts. * * [Api set: ExcelApi 1.7] */ @@ -39186,8 +39184,8 @@ declare namespace Excel { /** * * A scoped collection of custom XML parts. - A scoped collection is the result of some operation, e.g. filtering by namespace. - A scoped collection cannot be scoped any further. + A scoped collection is the result of some operation, e.g. filtering by namespace. + A scoped collection cannot be scoped any further. * * [Api set: ExcelApi 1.5] */ @@ -39471,7 +39469,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Returns the cell value conditional format properties if the current conditional format is a CellValue type. - For example to format all cells between 5 and 10. + For example to format all cells between 5 and 10. * * [Api set: ExcelApi 1.6] */ @@ -39479,7 +39477,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Returns the cell value conditional format properties if the current conditional format is a CellValue type. - For example to format all cells between 5 and 10. + For example to format all cells between 5 and 10. * * [Api set: ExcelApi 1.6] */ @@ -39557,7 +39555,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Returns the specific text conditional format properties if the current conditional format is a text type. - For example to format cells matching the word "Text". + For example to format cells matching the word "Text". * * [Api set: ExcelApi 1.6] */ @@ -39565,7 +39563,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Returns the specific text conditional format properties if the current conditional format is a text type. - For example to format cells matching the word "Text". + For example to format cells matching the word "Text". * * [Api set: ExcelApi 1.6] */ @@ -39573,7 +39571,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Returns the Top/Bottom conditional format properties if the current conditional format is an TopBottom type. - For example to format the top 10% or bottom 10 items. + For example to format the top 10% or bottom 10 items. * * [Api set: ExcelApi 1.6] */ @@ -39581,7 +39579,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: Returns the Top/Bottom conditional format properties if the current conditional format is an TopBottom type. - For example to format the top 10% or bottom 10 items. + For example to format the top 10% or bottom 10 items. * * [Api set: ExcelApi 1.6] */ @@ -39596,10 +39594,10 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: The priority (or index) within the conditional format collection that this conditional format currently exists in. Changing this also - changes other conditional formats' priorities, to allow for a contiguous priority order. - Use a negative priority to begin from the back. - Priorities greater than than bounds will get and set to the maximum (or minimum if negative) priority. - Also note that if you change the priority, you have to re-fetch a new copy of the object at that new priority location if you want to make further changes to it. Read-only. + changes other conditional formats' priorities, to allow for a contiguous priority order. + Use a negative priority to begin from the back. + Priorities greater than than bounds will get and set to the maximum (or minimum if negative) priority. + Also note that if you change the priority, you have to re-fetch a new copy of the object at that new priority location if you want to make further changes to it. Read-only. * * [Api set: ExcelApi 1.6] */ @@ -39607,7 +39605,7 @@ declare namespace Excel { /** * * For EACH ITEM in the collection: If the conditions of this conditional format are met, no lower-priority formats shall take effect on that cell. - Null on databars, icon sets, and colorscales as there's no concept of StopIfTrue for these + Null on databars, icon sets, and colorscales as there's no concept of StopIfTrue for these * * [Api set: ExcelApi 1.6] */ @@ -39631,7 +39629,7 @@ declare namespace Excel { /** * * Returns the cell value conditional format properties if the current conditional format is a CellValue type. - For example to format all cells between 5 and 10. + For example to format all cells between 5 and 10. * * [Api set: ExcelApi 1.6] */ @@ -39639,7 +39637,7 @@ declare namespace Excel { /** * * Returns the cell value conditional format properties if the current conditional format is a CellValue type. - For example to format all cells between 5 and 10. + For example to format all cells between 5 and 10. * * [Api set: ExcelApi 1.6] */ @@ -39717,7 +39715,7 @@ declare namespace Excel { /** * * Returns the specific text conditional format properties if the current conditional format is a text type. - For example to format cells matching the word "Text". + For example to format cells matching the word "Text". * * [Api set: ExcelApi 1.6] */ @@ -39725,7 +39723,7 @@ declare namespace Excel { /** * * Returns the specific text conditional format properties if the current conditional format is a text type. - For example to format cells matching the word "Text". + For example to format cells matching the word "Text". * * [Api set: ExcelApi 1.6] */ @@ -39733,7 +39731,7 @@ declare namespace Excel { /** * * Returns the Top/Bottom conditional format properties if the current conditional format is an TopBottom type. - For example to format the top 10% or bottom 10 items. + For example to format the top 10% or bottom 10 items. * * [Api set: ExcelApi 1.6] */ @@ -39741,7 +39739,7 @@ declare namespace Excel { /** * * Returns the Top/Bottom conditional format properties if the current conditional format is an TopBottom type. - For example to format the top 10% or bottom 10 items. + For example to format the top 10% or bottom 10 items. * * [Api set: ExcelApi 1.6] */ @@ -39756,10 +39754,10 @@ declare namespace Excel { /** * * The priority (or index) within the conditional format collection that this conditional format currently exists in. Changing this also - changes other conditional formats' priorities, to allow for a contiguous priority order. - Use a negative priority to begin from the back. - Priorities greater than than bounds will get and set to the maximum (or minimum if negative) priority. - Also note that if you change the priority, you have to re-fetch a new copy of the object at that new priority location if you want to make further changes to it. Read-only. + changes other conditional formats' priorities, to allow for a contiguous priority order. + Use a negative priority to begin from the back. + Priorities greater than than bounds will get and set to the maximum (or minimum if negative) priority. + Also note that if you change the priority, you have to re-fetch a new copy of the object at that new priority location if you want to make further changes to it. Read-only. * * [Api set: ExcelApi 1.6] */ @@ -39767,7 +39765,7 @@ declare namespace Excel { /** * * If the conditions of this conditional format are met, no lower-priority formats shall take effect on that cell. - Null on databars, icon sets, and colorscales as there's no concept of StopIfTrue for these + Null on databars, icon sets, and colorscales as there's no concept of StopIfTrue for these * * [Api set: ExcelApi 1.6] */ @@ -39805,7 +39803,7 @@ declare namespace Excel { /** * * HTML color code representing the color of the Axis line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). - "" (empty string) if no axis is present or set. + "" (empty string) if no axis is present or set. * * [Api set: ExcelApi 1.6] */ @@ -39857,7 +39855,7 @@ declare namespace Excel { /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). - "" (empty string) if no border is present or set. + "" (empty string) if no border is present or set. * * [Api set: ExcelApi 1.6] */ @@ -39888,7 +39886,7 @@ declare namespace Excel { /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). - "Empty String" if no border is present or set. + "Empty String" if no border is present or set. * * [Api set: ExcelApi 1.6] */ @@ -40776,10 +40774,20 @@ declare namespace Word { * [Api set: WordApi 1.3] */ readonly type: Word.BodyType | "Unknown" | "MainDoc" | "Section" | "Header" | "Footer" | "TableCell"; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Body): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.BodyUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Body): void; + set(properties: Word.Body): void; /** * * Clears the contents of the body object. The user can perform the undo operation on the cleared content. @@ -40996,7 +41004,7 @@ declare namespace Word { * * [Api set: WordApi 1.1] * - * @param searchText Required. The search text. + * @param searchText Required. The search text. Can be a maximum of 255 characters. * @param searchOptions Optional. Options for the search. */ search(searchText: string, searchOptions?: Word.SearchOptions | { @@ -41028,6 +41036,18 @@ declare namespace Word { select(selectionMode?: "Select" | "Start" | "End"): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Body` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Body` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Body` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.BodyLoadOptions): Word.Body; load(option?: string | string[]): Word.Body; @@ -41241,10 +41261,20 @@ declare namespace Word { * [Api set: WordApi 1.1] */ readonly type: Word.ContentControlType | "Unknown" | "RichTextInline" | "RichTextParagraphs" | "RichTextTableCell" | "RichTextTableRow" | "RichTextTable" | "PlainTextInline" | "PlainTextParagraph" | "Picture" | "BuildingBlockGallery" | "CheckBox" | "ComboBox" | "DropDownList" | "DatePicker" | "RepeatingSection" | "RichText" | "PlainText"; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.ContentControl): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.ContentControlUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: ContentControl): void; + set(properties: Word.ContentControl): void; /** * * Clears the contents of the content control. The user can perform the undo operation on the cleared content. @@ -41517,6 +41547,18 @@ declare namespace Word { split(delimiters: string[], multiParagraphs?: boolean, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.ContentControl` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.ContentControl` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.ContentControl` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ContentControlLoadOptions): Word.ContentControl; load(option?: string | string[]): Word.ContentControl; @@ -41613,6 +41655,18 @@ declare namespace Word { getItem(index: number): Word.ContentControl; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.ContentControlCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.ContentControlCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.ContentControlCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ContentControlCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.ContentControlCollection; load(option?: string | string[]): Word.ContentControlCollection; @@ -41655,10 +41709,20 @@ declare namespace Word { * [Api set: WordApi 1.3] */ value: any; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.CustomProperty): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.CustomPropertyUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: CustomProperty): void; + set(properties: Word.CustomProperty): void; /** * * Deletes the custom property. @@ -41668,6 +41732,18 @@ declare namespace Word { delete(): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.CustomProperty` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.CustomProperty` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.CustomProperty` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.CustomPropertyLoadOptions): Word.CustomProperty; load(option?: string | string[]): Word.CustomProperty; @@ -41738,6 +41814,18 @@ declare namespace Word { getItemOrNullObject(key: string): Word.CustomProperty; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.CustomPropertyCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.CustomPropertyCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.CustomPropertyCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.CustomPropertyCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.CustomPropertyCollection; load(option?: string | string[]): Word.CustomPropertyCollection; @@ -41794,10 +41882,20 @@ declare namespace Word { * [Api set: WordApi 1.1] */ readonly saved: boolean; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Document): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.DocumentUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Document): void; + set(properties: Word.Document): void; /** * * Gets the current selection of the document. Multiple selections are not supported. @@ -41814,6 +41912,18 @@ declare namespace Word { save(): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Document` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Document` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Document` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.DocumentLoadOptions): Word.Document; load(option?: string | string[]): Word.Document; @@ -41873,10 +41983,20 @@ declare namespace Word { * [Api set: WordApiHiddenDocument 1.3] */ readonly saved: boolean; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.DocumentCreated): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.DocumentCreatedUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: DocumentCreated): void; + set(properties: Word.DocumentCreated): void; /** * * Opens the document. @@ -41893,6 +42013,18 @@ declare namespace Word { save(): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.DocumentCreated` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.DocumentCreated` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.DocumentCreated` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.DocumentCreatedLoadOptions): Word.DocumentCreated; load(option?: string | string[]): Word.DocumentCreated; @@ -42043,12 +42175,34 @@ declare namespace Word { * [Api set: WordApi 1.3] */ title: string; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.DocumentProperties): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.DocumentPropertiesUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: DocumentProperties): void; + set(properties: Word.DocumentProperties): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.DocumentProperties` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.DocumentProperties` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.DocumentProperties` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.DocumentPropertiesLoadOptions): Word.DocumentProperties; load(option?: string | string[]): Word.DocumentProperties; @@ -42150,12 +42304,34 @@ declare namespace Word { * [Api set: WordApi 1.1] */ underline: Word.UnderlineType | "Mixed" | "None" | "Hidden" | "DotLine" | "Single" | "Word" | "Double" | "Thick" | "Dotted" | "DottedHeavy" | "DashLine" | "DashLineHeavy" | "DashLineLong" | "DashLineLongHeavy" | "DotDashLine" | "DotDashLineHeavy" | "TwoDotDashLine" | "TwoDotDashLineHeavy" | "Wave" | "WaveHeavy" | "WaveDouble"; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Font): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.FontUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Font): void; + set(properties: Word.Font): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Font` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Font` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Font` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.FontLoadOptions): Word.Font; load(option?: string | string[]): Word.Font; @@ -42271,10 +42447,20 @@ declare namespace Word { * [Api set: WordApi 1.1] */ width: number; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.InlinePicture): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.InlinePictureUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: InlinePicture): void; + set(properties: Word.InlinePicture): void; /** * * Deletes the inline picture from the document. @@ -42488,6 +42674,18 @@ declare namespace Word { select(selectionMode?: "Select" | "Start" | "End"): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.InlinePicture` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.InlinePicture` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.InlinePicture` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.InlinePictureLoadOptions): Word.InlinePicture; load(option?: string | string[]): Word.InlinePicture; @@ -42530,6 +42728,18 @@ declare namespace Word { getFirstOrNullObject(): Word.InlinePicture; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.InlinePictureCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.InlinePictureCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.InlinePictureCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.InlinePictureCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.InlinePictureCollection; load(option?: string | string[]): Word.InlinePictureCollection; @@ -42706,6 +42916,18 @@ declare namespace Word { setLevelStartingNumber(level: number, startingNumber: number): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.List` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.List` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.List` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ListLoadOptions): Word.List; load(option?: string | string[]): Word.List; @@ -42775,6 +42997,18 @@ declare namespace Word { getItem(index: number): Word.List; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.ListCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.ListCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.ListCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ListCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.ListCollection; load(option?: string | string[]): Word.ListCollection; @@ -42817,10 +43051,20 @@ declare namespace Word { * [Api set: WordApi 1.3] */ readonly siblingIndex: number; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.ListItem): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.ListItemUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: ListItem): void; + set(properties: Word.ListItem): void; /** * * Gets the list item parent, or the closest ancestor if the parent does not exist. Throws if the list item has no ancestor. @@ -42850,6 +43094,18 @@ declare namespace Word { getDescendants(directChildrenOnly?: boolean): Word.ParagraphCollection; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.ListItem` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.ListItem` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.ListItem` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ListItemLoadOptions): Word.ListItem; load(option?: string | string[]): Word.ListItem; @@ -43084,10 +43340,20 @@ declare namespace Word { * [Api set: WordApi 1.1] */ readonly text: string; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Paragraph): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.ParagraphUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Paragraph): void; + set(properties: Word.Paragraph): void; /** * * Lets the paragraph join an existing list at the specified level. Fails if the paragraph cannot join the list or if the paragraph is already a list item. @@ -43416,6 +43682,18 @@ declare namespace Word { startNewList(): Word.List; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Paragraph` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Paragraph` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Paragraph` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ParagraphLoadOptions): Word.Paragraph; load(option?: string | string[]): Word.Paragraph; @@ -43472,6 +43750,18 @@ declare namespace Word { getLastOrNullObject(): Word.Paragraph; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.ParagraphCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.ParagraphCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.ParagraphCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.ParagraphCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.ParagraphCollection; load(option?: string | string[]): Word.ParagraphCollection; @@ -43619,10 +43909,20 @@ declare namespace Word { * [Api set: WordApi 1.1] */ readonly text: string; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Range): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.RangeUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Range): void; + set(properties: Word.Range): void; /** * * Clears the contents of the range object. The user can perform the undo operation on the cleared content. @@ -43972,6 +44272,18 @@ declare namespace Word { split(delimiters: string[], multiParagraphs?: boolean, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Range` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Range` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Range` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.RangeLoadOptions): Word.Range; load(option?: string | string[]): Word.Range; @@ -44014,6 +44326,18 @@ declare namespace Word { getFirstOrNullObject(): Word.Range; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.RangeCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.RangeCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.RangeCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.RangeCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.RangeCollection; load(option?: string | string[]): Word.RangeCollection; @@ -44085,12 +44409,34 @@ declare namespace Word { * [Api set: WordApi 1.1] */ matchWildcards: boolean; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.SearchOptions): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.SearchOptionsUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: SearchOptions): void; + set(properties: Word.SearchOptions): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.SearchOptions` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.SearchOptions` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.SearchOptions` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.SearchOptionsLoadOptions): Word.SearchOptions; load(option?: string | string[]): Word.SearchOptions; @@ -44118,10 +44464,20 @@ declare namespace Word { * [Api set: WordApi 1.1] */ readonly body: Word.Body; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Section): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.SectionUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Section): void; + set(properties: Word.Section): void; /** * * Gets one of the section's footers. @@ -44174,6 +44530,18 @@ declare namespace Word { getNextOrNullObject(): Word.Section; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Section` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Section` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Section` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.SectionLoadOptions): Word.Section; load(option?: string | string[]): Word.Section; @@ -44216,6 +44584,18 @@ declare namespace Word { getFirstOrNullObject(): Word.Section; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.SectionCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.SectionCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.SectionCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.SectionCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.SectionCollection; load(option?: string | string[]): Word.SectionCollection; @@ -44426,10 +44806,20 @@ declare namespace Word { * [Api set: WordApi 1.3] */ width: number; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.Table): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.TableUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: Table): void; + set(properties: Word.Table): void; /** * * Adds columns to the start or end of the table, using the first or last existing column as a template. This is applicable to uniform tables. The string values, if specified, are set in the newly inserted rows. @@ -44747,6 +45137,18 @@ declare namespace Word { setCellPadding(cellPaddingLocation: "Top" | "Left" | "Bottom" | "Right", cellPadding: number): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.Table` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.Table` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.Table` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableLoadOptions): Word.Table; load(option?: string | string[]): Word.Table; @@ -44789,6 +45191,18 @@ declare namespace Word { getFirstOrNullObject(): Word.Table; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.TableCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.TableCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.TableCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.TableCollection; load(option?: string | string[]): Word.TableCollection; @@ -44887,10 +45301,20 @@ declare namespace Word { * [Api set: WordApi 1.3] */ verticalAlignment: Word.VerticalAlignment | "Mixed" | "Top" | "Center" | "Bottom"; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.TableRow): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.TableRowUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: TableRow): void; + set(properties: Word.TableRow): void; /** * * Clears the contents of the row. @@ -45035,6 +45459,18 @@ declare namespace Word { setCellPadding(cellPaddingLocation: "Top" | "Left" | "Bottom" | "Right", cellPadding: number): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.TableRow` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.TableRow` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.TableRow` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableRowLoadOptions): Word.TableRow; load(option?: string | string[]): Word.TableRow; @@ -45077,6 +45513,18 @@ declare namespace Word { getFirstOrNullObject(): Word.TableRow; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.TableRowCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.TableRowCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.TableRowCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableRowCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.TableRowCollection; load(option?: string | string[]): Word.TableRowCollection; @@ -45175,10 +45623,20 @@ declare namespace Word { * [Api set: WordApi 1.3] */ readonly width: number; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.TableCell): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.TableCellUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: TableCell): void; + set(properties: Word.TableCell): void; /** * * Deletes the column containing this cell. This is applicable to uniform tables. @@ -45309,6 +45767,18 @@ declare namespace Word { setCellPadding(cellPaddingLocation: "Top" | "Left" | "Bottom" | "Right", cellPadding: number): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.TableCell` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.TableCell` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.TableCell` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableCellLoadOptions): Word.TableCell; load(option?: string | string[]): Word.TableCell; @@ -45351,6 +45821,18 @@ declare namespace Word { getFirstOrNullObject(): Word.TableCell; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.TableCellCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.TableCellCollection` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.TableCellCollection` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableCellCollectionLoadOptions & Word.Interfaces.CollectionLoadOptions): Word.TableCellCollection; load(option?: string | string[]): Word.TableCellCollection; @@ -45393,12 +45875,34 @@ declare namespace Word { * [Api set: WordApi 1.3] */ width: number; - /** Sets multiple properties on the object at the same time, based on JSON input. */ + /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. + * + * @remarks + * + * This method has the following additional signature: + * + * `set(properties: Word.TableBorder): void` + * + * @param properties A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called. + * @param options Provides an option to suppress errors if the properties object tries to set any read-only properties. + */ set(properties: Interfaces.TableBorderUpdateData, options?: OfficeExtension.UpdateOptions): void; /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ - set(properties: TableBorder): void; + set(properties: Word.TableBorder): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + * + * @remarks + * + * In addition to this signature, this method has the following signatures: + * + * `load(option?: string | string[]): Word.TableBorder` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * + * `load(option?: { select?: string; expand?: string; }): Word.TableBorder` - Where option.select is a comma-delimited string that specifies the properties/relationships to load, and options.expand is a comma-delimited string that specifies the relationships to load. + * + * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.TableBorder` - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items. + * + * @param options Provides options for which properties of the object to load. */ load(option?: Word.Interfaces.TableBorderLoadOptions): Word.TableBorder; load(option?: string | string[]): Word.TableBorder; @@ -46230,8 +46734,17 @@ declare namespace Word { notImplemented = "NotImplemented", } module Interfaces { + /** + * Provides ways to load properties of only a subset of members of a collection. + */ interface CollectionLoadOptions { + /** + * Specify the number of items in the queried collection to be included in the result. + */ $top?: number; + /** + * Specify the number of items in the collection that are to be skipped and not included in the result. If top is specified, the selection of result will start after skipping the specified number of items. + */ $skip?: number; } /** An interface for updating data on the Body object, for use in "body.set({ ... })". */ @@ -54420,15 +54933,6 @@ declare namespace OneNote { */ numberType: OneNote.NumberType | "None" | "Arabic" | "UCRoman" | "LCRoman" | "UCLetter" | "LCLetter" | "Ordinal" | "Cardtext" | "Ordtext" | "Hex" | "ChiManSty" | "DbNum1" | "DbNum2" | "Aiueo" | "Iroha" | "DbChar" | "SbChar" | "DbNum3" | "DbNum4" | "Circlenum" | "DArabic" | "DAiueo" | "DIroha" | "ArabicLZ" | "Bullet" | "Ganada" | "Chosung" | "GB1" | "GB2" | "GB3" | "GB4" | "Zodiac1" | "Zodiac2" | "Zodiac3" | "TpeDbNum1" | "TpeDbNum2" | "TpeDbNum3" | "TpeDbNum4" | "ChnDbNum1" | "ChnDbNum2" | "ChnDbNum3" | "ChnDbNum4" | "KorDbNum1" | "KorDbNum2" | "KorDbNum3" | "KorDbNum4" | "Hebrew1" | "Arabic1" | "Hebrew2" | "Arabic2" | "Hindi1" | "Hindi2" | "Hindi3" | "Thai1" | "Thai2" | "NumInDash" | "LCRus" | "UCRus" | "LCGreek" | "UCGreek" | "Lim" | "Custom"; } - /** - * [Api set: OneNoteApi 1.1] - */ - enum EntityType { - notebook = "Notebook", - sectionGroup = "SectionGroup", - section = "Section", - page = "Page", - } /** * [Api set: OneNoteApi 1.1] */ @@ -55690,6 +56194,7 @@ declare namespace OneNote { interface TableCellCollectionData { items?: OneNote.Interfaces.TableCellData[]; } + /** * * Represents the top-level object that contains all globally addressable OneNote objects such as notebooks, the active notebook, and the active section. @@ -57361,182 +57866,6 @@ declare namespace OneNote { */ shadingColor?: boolean; } - /** - * - * Represents a OneNote accessibility violation. - * - * [Api set: OneNoteApi 1.2] - */ - interface AccessibilityViolationLoadOptions { - $all?: boolean; - /** - * - * Gets the ID of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - id?: boolean; - /** - * - * Gets the location of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - location?: boolean; - /** - * - * Gets the name of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - name?: boolean; - /** - * - * Gets the type of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - type?: boolean; - } - /** - * - * Represents the collection of AccessibilityViolations - * - * [Api set: OneNoteApi 1.2] - */ - interface AccessibilityViolationCollectionLoadOptions { - $all?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the ID of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - id?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the location of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - location?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the name of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - name?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the type of the accessibility violation. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - type?: boolean; - } - /** - * - * A OneNote structure that stores metadata about accessibility violations for an entity. - * - * [Api set: OneNoteApi 1.2] - */ - interface AccessibilityViolationsByEntityLoadOptions { - $all?: boolean; - /** - * - * Gets the parent section section group (if any) of the entity. - * - * [Api set: OneNoteApi 1.2] - */ - parentSectionGroupOrNull?: OneNote.Interfaces.SectionGroupLoadOptions; - /** - * - * Gets the parent section (if any) of the entity. - * - * [Api set: OneNoteApi 1.2] - */ - parentSectionOrNull?: OneNote.Interfaces.SectionLoadOptions; - /** - * - * Gets the name of the entity for which this structure holds metadata. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - entityName?: boolean; - /** - * - * Gets the type of the entity for which this structure holds metadata. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - entityType?: boolean; - /** - * - * Gets the ID of the AccessibilityViolationsByEntity. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - id?: boolean; - /** - * - * Gets the count of accessibility violations for the entity. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - violationsCount?: boolean; - } - /** - * - * Represents the collection of AccessibilityViolationsByEntity - * - * [Api set: OneNoteApi 1.2] - */ - interface AccessibilityViolationsByEntityCollectionLoadOptions { - $all?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the parent section section group (if any) of the entity. - * - * [Api set: OneNoteApi 1.2] - */ - parentSectionGroupOrNull?: OneNote.Interfaces.SectionGroupLoadOptions; - /** - * - * For EACH ITEM in the collection: Gets the parent section (if any) of the entity. - * - * [Api set: OneNoteApi 1.2] - */ - parentSectionOrNull?: OneNote.Interfaces.SectionLoadOptions; - /** - * - * For EACH ITEM in the collection: Gets the name of the entity for which this structure holds metadata. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - entityName?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the type of the entity for which this structure holds metadata. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - entityType?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the ID of the AccessibilityViolationsByEntity. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - id?: boolean; - /** - * - * For EACH ITEM in the collection: Gets the count of accessibility violations for the entity. Read-only. - * - * [Api set: OneNoteApi 1.2] - */ - violationsCount?: boolean; - } } } declare namespace OneNote { @@ -60156,4 +60485,4 @@ declare namespace Visio { //////////////////////////////////////////////////////////////// ////////////////////// End PowerPoint APIs ///////////////////// -//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// \ No newline at end of file From 8586e357ea6edf12d7484811ae86dccc98e2fec8 Mon Sep 17 00:00:00 2001 From: DimaMukhin Date: Sat, 11 Aug 2018 18:08:17 -0700 Subject: [PATCH 142/346] fixed failing tests --- types/koa-redis-cache/index.d.ts | 29 ++++++++++--------- .../koa-redis-cache/koa-redis-cache-tests.ts | 2 +- types/koa-redis-cache/tsconfig.json | 1 + 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/types/koa-redis-cache/index.d.ts b/types/koa-redis-cache/index.d.ts index 2d983f862d..58f7f120ca 100644 --- a/types/koa-redis-cache/index.d.ts +++ b/types/koa-redis-cache/index.d.ts @@ -1,14 +1,15 @@ -// Type definitions for koa-redis-cache 3.0.1 +// Type definitions for koa-redis-cache 3.0 // Project: https://github.com/coderhaoxin/koa-redis-cache // Definitions by: Dima Mukhin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as Koa from "koa"; import * as Redis from "redis"; type onErrorCallback = (error: Error) => void; -type getPrefixCallback = (ctx: Koa.Context) => String; +type getPrefixCallback = (ctx: Koa.Context) => string; declare namespace cache { interface CacheOptions { @@ -16,36 +17,36 @@ declare namespace cache { * redis key prefix, default is koa-redis-cache: * If a function is supplied, its signature should be function(ctx) {} and it should return a string to use as the redis key prefix */ - prefix?: String | getPrefixCallback; + prefix?: string | getPrefixCallback; /** * redis expire time (second), default is 30 * 60 (30 min) */ - expire?: Number; + expire?: number; /** * if the passParam exists in the query string, skip the cache */ - passParam?: String; + passParam?: string; /** * max length of body size (in bytes) to cache. * if the size of the body exceeds maxLength, the body will not be cached. * default is: Infinity */ - maxLength?: Number; + maxLength?: number; /** * the routes to cache, default is ['(.*)']. - * can be set to an array of routes (String), or an array of RouteOptions + * can be set to an array of routes (string), or an array of RouteOptions */ - routes?: Array | Array; + routes?: RouteOptions[] | string[]; /** * the routes to exclude, default is []. * example: ['/api/(.*)', '/view/:id'] */ - exclude?: Array; + exclude?: string[]; /** * callback function for error, default is function() {} @@ -62,29 +63,29 @@ declare namespace cache { /** * the route to cache, example: '/api/(.*)' */ - route: String; + route: string; /** * expiration time in seconds for cached responses for the route */ - expire?: Number; + expire?: number; } interface RedisOptions { /** * host name of the redis server, default: 'localhost' */ - host?: String, + host?: string; /** * port number of the redis server, default: 6379 */ - port?: Number, + port?: number; /** * node_redis options */ - options?: Redis.ClientOpts + options?: Redis.ClientOpts; } } diff --git a/types/koa-redis-cache/koa-redis-cache-tests.ts b/types/koa-redis-cache/koa-redis-cache-tests.ts index 9c5f528ba7..b83d0b3aea 100644 --- a/types/koa-redis-cache/koa-redis-cache-tests.ts +++ b/types/koa-redis-cache/koa-redis-cache-tests.ts @@ -3,7 +3,7 @@ import * as cache from 'koa-redis-cache'; const app = new Koa(); -const routeOptions: Array = [ +const routeOptions: cache.RouteOptions[] = [ { route: '/api/test', expire: 60 diff --git a/types/koa-redis-cache/tsconfig.json b/types/koa-redis-cache/tsconfig.json index dbf782ccae..897679810e 100644 --- a/types/koa-redis-cache/tsconfig.json +++ b/types/koa-redis-cache/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 42e2b3b3650e9744a51cda512c9d2283fc47d144 Mon Sep 17 00:00:00 2001 From: Josh Thomas Date: Sun, 12 Aug 2018 01:18:16 -0600 Subject: [PATCH 143/346] Add $stickyState.reset() to ui-router-extras typings http://christopherthielen.github.io/ui-router-extras/#/sticky --- types/ui-router-extras/index.d.ts | 6 ++++++ types/ui-router-extras/ui-router-extras-tests.ts | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/types/ui-router-extras/index.d.ts b/types/ui-router-extras/index.d.ts index b36f030689..42f4926e87 100644 --- a/types/ui-router-extras/index.d.ts +++ b/types/ui-router-extras/index.d.ts @@ -131,6 +131,12 @@ declare module 'angular' { */ interface IStickyStateService { getInactiveStates(): IStickyState[]; + /* + * If there is an inactive state named inactiveStateName, this method exits that state. + * If stateParams is provided, then the state is only exited if the params match the inactive params. + * If inactiveStateName === '*', then all inactive states are exited + */ + reset(inactiveStateName: string, stateParams?: { [key: string]: string | string[] }): void; } /** diff --git a/types/ui-router-extras/ui-router-extras-tests.ts b/types/ui-router-extras/ui-router-extras-tests.ts index 5cc3ed122a..ef3f52ad79 100644 --- a/types/ui-router-extras/ui-router-extras-tests.ts +++ b/types/ui-router-extras/ui-router-extras-tests.ts @@ -16,7 +16,7 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a onReactivate: ($state: angular.ui.IState) => { const iAmInjectedByInjector = $state; }, - controller: ($previousState: angular.ui.IPreviousStateService, $deepstateRedirect: angular.ui.IDeepStateRedirectService) => { + controller: ($previousState: angular.ui.IPreviousStateService, $deepstateRedirect: angular.ui.IDeepStateRedirectService, $stickyState: angular.ui.IStickyStateService) => { $previousState.memo('test-memo1'); $previousState.memo('test-memo2', 'test-state-name2'); $previousState.memo('test-memo3', 'test-state-name3', {}); @@ -32,6 +32,13 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a stateParam1: ['value1', 'value2'], stateParam2: 'value' }); + + $stickyState.getInactiveStates(); + $stickyState.reset('state1'); + $stickyState.reset('state2', { + stateParam1: ['value1', 'value2'], + stateParam2: 'value' + }); }, views: { // named views are mandatory From 65e927604277f0cdaaa67664225f322c621c4ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Nore=C3=B1a?= Date: Sun, 12 Aug 2018 18:15:44 -0500 Subject: [PATCH 144/346] fix wrong and missing properties in the 3 components, add localeconfig --- types/react-native-calendars/index.d.ts | 617 ++++++++++-------- .../react-native-calendars-tests.tsx | 62 +- 2 files changed, 379 insertions(+), 300 deletions(-) diff --git a/types/react-native-calendars/index.d.ts b/types/react-native-calendars/index.d.ts index 3784c1f628..449085303a 100644 --- a/types/react-native-calendars/index.d.ts +++ b/types/react-native-calendars/index.d.ts @@ -1,170 +1,92 @@ -// Type definitions for react-native-calendars 1.20 +// Type definitions for react-native-calendarss 1.20 // Project: https://github.com/wix/react-native-calendars#readme // Definitions by: Tyler Zhang +// David Noreña // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from 'react'; -import { ViewProps, StyleProp } from 'react-native'; +import { StyleProp, TextStyle, ViewStyle } from 'react-native'; +export import LocaleConfig = require('xdate'); export interface DateObject { - year: number; - month: number; day: number; - timestamp: number; dateString: string; + month: number; + timestamp: number; + year: number; } -export interface CalendarTheme { - backgroundColor?: string; - calendarBackground?: string; - textSectionTitleColor?: string; - selectedDayBackgroundColor?: string; - selectedDayTextColor?: string; - todayTextColor?: string; - dayTextColor?: string; - textDisabledColor?: string; - dotColor?: string; - selectedDotColor?: string; - arrowColor?: string; - monthTextColor?: string; - textDayFontFamily?: string; - textMonthFontFamily?: string; - textDayHeaderFontFamily?: string; - textMonthFontWeight?: string; - textDayFontSize?: number; - textMonthFontSize?: number; - textDayHeaderFontSize?: number; -} - -export interface DayComponentProps { - state: '' | 'selected' | 'disabled' | 'today'; - theme: CalendarTheme; - onPress: () => any; - onLongPress: () => any; - date: DateObject; - marking: false | Marking[]; -} - -export interface CalendarBaseProps { - /** - * Styles for the view - */ - style?: StyleProp; - - /** - * Specify theme properties to override specific styles for calendar parts. Default = {} - */ - theme?: CalendarTheme; - - /** - * Initially visible month. Default = Date() - */ - current?: Date | string; - - /** - * Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined - */ - minDate?: Date | string; - - /** - * Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined - */ - maxDate?: Date | string; - - /** - * Handler which gets executed on day press. Default = undefined - */ - onDayPress?: (day: number) => void; - - /** - * Handler which gets executed on day long press. Default = undefined - */ - onDayLongPress?: (day: number) => void; - - /** - * Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting - */ - monthFormat?: string; - - /** - * Handler which gets executed when visible month changes in calendar. Default = undefined - */ - onMonthChange?: (month: number) => void; - - /** - * Hide month navigation arrows. Default = false - */ - hideArrows?: boolean; - - /** - * Replace default arrows with custom ones (direction can be 'left' or 'right') - */ - renderArrow?: (direction: 'left' | 'right') => React.ReactNode; - - /** - * Do not show days of other months in month page. Default = false - */ - hideExtraDays?: boolean; - - /** - * If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out - * day from another month that is visible in calendar page. Default = false - */ - disableMonthChange?: boolean; - - /** - * If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. - */ - firstDay?: number; - - /** - * Hide day names. Default = false - */ - hideDayNames?: boolean; - - /** - * Show week numbers to the left. Default = false - */ - showWeekNumbers?: boolean; - - /** - * Handler which gets executed when press arrow icon left. It receive a callback can go back month - */ - onPressArrowLeft?: (month: number) => void; - - /** - * Handler which gets executed when press arrow icon left. It receive a callback can go next month - */ - onPressArrowRight?: (month: number) => void; - - /** - * Custom day renderer - */ - dayComponent?: React.Component | React.SFC; -} - -export interface DotForMultiDot { +export interface CalendarDot { key: string; color: string; selectedDotColor?: string; } -export interface MultiDotMarking { - dots: DotForMultiDot[]; - selected?: boolean; - selectedColor?: string; - disabled?: boolean; +export interface CalendarTheme { + arrowColor?: string; + backgroundColor?: string; + calendarBackground?: string; + dayTextColor?: string; + dotColor?: string; + monthTextColor?: string; + selectedDayBackgroundColor?: string; + selectedDayTextColor?: string; + selectedDotColor?: string; + textDayFontFamily?: string; + textDayFontSize?: number; + textDayHeaderFontFamily?: string; + textDayHeaderFontSize?: number; + textDisabledColor?: string; + textMonthFontFamily?: string; + textMonthFontWeight?: string; + textMonthFontSize?: number; + textSectionTitleColor?: string; + todayTextColor?: string; +} + +export type DateCallbackHandler = (date: DateObject) => void; + +export type TCalendarDate = Date | DateObject | number | string | XDate; + +export interface MarkedDateCustomStyles { + container: StyleProp; + text: StyleProp; +} + +export interface CalendarDot { + key: string; + color: string; + selectedDotColor?: string; +} + +export interface CustomMarking { + customStyles: MarkedDateCustomStyles; } export interface DotMarking { - selected?: boolean; - marked?: boolean; - selectedColor?: string; - dotColor?: string; activeOpacity?: number; disabled?: boolean; disableTouchEvent?: boolean; + dotColor?: string; + marked?: boolean; + selected?: boolean; + selectedColor?: string; +} + +export interface MultiDotMarking { + disabled?: boolean; + dots: CalendarDot[]; + selected?: boolean; + selectedColor?: string; +} + +export interface MultiPeriodMarking { + periods: Array<{ + startingDay?: boolean; + endingDay?: boolean; + color?: string; + }>; } export interface PeriodMarking { @@ -176,29 +98,15 @@ export interface PeriodMarking { disabled?: boolean; } -export interface MultiPeriodMarking { - periods: Array<{ - startingDay?: boolean; - endingDay?: boolean; - color?: string; - }>; -} - -export interface CustomMarking { - customStyles: any; -} - export type Marking = - MultiDotMarking | - DotMarking | - PeriodMarking | - MultiPeriodMarking | - CustomMarking; + CustomMarking | DotMarking | + MultiDotMarking | MultiPeriodMarking | + PeriodMarking; -export interface MultiDotMarkingProps { - markingType: 'multi-dot'; +export interface CustomMarkingProps { + markingType: 'custom'; markedDates: { - [date: string]: MultiDotMarking; + [date: string]: CustomMarking; }; } @@ -209,17 +117,10 @@ export interface DotMarkingProps { }; } -export interface PeriodMarkingProps { - markingType: 'period'; +export interface MultiDotMarkingProps { + markingType: 'multi-dot'; markedDates: { - [date: string]: PeriodMarking; - }; -} - -export interface CustomMarkingProps { - markingType: 'custom'; - markedDates: { - [date: string]: CustomMarking; + [date: string]: MultiDotMarking; }; } @@ -234,6 +135,13 @@ export interface MultiPeriodMarkingProps { }; } +export interface PeriodMarkingProps { + markingType: 'period'; + markedDates: { + [date: string]: PeriodMarking; + }; +} + export type CalendarMarkingProps = MultiDotMarkingProps | DotMarkingProps | @@ -242,61 +150,217 @@ export type CalendarMarkingProps = CustomMarkingProps | {}; -export class Calendar extends React.Component {} +export interface DayComponentProps { + date: DateObject; + marking: false | Marking[]; + onPress: () => any; + onLongPress: () => any; + state: '' | 'selected' | 'disabled' | 'today'; + theme: CalendarTheme; +} + +export interface CalendarBaseProps { + /** + * Initially visible month. Default = Date() + */ + current?: TCalendarDate; + + /** + * Provide custom day rendering component. + */ + dayComponent?: React.Component | React.SFC; + + /** + * Disable days by default. Default = false + */ + disabledByDefault?: boolean; + + /** + * If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out + * day from another month that is visible in calendar page. Default = false + */ + disableMonthChange?: boolean; + + /** + * Display loading indicator. Default = false + */ + displayLoadingIndicator?: boolean; + + /** + * If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + */ + firstDay?: number; + + /** + * Hide month navigation arrows. Default = false + */ + hideArrows?: boolean; + + /** + * Hide day names. Default = false + */ + hideDayNames?: boolean; + + /** + * Do not show days of other months in month page. Default = false + */ + hideExtraDays?: boolean; + + /** + * Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined + */ + maxDate?: TCalendarDate; + + /** + * Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined + */ + minDate?: TCalendarDate; + + /** + * Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + */ + monthFormat?: string; + + /** + * Handler which gets executed on day press. Default = undefined + */ + onDayPress?: DateCallbackHandler; + + /** + * Handler which gets executed on day long press. Default = undefined + */ + onDayLongPress?: DateCallbackHandler; + + /** + * Handler which gets executed when press arrow icon left. It receive a callback can go back month + */ + onPressArrowLeft?: (substractMonth: () => void) => void; + + /** + * Handler which gets executed when press arrow icon left. It receive a callback can go next month + */ + onPressArrowRight?: (addMonth: () => void) => void; + + /** + * Handler which gets executed when visible month changes in calendar. Default = undefined + */ + onMonthChange?: DateCallbackHandler; -export interface CalendarListBaseProps extends CalendarBaseProps { /** * Callback which gets executed when visible months change in scroll view. Default = undefined */ - onVisibleMonthsChange?: (months: number) => void; + onVisibleMonthsChange?: (months: DateObject[]) => void; /** - * Max amount of months allowed to scroll to the past. Default = 50 + * Replace default arrows with custom ones (direction can be 'left' or 'right') */ - pastScrollRange?: number; + renderArrow?: (direction: 'left' | 'right') => React.ReactNode; + + /** + * Show week numbers to the left. Default = false + */ + showWeekNumbers?: boolean; + + /** + * Calendar container style. + */ + style?: StyleProp; + + /** + * Specify theme properties to override specific styles for calendar parts. Default = {} + */ + theme?: CalendarTheme; +} + +export class Calendar extends React.Component { } + +export interface CalendarListBaseProps extends CalendarBaseProps { + /** + * Set custom calendar heigth. + */ + calendarHeight?: number; + + /** + * Set custom calendar width. + */ + calendarWidth?: number; /** * Max amount of months allowed to scroll to the future. Default = 50 */ futureScrollRange?: number; + /** + * Enable horizontal scrolling, default = false + */ + horizontal?: boolean; + + /** + * Enable paging on horizontal, default = false + */ + pagingEnabled?: boolean; + + /** + * Max amount of months allowed to scroll to the past. Default = 50 + */ + pastScrollRange?: number; + /** * Enable or disable scrolling of calendar list */ scrollEnabled?: boolean; + /** + * When true, the calendar list scrolls to top when the status bar is tapped. Default = true + */ + scrollsToTop?: boolean; + /** * Enable or disable vertical scroll indicator. Default = false */ showScrollIndicator?: boolean; - - /** - * Enable horizontal scrolling, default = false - */ - horizontal?: boolean; - - /** - * Enable paging on horizontal, default = false - */ - pagingEnabled?: boolean; - - /** - * Set custom calendarWidth. - */ - calendarWidth?: boolean; } -export class CalendarList extends React.Component {} +export class CalendarList extends React.Component { } -export interface AgendaProps { +export interface AgendaThemeStyle extends CalendarTheme { + agendaDayNumColor?: string; + agendaDayTextColor?: string; + agendaKnobColor?: string; + agendaTodayColor?: string; +} + +export interface AgendaItemsMap { + [date: string]: TItem[]; +} + +export interface AgendaProps { /** - * the list of items that have to be displayed in agenda. If you want to render item as empty date - * the value of date key kas to be an empty array []. If there exists no value for date key it is - * considered that the date in question is not yet loaded + * Display loading indicator. Default = false */ - items: { - [key: string]: T[]; - }; + displayLoadingIndicator?: boolean; + + /** + * If firstDay = 1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + */ + firstDay?: number; + + /** + * Max amount of months allowed to scroll to the future. Default = 50 + */ + futureScrollRange?: number; + + /** + * Hide knob button. Default = false + */ + hideKnob?: boolean; + + /** + * The list of items that have to be displayed in agenda. If you want to render item as empty date + * the value of date key kas to be an empty array []. If there exists no value for date key it is + * considered that the date in question is not yet loaded + */ + items?: AgendaItemsMap; /** * callback that gets called when items for a certain month should be loaded (month became visible) @@ -304,115 +368,100 @@ export interface AgendaProps { loadItemsForMonth?: (date: DateObject) => void; /** - * callback that fires when the calendar is opened or closed + * Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined */ - onCalendarToggled?: (calendarOpened: boolean) => void; - - /** - * callback that gets called on day press - */ - onDayPress?: (day: number) => void; - - /** - * callback that gets called when day changes while scrolling agenda list - */ - onDayChange?: (day: number) => void; - - /** - * initially selected day - */ - selected?: Date | string; + maxDate?: TCalendarDate; /** * Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined */ - minDate?: Date | string; + minDate?: TCalendarDate; /** - * Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined + * Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting */ - maxDate?: Date | string; + monthFormat?: string; /** - * Max amount of months allowed to scroll to the past. Default = 50 + * Handler which gets executed on day press. Default = undefined + */ + onDayPress?: DateCallbackHandler; + + /** + * Handler which gets executed when the calendar is opened or closed. Default = undefined + */ + onCalendarToggled?: (calendarOpened: boolean) => void; + + /** + * Handler that gets called when day changes while scrolling agenda list. Default = undefined + */ + onDayChange?: DateCallbackHandler; + + /** + * If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. + * Make sure to also set the refreshing prop correctly. Default = undefined + */ + onRefresh?: () => void; + + /** + * Max amount of months allowed to scroll to the past. Default = 50 */ pastScrollRange?: number; /** - * Max amount of months allowed to scroll to the future. Default = 50 - */ - futureScrollRange?: number; - - /** - * specify how each item should be rendered in agenda - */ - renderItem: (item: T, firstItemInDay?: T) => React.ReactNode; - - /** - * specify how each date should be rendered. day can be undefined if the item is not first in that day. - */ - renderDay?: (day: DateObject | undefined, item: T) => React.ReactNode; - - /** - * specify how empty date content with no items should be rendered - */ - renderEmptyDate?: () => React.ReactNode; - - /** - * specify how agenda knob should look like - */ - renderKnob?: () => React.ReactNode; - - /** - * specify what should be rendered instead of ActivityIndicator - */ - renderEmptyData?: () => React.ReactNode; - - /** - * specify your item comparison function for increased performance - */ - rowHasChanged?: (r1: any, r2: any) => boolean; - - /** - * Hide knob button. Default = false - */ - hideKnob?: boolean; - - /** - * A RefreshControl component, used to provide pull-to-refresh funtionality for the ScrollView + * A RefreshControl component, used to provide pull-to-refresh funtionality for the ScrollView. */ refreshControl?: React.ReactNode; /** - * If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. - * Make sure to also set the refreshing prop correctly. - */ - onRefresh?: () => any; - - /** - * Set this true while waiting for new data from a refresh + * Set this true while waiting for new data from a refresh. */ refreshing?: boolean; /** - * Display loading indicator. Default = false + * Specify how each day should be rendered. + * Date can be undefined if the item has not property date. */ - displayLoadingIndicator?: boolean; + renderDay?: (date: DateObject | undefined, item: TItem) => React.ReactNode; /** - * agenda theme + * Specify what should be rendered instead of ActivityIndicator */ - theme?: { - agendaDayTextColor?: string; - agendaDayNumColor?: string; - agendaTodayColor?: string; - agendaKnobColor?: string; - } & CalendarTheme; + renderEmptyData?: () => React.ReactNode; /** - * agenda container style + * Specify how empty date content with no items should be rendered. */ - style?: StyleProp; + renderEmptyDate: () => React.ReactNode; + + /** + * Specify how each item should be rendered in agenda. + */ + renderItem: (item: TItem, firstDayInDay: boolean) => React.ReactNode; + + /** + * Specify how agenda knob should look like. + */ + renderKnob?: () => React.ReactNode; + + /** + * specify your item comparison function for increased performance + */ + rowHasChanged: (r1: TItem, r2: TItem) => boolean; + + /** + * Initially visible month. Default = Date() + */ + selected?: TCalendarDate; + + /** + * Agenda container style. + */ + style?: StyleProp; + + /** + * Specify theme properties to override specific styles for agenda parts. Default = {} + */ + theme?: AgendaThemeStyle; } - -export class Agenda extends React.Component & CalendarMarkingProps> {} +export class Agenda extends React.Component & CalendarMarkingProps> { } diff --git a/types/react-native-calendars/react-native-calendars-tests.tsx b/types/react-native-calendars/react-native-calendars-tests.tsx index 5b438937e1..3a095a597e 100644 --- a/types/react-native-calendars/react-native-calendars-tests.tsx +++ b/types/react-native-calendars/react-native-calendars-tests.tsx @@ -10,23 +10,23 @@ import { Calendar, CalendarList, Agenda } from "react-native-calendars"; // Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined maxDate={"2012-05-30"} // Handler which gets executed on day press. Default = undefined - onDayPress={day => { - console.log("selected day", day); + onDayPress={date => { + console.log("selected day", date.day); }} // Handler which gets executed on day long press. Default = undefined - onDayLongPress={day => { - console.log("selected day", day); + onDayLongPress={date => { + console.log("selected day", date.day); }} // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting monthFormat={"yyyy MM"} // Handler which gets executed when visible month changes in calendar. Default = undefined - onMonthChange={month => { - console.log("month changed", month); + onMonthChange={date => { + console.log("month changed", date.month); }} // Hide month navigation arrows. Default = false hideArrows={true} // Replace default arrows with custom ones (direction can be 'left' or 'right') - renderArrow={direction =>
} + renderArrow={direction => } // Do not show days of other months in month page. Default = false hideExtraDays={true} // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out @@ -42,6 +42,7 @@ import { Calendar, CalendarList, Agenda } from "react-native-calendars"; onPressArrowLeft={substractMonth => console.log(substractMonth)} // Handler which gets executed when press arrow icon left. It receive a callback can go next month onPressArrowRight={addMonth => console.log(addMonth)} + disabledByDefault={true} />; { - console.log("selected day", day); + onDayPress={date => { + console.log("selected day", date.day); }} // Handler which gets executed on day long press. Default = undefined - onDayLongPress={day => { - console.log("selected day", day); + onDayLongPress={date => { + console.log("selected day", date.day); }} // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting monthFormat={"yyyy MM"} // Handler which gets executed when visible month changes in calendar. Default = undefined - onMonthChange={month => { - console.log("month changed", month); + onMonthChange={date => { + console.log("month changed", date.month); }} // Hide month navigation arrows. Default = false hideArrows={true} // Replace default arrows with custom ones (direction can be 'left' or 'right') - renderArrow={direction =>
} + renderArrow={direction => } // Do not show days of other months in month page. Default = false hideExtraDays={true} // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out @@ -267,7 +268,7 @@ const workout = { key: "workout", color: "green" }; // Hide month navigation arrows. Default = false hideArrows={true} // Replace default arrows with custom ones (direction can be 'left' or 'right') - renderArrow={direction =>
} + renderArrow={direction => } // Do not show days of other months in month page. Default = false hideExtraDays={true} // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out @@ -283,6 +284,29 @@ const workout = { key: "workout", color: "green" }; onPressArrowLeft={substractMonth => console.log(substractMonth)} // Handler which gets executed when press arrow icon left. It receive a callback can go next month onPressArrowRight={addMonth => console.log(addMonth)} + // Disable days by default. Default = false + disabledByDefault={true} + // Display loading indicator. Default = false + displayLoadingIndicator={true} + // When true, the calendar list scrolls to top when the status bar is tapped. Default = true + scrollsToTop={true} + // Enable paging on horizontal, default = false + pagingEnabled={true} + // Provide custom day rendering component. + dayComponent={({ date, state }) => { + return ( + + + {date.day} + + + ); + }} />; { - return ; + return firstItemInDay ? : ; }} // specify how each date should be rendered. day can be undefined if the item is not first in that day. renderDay={(day, item) => { @@ -371,4 +395,10 @@ const workout = { key: "workout", color: "green" }; }} // agenda container style style={{}} + // Display loading indicator. Default = false + displayLoadingIndicator={true} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + monthFormat={"yyyy MM"} />; From 948f0f47bd7c5060a1631edcd0175cf1f665b8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Nore=C3=B1a?= Date: Sun, 12 Aug 2018 18:25:49 -0500 Subject: [PATCH 145/346] fix for --- types/react-native-calendars/tslint.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/react-native-calendars/tslint.json b/types/react-native-calendars/tslint.json index 3db14f85ea..82403bc9ec 100644 --- a/types/react-native-calendars/tslint.json +++ b/types/react-native-calendars/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "file-name-casing": [true, "kebab-case"] + } +} From 255979639d96d507a9c8ee6ce7dc712ee2019f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Nore=C3=B1a?= Date: Sun, 12 Aug 2018 18:29:40 -0500 Subject: [PATCH 146/346] fix comments --- types/react-native-calendars/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-calendars/index.d.ts b/types/react-native-calendars/index.d.ts index 449085303a..b7a1736d2a 100644 --- a/types/react-native-calendars/index.d.ts +++ b/types/react-native-calendars/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-calendarss 1.20 +// Type definitions for react-native-calendars 1.20 // Project: https://github.com/wix/react-native-calendars#readme // Definitions by: Tyler Zhang // David Noreña From f05bd87af8eb16ebb89c60c89288d2b9dc6bba2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Mon, 13 Aug 2018 12:14:46 +0200 Subject: [PATCH 147/346] [react-relay] Add plural fragment refs and handle connection data well. Also runs prettier against the tests, which were omitted previously. --- types/react-relay/index.d.ts | 23 ++++- .../test/react-relay-compat-tests.tsx | 4 +- types/react-relay/test/react-relay-tests.tsx | 93 ++++++++++++------- types/relay-runtime/index.d.ts | 4 + 4 files changed, 86 insertions(+), 38 deletions(-) diff --git a/types/react-relay/index.d.ts b/types/react-relay/index.d.ts index 24993b0018..2e41dcbd6a 100644 --- a/types/react-relay/index.d.ts +++ b/types/react-relay/index.d.ts @@ -9,6 +9,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 +// Prettified with: +// $ prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 --write --print-width 120 \ +// types/{react-relay,relay-runtime}/{,*}/*.ts* + export { commitLocalUpdate, commitRelayModernMutation as commitMutation, @@ -24,7 +28,16 @@ import * as RelayRuntimeTypes from "relay-runtime"; // Utility types // ~~~~~~~~~~~~~~~~~~~~~ -export type FragmentOrRegularProp = T extends { ' $refType': infer U } ? { ' $fragmentRefs': U } : T; +export interface _RefType { + " $refType": T; +} +export interface _FragmentRefs { + " $fragmentRefs": T; +} + +export type FragmentOrRegularProp = T extends _RefType + ? _FragmentRefs + : T extends ReadonlyArray<_RefType> ? ReadonlyArray<_FragmentRefs> : T; export type MappedFragmentProps = { [K in keyof T]: FragmentOrRegularProp }; @@ -113,8 +126,8 @@ export interface PageInfo { startCursor: string | undefined | null; } export interface ConnectionData { - edges?: any[]; - pageInfo?: PageInfo; + edges?: ReadonlyArray; + pageInfo?: Partial; } export type RelayPaginationProp = RelayProp & { hasMore(): boolean; @@ -134,9 +147,9 @@ export function FragmentVariablesGetter( prevVars: RelayRuntimeTypes.Variables, totalCount: number ): RelayRuntimeTypes.Variables; -export interface ConnectionConfig { +export interface ConnectionConfig

{ direction?: "backward" | "forward"; - getConnectionFromProps?(props: T): ConnectionData | undefined | null; + getConnectionFromProps?(props: P): ConnectionData | undefined | null; getFragmentVariables?: typeof FragmentVariablesGetter; getVariables( props: { [propName: string]: any }, diff --git a/types/react-relay/test/react-relay-compat-tests.tsx b/types/react-relay/test/react-relay-compat-tests.tsx index e0ee5d3be2..0b42151b6f 100644 --- a/types/react-relay/test/react-relay-compat-tests.tsx +++ b/types/react-relay/test/react-relay-compat-tests.tsx @@ -32,7 +32,7 @@ function markNotificationAsReadCompat(environment: CompatEnvironment, source: st if (field) { field.setValue(data.story, "story"); } - } + }, }); } @@ -46,7 +46,7 @@ class CompatComponent extends React.Component { } render() { - return (

); + return
; } } diff --git a/types/react-relay/test/react-relay-tests.tsx b/types/react-relay/test/react-relay-tests.tsx index 300154678c..9d08ed42d6 100644 --- a/types/react-relay/test/react-relay-tests.tsx +++ b/types/react-relay/test/react-relay-tests.tsx @@ -11,7 +11,7 @@ import { QueryRenderer, RelayRefetchProp, RelayPaginationProp, - RelayProp + RelayProp, } from "react-relay"; // ~~~~~~~~~~~~~~~~~~~~~ @@ -28,16 +28,20 @@ const modernEnvironment = new Environment({ network, store }); // ~~~~~~~~~~~~~~~~~~~~~ // Modern QueryRenderer // ~~~~~~~~~~~~~~~~~~~~~ -const MyQueryRenderer = (props: { name: string, show: boolean }) => ( +const MyQueryRenderer = (props: { name: string; show: boolean }) => ( ( if (error) { return
{error.message}
; } else if (props) { - throw new Error('This code path should never be hit'); + throw new Error("This code path should never be hit"); } return
Loading
; }} @@ -100,7 +104,7 @@ const Story = (() => { class Story extends React.Component { state = { - isLoading: false + isLoading: false, }; componentDidMount() { @@ -109,9 +113,14 @@ const Story = (() => { handleRefresh() { this.setState({ isLoading: true }); - this.props.relay.refetch({ id: this.props.story.id }, {}, error => { - this.setState({ isLoading: false }); - }, { force: true }); + this.props.relay.refetch( + { id: this.props.story.id }, + {}, + error => { + this.setState({ isLoading: false }); + }, + { force: true } + ); } render() { @@ -162,6 +171,8 @@ const Story = (() => { // Artifact produced by relay-compiler-language-typescript declare const _FeedStories_feed$ref: unique symbol; type FeedStories_feed$ref = typeof _FeedStories_feed$ref; +declare const _FeedStory_edges$ref: unique symbol; +type FeedStory_edges$ref = typeof _FeedStory_edges$ref; // tslint:disable-next-line:interface-over-type-literal type FeedStories_feed = { readonly edges: ReadonlyArray<{ @@ -169,9 +180,15 @@ type FeedStories_feed = { readonly id: string; readonly " $fragmentRefs": Story_story$ref & FeedStories_feed$ref; }; + readonly " $fragmentRefs": FeedStory_edges$ref; }>; readonly " $refType": FeedStories_feed$ref; }; +// tslint:disable-next-line:interface-over-type-literal +type FeedStory_edges = ReadonlyArray<{ + readonly publishedAt: string; + readonly " $refType": FeedStory_edges$ref; +}>; const Feed = (() => { interface Props { @@ -181,6 +198,18 @@ const Feed = (() => { ignoreMe?: {}; } + const FeedStoryEdges: React.SFC<{ edges: FeedStory_edges }> = ({ edges }) => ( +
{edges.map(({ publishedAt }) => publishedAt).join(", ")}
+ ); + + const FeedStoryEdgesFragmentContainer = createFragmentContainer(FeedStoryEdges, { + edges: graphql` + fragment FeedStory_edges on FeedStoryEdge @relay(plural: true) { + publishedAt + } + `, + }); + const FeedStories: React.SFC = ({ feed, onStoryLike, relay }) => { // TODO: Getting env here for no good reason other than needing to test it works. // If you have a good relavant example, please update! @@ -188,24 +217,27 @@ const Feed = (() => { const stories = feed.edges.map(edge => { return ; }); - return
{stories}
; + return ( +
+ {stories} + {} +
+ ); }; - const FeedFragmentContainer = createFragmentContainer( - FeedStories, - { - feed: graphql` - fragment FeedStories_feed on Feed { - edges { - node { - id - ...Story_story - } + const FeedFragmentContainer = createFragmentContainer(FeedStories, { + feed: graphql` + fragment FeedStories_feed on Feed { + edges { + node { + id + ...Story_story } + ...FeedStoryEdges_feed } - `, - } - ); + } + `, + }); function doesNotRequireRelayPropToBeProvided() { const onStoryLike = (id: string) => console.log(`Liked story #${id}`); @@ -290,8 +322,7 @@ type UserFeed_user = { { direction: "forward", getConnectionFromProps(props) { - // TODO: Fix requirement to have `edges` and both `pageInfo` details for forward and backward pagination - return props.user && props.user.feed as any; + return props.user && props.user.feed; }, getFragmentVariables(prevVars, totalCount) { return { @@ -398,7 +429,7 @@ function markNotificationAsRead(source: string, storyID: string) { if (field) { field.setValue(data.story, "story"); } - } + }, }); } diff --git a/types/relay-runtime/index.d.ts b/types/relay-runtime/index.d.ts index 85a6c9c3ea..acfec9eaa5 100644 --- a/types/relay-runtime/index.d.ts +++ b/types/relay-runtime/index.d.ts @@ -5,6 +5,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 +// Prettified with: +// $ prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 --write --print-width 120 \ +// types/{react-relay,relay-runtime}/{,*}/*.ts* + /** * SOURCE: * Relay 1.3.0 From 983aa9cc647da43c68428840fd722d3e6d7c7be7 Mon Sep 17 00:00:00 2001 From: LauR3y Date: Mon, 13 Aug 2018 13:28:00 +0200 Subject: [PATCH 148/346] Support for dispatching NavigationCompleteTransitionAction --- types/react-navigation/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 6e286c2217..4e342130e9 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -446,7 +446,8 @@ export type NavigationStackAction = | NavigationReplaceAction | NavigationPopAction | NavigationPushAction - | NavigationPopToTopAction; + | NavigationPopToTopAction + | NavigationCompleteTransitionAction; export type NavigationTabAction = | NavigationInitAction From 49d55176a9959b92cde2cb6479773e5eb8709378 Mon Sep 17 00:00:00 2001 From: Kacper Wiszczuk Date: Mon, 13 Aug 2018 15:14:43 +0200 Subject: [PATCH 149/346] Add JSON5 missing type --- types/json5/index.d.ts | 15 ++++++++++++++- types/json5/json5-tests.ts | 20 +++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/types/json5/index.d.ts b/types/json5/index.d.ts index a8fc723b60..8c53949a28 100644 --- a/types/json5/index.d.ts +++ b/types/json5/index.d.ts @@ -40,5 +40,18 @@ Comments Both inline (single-line) and block (multi-line) comments are allowed. */ -declare var json5: JSON; + +type JSONReplacer = (key: string, value: any) => any | (number | string)[] | null; + +interface JSON5 { + // Old JSON methods + parse(text: string, reviver?: (key: any, value: any) => any): any; + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; + + // New JSON5 stringify function + stringify(value: any, options?: { space?: number | string, quote?: string, replacer?: JSONReplacer }): string; +} + +declare var json5: JSON5; export = json5; diff --git a/types/json5/json5-tests.ts b/types/json5/json5-tests.ts index f1be5b1038..b92065ccb0 100644 --- a/types/json5/json5-tests.ts +++ b/types/json5/json5-tests.ts @@ -1,7 +1,21 @@ import JSON5 = require('json5'); -var obj = JSON5.parse("{ key:'val', 'key2':[0,1,2,] } //comment "); -var str = JSON5.stringify(obj, null, "\t"); -console.log(str); +const STR = "{ key:'val', 'key2':[0,1,2,] } //comment "; +const OBJ = { key: 'value', key2: [0, 1, 2] }; +function reviverFunction(key: any, value: any): any { + return { [key]: value }; +} + +function replacerFunction(key: string, value: any) { + return { [key]: value }; +} + +const str1: string = JSON5.stringify(OBJ); +const str2: string = JSON5.stringify(OBJ, null, 4); +const str3: string = JSON5.stringify(OBJ, undefined, '2'); +const str4: string = JSON5.stringify(OBJ, replacerFunction, 2); + +JSON.parse(STR); +JSON.parse(STR, reviverFunction); From 8914773fd7787f89c6ca26bdf86bdb0ccfdd5e99 Mon Sep 17 00:00:00 2001 From: Kacper Wiszczuk Date: Mon, 13 Aug 2018 15:18:40 +0200 Subject: [PATCH 150/346] Add author --- types/json5/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/json5/index.d.ts b/types/json5/index.d.ts index 8c53949a28..87bda70a2e 100644 --- a/types/json5/index.d.ts +++ b/types/json5/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for JSON5 // Project: http://json5.org/ // Definitions by: Jason Swearingen +// Kacper Wiszczuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 925a3c466591c17379a1a8f9ac63d2fe6726905b Mon Sep 17 00:00:00 2001 From: Kacper Wiszczuk Date: Mon, 13 Aug 2018 15:27:11 +0200 Subject: [PATCH 151/346] Indentation fixes --- types/json5/index.d.ts | 12 ++++++------ types/json5/json5-tests.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/json5/index.d.ts b/types/json5/index.d.ts index 87bda70a2e..9c0cb6cde6 100644 --- a/types/json5/index.d.ts +++ b/types/json5/index.d.ts @@ -45,13 +45,13 @@ Both inline (single-line) and block (multi-line) comments are allowed. type JSONReplacer = (key: string, value: any) => any | (number | string)[] | null; interface JSON5 { - // Old JSON methods - parse(text: string, reviver?: (key: any, value: any) => any): any; - stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; - stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; + // Old JSON methods + parse(text: string, reviver?: (key: any, value: any) => any): any; + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; - // New JSON5 stringify function - stringify(value: any, options?: { space?: number | string, quote?: string, replacer?: JSONReplacer }): string; + // New JSON5 stringify function + stringify(value: any, options?: { space?: number | string, quote?: string, replacer?: JSONReplacer }): string; } declare var json5: JSON5; diff --git a/types/json5/json5-tests.ts b/types/json5/json5-tests.ts index b92065ccb0..94820866f8 100644 --- a/types/json5/json5-tests.ts +++ b/types/json5/json5-tests.ts @@ -5,11 +5,11 @@ const STR = "{ key:'val', 'key2':[0,1,2,] } //comment "; const OBJ = { key: 'value', key2: [0, 1, 2] }; function reviverFunction(key: any, value: any): any { - return { [key]: value }; + return { [key]: value }; } function replacerFunction(key: string, value: any) { - return { [key]: value }; + return { [key]: value }; } const str1: string = JSON5.stringify(OBJ); From 1b962508348c0904128ffbad01cd9040938a1a47 Mon Sep 17 00:00:00 2001 From: David Brockman Smoliansky Date: Mon, 13 Aug 2018 17:29:03 +0200 Subject: [PATCH 152/346] add types for package varint Add types for [varint](https://github.com/chrisdickinson/varint) --- types/varint/index.d.ts | 46 ++++++++++++++++++++++++++++++++++++ types/varint/tsconfig.json | 16 +++++++++++++ types/varint/tslint.json | 1 + types/varint/varint-tests.ts | 17 +++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 types/varint/index.d.ts create mode 100644 types/varint/tsconfig.json create mode 100644 types/varint/tslint.json create mode 100644 types/varint/varint-tests.ts diff --git a/types/varint/index.d.ts b/types/varint/index.d.ts new file mode 100644 index 0000000000..ec490a2e70 --- /dev/null +++ b/types/varint/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for varint 5.0 +// Project: https://github.com/chrisdickinson/varint#readme +// Definitions by: David Brockman Smoliansky +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export const encode: { + /** + * Encodes `num` into `buffer` starting at `offset`. returns `buffer`, with the encoded varint written into it. + * `varint.encode.bytes` will now be set to the number of bytes modified. + */ + (num: number, buffer: Buffer, offset?: number): Buffer; + + /** + * Encodes `num` into `array` starting at `offset`. returns `array`, with the encoded varint written into it. + * If `array` is not provided, it will default to a new array. + * `varint.encode.bytes` will now be set to the number of bytes modified. + */ + (num: number, array?: number[], offset?: number): number[]; + + /** + * Similar to `decode.bytes` when encoding a number it can be useful to know how many bytes where written (especially if you pass an output array). + * You can access this via `varint.encode.bytes` which holds the number of bytes written in the last encode. + */ + bytes: number; +}; + +export const decode: { + /** + * Decodes `data`, which can be either a buffer or array of integers, from position `offset` or default 0 and returns the decoded original integer. + * Throws a `RangeError` when `data` does not represent a valid encoding. + */ + (buf: Buffer | number[], offset?: number): number; + + /** + * If you also require the length (number of bytes) that were required to decode the integer you can access it via `varint.decode.bytes`. + * This is an integer property that will tell you the number of bytes that the last .decode() call had to use to decode. + */ + bytes: number; +}; + +/** + * returns the number of bytes this number will be encoded as, up to a maximum of 8. + */ +export function encodingLength(num: number): number; diff --git a/types/varint/tsconfig.json b/types/varint/tsconfig.json new file mode 100644 index 0000000000..269a7016fe --- /dev/null +++ b/types/varint/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "varint-tests.ts"] +} diff --git a/types/varint/tslint.json b/types/varint/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/varint/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/varint/varint-tests.ts b/types/varint/varint-tests.ts new file mode 100644 index 0000000000..4ef8c91753 --- /dev/null +++ b/types/varint/varint-tests.ts @@ -0,0 +1,17 @@ +import { decode, encode, encodingLength } from 'varint'; + +encode(0); // $ExpectType number[] +encode(0, []); // $ExpectType number[] +encode(0, [], 0); // $ExpectType number[] + +encode(0, Buffer.alloc(1)); // $ExpectType Buffer +encode(0, Buffer.alloc(1), 0); // $ExpectType Buffer + +encode.bytes; // $ExpectType number + +decode(Buffer.alloc(1)); // $ExpectType number +decode(Buffer.alloc(1), 0); // $ExpectType number + +decode.bytes; // $ExpectType number + +encodingLength(0); // $ExpectType number From b48b1c803bf0eeeaad90579404450b24a3afa437 Mon Sep 17 00:00:00 2001 From: Thomas den Hollander Date: Mon, 13 Aug 2018 17:56:46 +0200 Subject: [PATCH 153/346] Add author note --- types/ttf2woff2/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ttf2woff2/index.d.ts b/types/ttf2woff2/index.d.ts index be49b9099d..180c64f93e 100644 --- a/types/ttf2woff2/index.d.ts +++ b/types/ttf2woff2/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for ttf2woff2 2.0 // Project: https://github.com/nfroidure/ttf2woff2 -// Definitions by: My Self +// Definitions by: Thomas den Hollander // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 3c8f15080c5728847c627ba07a623276ef1869ab Mon Sep 17 00:00:00 2001 From: Tim Schoenheider Date: Mon, 13 Aug 2018 11:11:44 -0500 Subject: [PATCH 154/346] add timeout to http.AgentOptions (#27946) --- types/node/index.d.ts | 6 +++++- types/node/node-tests.ts | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index d94de3d10a..7745372a21 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 10.5.x +// Type definitions for Node.js 10.7.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -1248,6 +1248,10 @@ declare module "http" { * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. */ maxFreeSockets?: number; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number; } export class Agent { diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index c6ab3f9551..ce46e31654 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -1691,7 +1691,8 @@ namespace http_tests { keepAlive: true, keepAliveMsecs: 10000, maxSockets: Infinity, - maxFreeSockets: 256 + maxFreeSockets: 256, + timeout: 15000 }); var agent: http.Agent = http.globalAgent; @@ -1748,7 +1749,8 @@ namespace https_tests { keepAliveMsecs: 10000, maxSockets: Infinity, maxFreeSockets: 256, - maxCachedSessions: 100 + maxCachedSessions: 100, + timeout: 15000 }); var agent: https.Agent = https.globalAgent; From ddb90ccfe1024100a686b271b7a27a300a0a9041 Mon Sep 17 00:00:00 2001 From: Geoff Cameron Date: Mon, 13 Aug 2018 14:18:26 -0400 Subject: [PATCH 155/346] Add tests --- types/angular/angular-tests.ts | 14 ++++++++++++++ types/angular/index.d.ts | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index f2aad6bb59..44f8539af2 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -311,8 +311,10 @@ namespace TestQ { } const abcObject: AbcObject = null; const abcObjectPromise: angular.IPromise = null; + const abcObjectPromiseLike: PromiseLike = null; const efObject: EfObject = null; const efObjectPromise: angular.IPromise = null; + const efObjectPromiseLike: PromiseLike = null; const ghObject: GhObject = null; const ghObjectPromise: angular.IPromise = null; @@ -404,6 +406,7 @@ namespace TestQ { result = $q.when(abcObject); result = $q.when(abcObjectPromise); + result = $q.when(abcObjectPromiseLike); result = $q.when(efObject, (result: EfObject) => abcObject); result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); @@ -416,10 +419,21 @@ namespace TestQ { resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 1f7437a02d..99977b57b5 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1154,9 +1154,9 @@ declare namespace angular { */ when(value: PromiseLike|T): IPromise; when(value: PromiseLike|T2): IPromise; - when(value: PromiseLike|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; - when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: PromiseLike, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike|T, successCallback: (promiseValue: T) => PromiseLike|TResult): IPromise; + when(value: T, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: (reason: any) => TResult2 | PromiseLike, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ From f77583e076ca67f11e533b54e6a7e972c2ed1233 Mon Sep 17 00:00:00 2001 From: Dan Freeman Date: Mon, 13 Aug 2018 14:34:47 -0400 Subject: [PATCH 156/346] [graphql-resolve-batch] Batch resolvers receive ResolveInfo --- types/graphql-resolve-batch/graphql-resolve-batch-tests.ts | 4 +++- types/graphql-resolve-batch/index.d.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts b/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts index 9043cdaf0e..51f8964423 100644 --- a/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts +++ b/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts @@ -95,13 +95,15 @@ const withSourceAndArgsAndContextTyped = createBatchResolver< SomeTestResult, SomeTestArgs, SomeTestContext ->(async (sources, args, context) => { +>(async (sources, args, context, info) => { // $ExpectType ReadonlyArray const verifySources = sources; // $ExpectType string const verifyArgs = args.someArg; // $ExpectType string const verifyContext = context.someContextProp; + // $ExpectType GraphQLResolveInfo + const verifyInfo = info; const result = await asyncBatchFunction(sources); return result; diff --git a/types/graphql-resolve-batch/index.d.ts b/types/graphql-resolve-batch/index.d.ts index ea90a83555..9908b7082a 100644 --- a/types/graphql-resolve-batch/index.d.ts +++ b/types/graphql-resolve-batch/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { GraphQLResolveInfo } from 'graphql'; + /** * Creates a GraphQL.js field resolver that batches together multiple resolves * together that share the *exact* same GraphQL field selection. @@ -45,5 +47,6 @@ export type ResolverFunction = ( export type BatchResolveFunction = ( sources: ReadonlyArray, args: TArgs, - context: TContext + context: TContext, + info: GraphQLResolveInfo ) => TReturn[] | Promise; From 5e4b49da0188ea9ffcfa6fce4fbe116b5861e9bb Mon Sep 17 00:00:00 2001 From: Konrad Mattheis Date: Mon, 13 Aug 2018 20:47:17 +0200 Subject: [PATCH 157/346] Add missing INxInfo close DefinitelyTyped/DefinitelyTyped#28078 --- types/qlik-engineapi/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/qlik-engineapi/index.d.ts b/types/qlik-engineapi/index.d.ts index 115802a935..bf2355e88f 100644 --- a/types/qlik-engineapi/index.d.ts +++ b/types/qlik-engineapi/index.d.ts @@ -9265,6 +9265,7 @@ declare namespace EngineAPI { * DimensionItemLayout... */ interface IDimensionItemLayout { + qInfo: INxInfo; qMeta: INxMetaTitleDescriptionTag; qData: null; } From 181f4d59223d0aee1b272908576211433af69a82 Mon Sep 17 00:00:00 2001 From: Sam Baeck <> Date: Mon, 13 Aug 2018 22:23:10 +0200 Subject: [PATCH 158/346] Added typings for react-router-hash-link --- types/react-router-hash-link/index.d.ts | 18 +++++++++++++++ .../react-router-hash-link-tests.ts | 23 +++++++++++++++++++ types/react-router-hash-link/tsconfig.json | 23 +++++++++++++++++++ types/react-router-hash-link/tslint.json | 1 + 4 files changed, 65 insertions(+) create mode 100644 types/react-router-hash-link/index.d.ts create mode 100644 types/react-router-hash-link/react-router-hash-link-tests.ts create mode 100644 types/react-router-hash-link/tsconfig.json create mode 100644 types/react-router-hash-link/tslint.json diff --git a/types/react-router-hash-link/index.d.ts b/types/react-router-hash-link/index.d.ts new file mode 100644 index 0000000000..545a31cc71 --- /dev/null +++ b/types/react-router-hash-link/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for react-router-hash-link 1.2 +// Project: https://github.com/rafrex/react-router-hash-link (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: Sam Baeck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from 'react'; +import { LinkProps, NavLinkProps } from 'react-router-dom'; + +export interface HashLinkProps extends LinkProps { + smooth?: boolean; + scroll?: (element: HTMLElement) => void; +} + +export class HashLink extends React.Component {} + +export interface NavHashLinkProps extends NavLinkProps, HashLinkProps {} + +export class NavHashLink extends React.Component {} diff --git a/types/react-router-hash-link/react-router-hash-link-tests.ts b/types/react-router-hash-link/react-router-hash-link-tests.ts new file mode 100644 index 0000000000..7825bbf6c4 --- /dev/null +++ b/types/react-router-hash-link/react-router-hash-link-tests.ts @@ -0,0 +1,23 @@ +import * as H from 'history'; +import * as React from 'react'; +import { match } from 'react-router'; +import { HashLink, NavHashLink, NavHashLinkProps } from 'react-router-hash-link'; + +interface Props extends NavHashLinkProps { + extraProp: string; +} + +const getIsActive = (extraProp: string) => (match: match, location: H.Location) => !!extraProp; + +export default function (props: Props) { + const {extraProp, ...rest} = props; + const isActive = getIsActive(extraProp); + return ( + +); +} + + + +const acceptRef = (node: HTMLAnchorElement | null) => {}; +; \ No newline at end of file diff --git a/types/react-router-hash-link/tsconfig.json b/types/react-router-hash-link/tsconfig.json new file mode 100644 index 0000000000..71c139a0f0 --- /dev/null +++ b/types/react-router-hash-link/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-router-hash-link-tests.ts" + ] +} diff --git a/types/react-router-hash-link/tslint.json b/types/react-router-hash-link/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-router-hash-link/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From e04532a2b1e77c4b9e9276b54313e397e96caae9 Mon Sep 17 00:00:00 2001 From: Sam Baeck <> Date: Mon, 13 Aug 2018 22:30:23 +0200 Subject: [PATCH 159/346] added strictFunctionTypes": true to tsconfig --- types/react-router-hash-link/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-router-hash-link/tsconfig.json b/types/react-router-hash-link/tsconfig.json index 71c139a0f0..892d3999e3 100644 --- a/types/react-router-hash-link/tsconfig.json +++ b/types/react-router-hash-link/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From d29b89c1a85b0d7379affaab5abdd45aa68effb1 Mon Sep 17 00:00:00 2001 From: Sam Baeck <> Date: Mon, 13 Aug 2018 22:49:28 +0200 Subject: [PATCH 160/346] updated tsconfig, fixed broken tests --- types/react-router-hash-link/index.d.ts | 1 + ...link-tests.ts => react-router-hash-link-tests.tsx} | 11 ++++++----- types/react-router-hash-link/tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) rename types/react-router-hash-link/{react-router-hash-link-tests.ts => react-router-hash-link-tests.tsx} (72%) diff --git a/types/react-router-hash-link/index.d.ts b/types/react-router-hash-link/index.d.ts index 545a31cc71..9480f1aef0 100644 --- a/types/react-router-hash-link/index.d.ts +++ b/types/react-router-hash-link/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rafrex/react-router-hash-link (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) // Definitions by: Sam Baeck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 import * as React from 'react'; import { LinkProps, NavLinkProps } from 'react-router-dom'; diff --git a/types/react-router-hash-link/react-router-hash-link-tests.ts b/types/react-router-hash-link/react-router-hash-link-tests.tsx similarity index 72% rename from types/react-router-hash-link/react-router-hash-link-tests.ts rename to types/react-router-hash-link/react-router-hash-link-tests.tsx index 7825bbf6c4..4c64a1b5c3 100644 --- a/types/react-router-hash-link/react-router-hash-link-tests.ts +++ b/types/react-router-hash-link/react-router-hash-link-tests.tsx @@ -9,15 +9,16 @@ interface Props extends NavHashLinkProps { const getIsActive = (extraProp: string) => (match: match, location: H.Location) => !!extraProp; -export default function (props: Props) { +export default function(props: Props) { const {extraProp, ...rest} = props; const isActive = getIsActive(extraProp); return ( -); + ); } - +; -const acceptRef = (node: HTMLAnchorElement | null) => {}; -; \ No newline at end of file +const acceptRef = (node: HTMLAnchorElement | null) => { +}; +; diff --git a/types/react-router-hash-link/tsconfig.json b/types/react-router-hash-link/tsconfig.json index 892d3999e3..fc830ac41d 100644 --- a/types/react-router-hash-link/tsconfig.json +++ b/types/react-router-hash-link/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "react-router-hash-link-tests.ts" + "react-router-hash-link-tests.tsx" ] } From d742fa855e846576e7e169a13e232d53bbf61948 Mon Sep 17 00:00:00 2001 From: SMores Date: Mon, 13 Aug 2018 17:45:14 -0400 Subject: [PATCH 161/346] Add types for Templatizer to Polymer (#27823) * Add types for Templatizer to Polymer Polymer was missing the typings for Templatizer, the behavior that provides helpers for working with template elements in Polymer components. This adds types for its public interface. * Add tests for new templatizer types * Fix modelForElement type to just be Polymer.Base The closure types here: https://github.com/Polymer/polymer/blob/1.x/src/lib/template/templatizer.html incorrectly suggest that modelForElement returns an `Object`, but in fact it just returns `Polymer.Base` --- types/polymer/index.d.ts | 14 +++++++++++--- types/polymer/polymer-tests.ts | 7 +++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index 569842066a..1b67f4c6d5 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -263,7 +263,7 @@ declare global { setAttribute(name: string, value: any):void; removeAttribute(name: string):void; - + observeNodes(callback: (info: ObservedNodeInfo) => void): {}; unobserveNodes(observer: {}): void; @@ -340,6 +340,12 @@ declare global { whenLoaded(cb: Function): void; } + interface Templatizer { + templatize(template: HTMLTemplateElement, mutableData?: boolean): void; + stamp(model: {}): Base; + modelForElement: (elem: HTMLElement) => Base; + } + interface PolymerStatic { Settings: Settings; @@ -351,12 +357,14 @@ declare global { Class(prototype: Base | { new (): Base }): CustomElementConstructor; - RenderStatus: RenderStatus + RenderStatus: RenderStatus; ArraySplice: ArraySplice; /** @deprecated */ - ImportStatus: ImportStatus + ImportStatus: ImportStatus; + + Templatizer: Templatizer; } } diff --git a/types/polymer/polymer-tests.ts b/types/polymer/polymer-tests.ts index 2b6631ffb7..ce55ac325d 100644 --- a/types/polymer/polymer-tests.ts +++ b/types/polymer/polymer-tests.ts @@ -1,6 +1,8 @@ Polymer({ is: "my-element", + behaviors: [Polymer.Templatizer], + properties: { prop1: String, prop2: { @@ -24,6 +26,11 @@ Polymer({ }, ready: function () { + const template = Polymer.dom(this).querySelector('template'); + if (template) { + this.templatize(template); + const instance = this.stamp({item: {}}); + } this.textContent = 'My element!'; this.$.name.textContent = this.name; this.serialize({}); From 9debe9348817c64984a21226d4d31069e41a3de9 Mon Sep 17 00:00:00 2001 From: Abraham White Date: Mon, 13 Aug 2018 16:32:14 -0600 Subject: [PATCH 162/346] Fix SObject bulk operation signatures --- types/jsforce/jsforce-tests.ts | 86 ++++++++++++++++++++++++++++ types/jsforce/salesforce-object.d.ts | 24 +++----- 2 files changed, 95 insertions(+), 15 deletions(-) diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 886bd012c0..8e572448b4 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -273,6 +273,92 @@ async function testSObject(connection: sf.Connection) { }); } + { // Test SObject.createBulk + // $ExpectType Batch + dummySObject.createBulk(); + // $ExpectType Batch + dummySObject.createBulk('hi.csv'); + // $ExpectType Batch + dummySObject.createBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.createBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.createBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.deleteBulk and aliases + // $ExpectType Batch + dummySObject.deleteBulk(); + // $ExpectType Batch + dummySObject.deleteBulk('hi.csv'); + // $ExpectType Batch + dummySObject.deleteBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.deleteBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.deleteBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + + // $ExpectType Batch + dummySObject.destroyBulk(); + // $ExpectType Batch + dummySObject.destroyBulk('hi.csv'); + // $ExpectType Batch + dummySObject.destroyBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.destroyBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.destroyBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + + { // Test SObject.deleteHardBulk and aliases + // $ExpectType Batch + dummySObject.deleteHardBulk(); + // $ExpectType Batch + dummySObject.deleteHardBulk('hi.csv'); + // $ExpectType Batch + dummySObject.deleteHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.deleteHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.deleteHardBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + + // $ExpectType Batch + dummySObject.destroyHardBulk(); + // $ExpectType Batch + dummySObject.destroyHardBulk('hi.csv'); + // $ExpectType Batch + dummySObject.destroyHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }]); + // $ExpectType Batch + dummySObject.destroyHardBulk([{ Id: 'hi', thing: true, other: 1, person: 'you' }], (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + dummySObject.destroyHardBulk('hi.csv', (err, res) => { + err; // $ExpectType Error | null + res; // $ExpectType RecordResult[] + }); + } + { // Test SObject.destroy and aliases // $ExpectType RecordResult await dummySObject.del('Id'); diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 2015f5d79b..a2f1c5dffd 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -21,7 +21,7 @@ export class SObject { update(record: Partial, options?: RestApiOptions, callback?: Callback): Promise; update(records: Array>, callback?: Callback): Promise; update(records: Array>, options?: RestApiOptions, callback?: Callback): Promise; - // FIXME: should input really be optional? the documentation says so, but how can you actually update without it? + // should input really be optional? the documentation says so, but how can you actually update without it? updateBulk(input?: Record[] | stream.Stream | string, callback?: Callback): Batch; updated(start: string | Date, end: string | Date, callback?: Callback): Promise; upsert(records: Record, extIdField: string, callback?: Callback): Promise; @@ -51,28 +51,23 @@ export class SObject { clear(): void; } compactLayouts(callback?: Callback): Promise; - count(conditions?: Object | string, callback?: Callback): Query; + count(conditions?: object | string, callback?: Callback): Query; create(record: T, options?: RestApiOptions, callback?: Callback): Promise; create(record: T, callback?: Callback): Promise; create(record: Array, options?: RestApiOptions, callback?: Callback): Promise; create(record: Array, callback?: Callback): Promise; - // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? - createBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + createBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; del(id: string, callback?: Callback): Promise; del(ids: string[], callback?: Callback): Promise; destroy(id: string, callback?: Callback): Promise; destroy(ids: string[], callback?: Callback): Promise; delete(id: string, callback?: Callback): Promise; delete(ids: string[], callback?: Callback): Promise; - // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? - deleteBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; - // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? - destroyBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; - // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? - destroyHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + deleteBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + destroyBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + destroyHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; deleted(start: Date | string, end: Date | string, callback?: Callback): Promise; - // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? - deleteHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + deleteHardBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; describe(callback?: Callback): Promise; describe$: { /** Returns a value from the cache if it exists, otherwise calls SObject.describe */ @@ -81,7 +76,7 @@ export class SObject { } insert(record: Record, callback?: Callback): Promise; insert(records: Array>, callback?: Callback): Promise; - insertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; + insertBulk(input?: Array> | stream.Stream | string, callback?: Callback): Batch; /** Returns a value from the cache if it exists, otherwise calls SObject.layouts */ layouts$: { (layoutName?: string, callback?: Callback): LayoutInfo; @@ -92,8 +87,7 @@ export class SObject { listviews(callback?: Callback): Promise; quickAction(actionName: string): QuickAction; quickActions(callback?: Callback): Promise; - // FIXME: why does the callback return a single RecordResult instead of an array as in the documentation? - recent(callback?: Callback): Promise; + recent(callback?: Callback): Promise; select(callback?: Callback): Query; // TODO:use a typed pluck to turn `fields` into a subset of T's fields so that the output is slimmed down appropriately select(fields?: {[P in keyof T]: boolean} | Array<(keyof T)> | (keyof T), callback?: Callback>>): Query>>; From d74f769a0a0e805b599fd99c5967ae4b4bedc580 Mon Sep 17 00:00:00 2001 From: Adam Lavin Date: Tue, 14 Aug 2018 00:22:58 +0100 Subject: [PATCH 163/346] styled-system: Remove styled-components as a dependency for tests --- types/styled-system/package.json | 6 ------ types/styled-system/styled-system-tests.tsx | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 types/styled-system/package.json diff --git a/types/styled-system/package.json b/types/styled-system/package.json deleted file mode 100644 index da1a3181d0..0000000000 --- a/types/styled-system/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "styled-components": "^3.3.2" - } -} diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index 6062948a50..d931fd34f8 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -1,6 +1,5 @@ // Example uses styled-components, but styled-system works with most other css-in-js libraries as well import * as React from "react"; -import styled from "styled-components"; import { themeGet, space, @@ -125,6 +124,11 @@ import { MixedProps, } from "styled-system"; +// tslint:disable-next-line:strict-export-declare-modifiers +declare type StyledFunction = (...props: any[]) => React.ComponentType; +// tslint:disable-next-line:strict-export-declare-modifiers +declare const styled: StyledFunction; + const boxStyle = variant({ prop: 'boxStyle', key: 'box', @@ -168,9 +172,8 @@ interface BoxProps MixedProps { boxStyle?: string; } -const Box = styled.div.attrs({})` - -border-radius: ${themeGet("radii.small", "4px")}; +const Box: React.ComponentType = styled` + border-radius: ${themeGet("radii.small", "4px")}; ${space} ${width} ${fontSize} @@ -226,7 +229,7 @@ interface TextProps LineHeightProps, FontWeightProps, LetterSpacingProps {} -const Text = styled.div.attrs({})` +const Text: React.ComponentType = styled` ${fontSize}; ${fontFamily}; ${textAlign}; @@ -242,7 +245,7 @@ interface FlexComponentProps FlexWrapProps, FlexBasisProps, FlexDirectionProps {} -const Flex = styled.div.attrs({})` +const Flex: React.ComponentType = styled` ${alignItems}; ${alignContent}; ${justifyContent}; @@ -262,7 +265,7 @@ interface GridComponentProps GridAutoRowsProps, GridTemplatesRowsProps, GridTemplatesColumnsProps {} -const Grid = styled.div.attrs({})` +const Grid: React.ComponentType = styled` ${gridGap}; ${gridRowGap}; ${gridColumnGap}; @@ -279,7 +282,7 @@ interface ButtonProps extends SpaceProps, ButtonStyleProps {} -const TestButton = styled.button.attrs({})` +const TestButton: React.ComponentType = styled` ${buttonStyle} ${space} `; From b73a0d38b81c40d6ba8ddfff03a0f9c38b42bbc4 Mon Sep 17 00:00:00 2001 From: Adam Lavin Date: Tue, 14 Aug 2018 00:27:17 +0100 Subject: [PATCH 164/346] Remove unnecessary type in test --- types/styled-system/styled-system-tests.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index d931fd34f8..e16b90665d 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -125,9 +125,7 @@ import { } from "styled-system"; // tslint:disable-next-line:strict-export-declare-modifiers -declare type StyledFunction = (...props: any[]) => React.ComponentType; -// tslint:disable-next-line:strict-export-declare-modifiers -declare const styled: StyledFunction; +declare const styled: (...props: any[]) => React.ComponentType; const boxStyle = variant({ prop: 'boxStyle', From 8f3a3fe440e9a9b84650f222580a05f92ebe7804 Mon Sep 17 00:00:00 2001 From: Ross Solomon Date: Mon, 13 Aug 2018 17:15:29 -0700 Subject: [PATCH 165/346] Add definition for shallow-equals --- .github/CODEOWNERS | 1 + types/shallow-equals/index.d.ts | 16 ++++++++++++++++ types/shallow-equals/shallow-equals-tests.ts | 10 ++++++++++ types/shallow-equals/tsconfig.json | 16 ++++++++++++++++ types/shallow-equals/tslint.json | 3 +++ 5 files changed, 46 insertions(+) create mode 100644 types/shallow-equals/index.d.ts create mode 100644 types/shallow-equals/shallow-equals-tests.ts create mode 100644 types/shallow-equals/tsconfig.json create mode 100644 types/shallow-equals/tslint.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8c7f823a07..d15d79bc9d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3968,6 +3968,7 @@ /types/set-value/ @DanielRosenwasser /types/settings/ @shreyjain1994 /types/sha1/ @arcdev1 +/types/shallow-equals/ @rsolomon /types/shallowequal/ @seansfkelley /types/shapefile/ @DenisCarriere /types/sharedworker/ @nakakura diff --git a/types/shallow-equals/index.d.ts b/types/shallow-equals/index.d.ts new file mode 100644 index 0000000000..126366f74f --- /dev/null +++ b/types/shallow-equals/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for shallow-equals v1.0.0 +// Project: https://github.com/hughsk/shallow-equals +// Definitions by: Ross Solomon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function shallowEquals( + a?: A, + b?: B, + compare?: (objA?: A, objB?: B) => boolean, +): boolean; + +declare namespace shallowEquals { + +} + +export = shallowEquals; diff --git a/types/shallow-equals/shallow-equals-tests.ts b/types/shallow-equals/shallow-equals-tests.ts new file mode 100644 index 0000000000..092e3557e1 --- /dev/null +++ b/types/shallow-equals/shallow-equals-tests.ts @@ -0,0 +1,10 @@ +import shallowEquals = require('shallow-equals'); + +const a = {}; +const b = {}; +function compare(a: object, b: object) { + return false; +} + +shallowEquals(a, b); +shallowEquals(a, b, compare); diff --git a/types/shallow-equals/tsconfig.json b/types/shallow-equals/tsconfig.json new file mode 100644 index 0000000000..74f59acd72 --- /dev/null +++ b/types/shallow-equals/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "shallow-equals-tests.ts"] +} diff --git a/types/shallow-equals/tslint.json b/types/shallow-equals/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/shallow-equals/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 7b6c32205b377b1c47937a8a84e6f1da0acb8feb Mon Sep 17 00:00:00 2001 From: Gustavo Brunoro Date: Mon, 13 Aug 2018 20:56:03 -0300 Subject: [PATCH 166/346] react-navigation: add NavigationEvents component --- types/react-navigation/index.d.ts | 11 +++++++++++ types/react-navigation/react-navigation-tests.tsx | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 6e286c2217..c5ae635725 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -21,6 +21,7 @@ // Ullrich Schaefer // Yosuke Seki // Jake +// Gustavo Brunoro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -564,6 +565,16 @@ export interface NavigationEventSubscription { remove: () => void; } +export interface NavigationEventsProps extends ViewProps { + navigation?: NavigationNavigator; + onWillFocus?: NavigationEventCallback; + onDidFocus?: NavigationEventCallback; + onWillBlur?: NavigationEventCallback; + onDidBlur?: NavigationEventCallback; +} + +export const NavigationEvents: React.ComponentType; + export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 3cde3d892c..0bd5461c6e 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -11,6 +11,7 @@ import { DrawerNavigatorConfig, NavigationAction, NavigationActions, + NavigationEvents, NavigationBackAction, NavigationInitAction, NavigationNavigateAction, @@ -581,3 +582,14 @@ createStackNavigator( routeConfigMap, {transitionConfig: () => ({screenInterpolator: StackViewTransitionConfigs.SlideFromRightIOS.screenInterpolator})} ); + +// Test NavigationEvents component + +const ViewWithNavigationEvents = ( + +); From 193bd151a15c9bbd81f938136eea24a26b575c5a Mon Sep 17 00:00:00 2001 From: Ross Solomon Date: Mon, 13 Aug 2018 17:26:00 -0700 Subject: [PATCH 167/346] Use generator --- types/shallow-equals/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/shallow-equals/index.d.ts b/types/shallow-equals/index.d.ts index 126366f74f..87c4145585 100644 --- a/types/shallow-equals/index.d.ts +++ b/types/shallow-equals/index.d.ts @@ -3,14 +3,14 @@ // Definitions by: Ross Solomon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function shallowEquals( +export = shallow_equals; + +declare function shallow_equals( a?: A, b?: B, compare?: (objA?: A, objB?: B) => boolean, ): boolean; -declare namespace shallowEquals { +declare namespace shallow_equals { } - -export = shallowEquals; From 2fe4a041ad416d25f667aa421e1f7d572dd20582 Mon Sep 17 00:00:00 2001 From: Ross Solomon Date: Mon, 13 Aug 2018 17:40:37 -0700 Subject: [PATCH 168/346] Fix prettier mistakes --- types/shallow-equals/index.d.ts | 12 +++++------- types/shallow-equals/shallow-equals-tests.ts | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/types/shallow-equals/index.d.ts b/types/shallow-equals/index.d.ts index 87c4145585..69e1a6c552 100644 --- a/types/shallow-equals/index.d.ts +++ b/types/shallow-equals/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for shallow-equals v1.0.0 +// Type definitions for shallow-equals 1.0 // Project: https://github.com/hughsk/shallow-equals // Definitions by: Ross Solomon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,11 +6,9 @@ export = shallow_equals; declare function shallow_equals( - a?: A, - b?: B, - compare?: (objA?: A, objB?: B) => boolean, + a?: A, + b?: B, + compare?: (objA?: A, objB?: B) => boolean, ): boolean; -declare namespace shallow_equals { - -} +declare namespace shallow_equals {} diff --git a/types/shallow-equals/shallow-equals-tests.ts b/types/shallow-equals/shallow-equals-tests.ts index 092e3557e1..87512c9f43 100644 --- a/types/shallow-equals/shallow-equals-tests.ts +++ b/types/shallow-equals/shallow-equals-tests.ts @@ -1,9 +1,18 @@ import shallowEquals = require('shallow-equals'); -const a = {}; -const b = {}; -function compare(a: object, b: object) { - return false; +interface A { + foo: string; +} + +interface B { + foo: string; + bar?: string; +} + +const a: A = { foo: 'bar' }; +const b: B = { foo: 'baz' }; +function compare(a: A, b: B) { + return false; } shallowEquals(a, b); From aeb446e0bfc0ae94268414cd005ae52881b0a5ca Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Aug 2018 19:45:09 -0500 Subject: [PATCH 169/346] Update emoji-mart types for v2.8.0 --- .../dist-es/components/category.d.ts | 7 +- .../emoji-mart/dist-es/components/emoji.d.ts | 31 ------- .../dist-es/components/emoji/emoji.d.ts | 8 ++ .../components/emoji/nimble-emoji.d.ts | 12 +++ .../emoji-mart/dist-es/components/index.d.ts | 6 +- .../emoji-mart/dist-es/components/picker.d.ts | 54 ------------ .../components/picker/nimble-picker.d.ts | 11 +++ .../dist-es/components/picker/picker.d.ts | 7 ++ types/emoji-mart/dist-es/index.d.ts | 26 ++++-- types/emoji-mart/dist-es/utils/data.d.ts | 73 ++++++++++++++++ .../emoji-mart/dist-es/utils/emoji-index.d.ts | 25 ------ .../utils/emoji-index/emoji-index.d.ts | 14 ++++ .../dist-es/utils/emoji-index/index.d.ts | 2 + .../utils/emoji-index/nimble-emoji-index.d.ts | 40 +++++++++ .../dist-es/utils/shared-props.d.ts | 83 +++++++++++++++++++ types/emoji-mart/emoji-mart-tests.tsx | 4 +- types/emoji-mart/index.d.ts | 7 +- types/emoji-mart/tsconfig.json | 12 ++- 18 files changed, 291 insertions(+), 131 deletions(-) delete mode 100644 types/emoji-mart/dist-es/components/emoji.d.ts create mode 100644 types/emoji-mart/dist-es/components/emoji/emoji.d.ts create mode 100644 types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts delete mode 100644 types/emoji-mart/dist-es/components/picker.d.ts create mode 100644 types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts create mode 100644 types/emoji-mart/dist-es/components/picker/picker.d.ts create mode 100644 types/emoji-mart/dist-es/utils/data.d.ts delete mode 100644 types/emoji-mart/dist-es/utils/emoji-index.d.ts create mode 100644 types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts create mode 100644 types/emoji-mart/dist-es/utils/emoji-index/index.d.ts create mode 100644 types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts create mode 100644 types/emoji-mart/dist-es/utils/shared-props.d.ts diff --git a/types/emoji-mart/dist-es/components/category.d.ts b/types/emoji-mart/dist-es/components/category.d.ts index 8cd4ceefbb..cde72441bf 100644 --- a/types/emoji-mart/dist-es/components/category.d.ts +++ b/types/emoji-mart/dist-es/components/category.d.ts @@ -1,12 +1,11 @@ -import React = require('react'); +import * as React from 'react'; -import { EmojiData } from '..'; - -import { Emoji, EmojiProps, I18n } from '.'; +import { Emoji, EmojiData, EmojiProps, I18n } from '..'; export interface Props { emojis?: Array; hasStickyPosition?: boolean; + id: string; name: string; native: boolean; perLine: number; diff --git a/types/emoji-mart/dist-es/components/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji.d.ts deleted file mode 100644 index 030ff7ce12..0000000000 --- a/types/emoji-mart/dist-es/components/emoji.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import React = require('react'); - -import { EmojiData, EmojiSkin } from '..'; - -export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; -export type EmojiSet = 'apple'|'google'|'twitter'|'emojione'|'messenger'|'facebook'; -export type EmojiSheetSize = 16|20|32|64; - -export interface Props { - onOver?(emoji: EmojiData, e: React.MouseEvent): void; - onLeave?(emoji: EmojiData, e: React.MouseEvent): void; - onClick?(emoji: EmojiData, e: React.MouseEvent): void; - /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ - backgroundImageFn?: BackgroundImageFn; - native?: boolean; - forceSize?: boolean; - tooltip?: boolean; - /** defaults to 1 */ - skin?: EmojiSkin; - /** defaults to 64 */ - sheetSize?: EmojiSheetSize; - /** defaults to 'apple' */ - set?: EmojiSet; - size: number; - emoji: string|EmojiData; -} - -// tslint:disable-next-line strict-export-declare-modifiers -declare const Emoji: React.SFC; - -export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/emoji/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts new file mode 100644 index 0000000000..78ca216af6 --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; + +import { EmojiProps } from '../..'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const Emoji: React.StatelessComponent; + +export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts new file mode 100644 index 0000000000..03b9d3730f --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts @@ -0,0 +1,12 @@ +import * as React from 'react'; + +import { EmojiProps, Data } from '../..'; + +export interface NimbleEmojiProps extends EmojiProps { + data: Data; +} + +// tslint:disable-next-line strict-export-declare-modifiers +declare const NimbleEmoji: React.SFC; + +export { NimbleEmoji as default }; diff --git a/types/emoji-mart/dist-es/components/index.d.ts b/types/emoji-mart/dist-es/components/index.d.ts index 6fc29ecd54..3f05ca5c82 100644 --- a/types/emoji-mart/dist-es/components/index.d.ts +++ b/types/emoji-mart/dist-es/components/index.d.ts @@ -1,4 +1,6 @@ // The other exports on the components folder are not public API export { default as Category, Props as CategoryProps } from './category'; -export { default as Emoji, Props as EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from './emoji'; -export { default as Picker, Props as PickerProps, I18n, PartialI18n, CustomEmoji } from './picker'; +export { default as Emoji } from './emoji/emoji'; +export { default as NimbleEmoji, NimbleEmojiProps } from './emoji/nimble-emoji'; +export { default as Picker } from './picker/picker'; +export { default as NimblePicker, NimblePickerProps } from './picker/nimble-picker'; diff --git a/types/emoji-mart/dist-es/components/picker.d.ts b/types/emoji-mart/dist-es/components/picker.d.ts deleted file mode 100644 index 9f9132df05..0000000000 --- a/types/emoji-mart/dist-es/components/picker.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import React = require('react'); - -import { EmojiData, EmojiSkin } from '..'; - -import { Category, Emoji, EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from '.'; - -// tslint:disable-next-line interface-name -export interface I18n { - search: string; - categories: Record<'search'|'recent'|'people'|'nature'|'foods'|'activity'|'places'|'objects'|'symbols'|'flags'|'custom', string>; - notfound: string; -} - -export type PartialI18n = Partial & { categories: Partial}>; - -export interface CustomEmoji { - // id is overridden by short_names[0] - name: string; - /** Must contain at least one name. The first name is used as the unique id. */ - short_names: string[]; - emoticons?: string[]; - keywords?: string[]; - imageUrl: string; -} - -export interface Props { - /** NOTE: default is not preventable */ - onClick?(emoji: EmojiData, e: React.MouseEvent): void; - perLine?: number; - emojiSize?: number; - i18n?: PartialI18n; - style?: React.CSSProperties; - title?: string; - emoji?: string; - color?: string; - set?: EmojiSet; - skin?: EmojiSkin; - native?: boolean; - backgroundImageFn?: BackgroundImageFn; - sheetSize?: EmojiSheetSize; - emojisToShowFilter?(emoji: EmojiData): boolean; - showPreview?: boolean; - emojiTooltip?: boolean; - include?: string[]; - exclude?: string[]; - recent?: string[]; - autoFocus?: boolean; - /** NOTE: custom emoji are copied into a singleton object on every new mount */ - custom: CustomEmoji[]; -} - -export default class Picker extends React.PureComponent { - // everything inside it is supposed to be private -} diff --git a/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts new file mode 100644 index 0000000000..4f286a12ca --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; + +import { Data, PickerProps } from '../..'; + +export interface NimblePickerProps extends PickerProps { + data: Data; +} + +export default class NimblePicker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/components/picker/picker.d.ts b/types/emoji-mart/dist-es/components/picker/picker.d.ts new file mode 100644 index 0000000000..81841b19d6 --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker/picker.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; + +import { PickerProps } from '../..'; + +export default class Picker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/index.d.ts b/types/emoji-mart/dist-es/index.d.ts index e49d37fcf6..bfc61354dd 100644 --- a/types/emoji-mart/dist-es/index.d.ts +++ b/types/emoji-mart/dist-es/index.d.ts @@ -1,15 +1,29 @@ -export { default as emojiIndex, EmojiData, EmojiSkin } from './utils/emoji-index'; export { default as store, StoreHandlers } from './utils/store'; export { default as frequently } from './utils/frequently'; +export { Data } from './utils/data'; + +export { + PickerProps, + EmojiProps, + I18n, + PartialI18n +} from './utils/shared-props'; + +export { + emojiIndex, + nimbleEmojiIndex, + EmojiData, + CustomEmoji, + EmojiSkin +} from './utils/emoji-index'; export { Picker, - PickerProps, - I18n, - PartialI18n, - CustomEmoji, + NimblePicker, + NimblePickerProps, Emoji, - EmojiProps, + NimbleEmoji, + NimbleEmojiProps, Category, CategoryProps } from './components'; diff --git a/types/emoji-mart/dist-es/utils/data.d.ts b/types/emoji-mart/dist-es/utils/data.d.ts new file mode 100644 index 0000000000..ad1bc0d229 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/data.d.ts @@ -0,0 +1,73 @@ +export interface Data { + compressed: boolean; + categories: Category[]; + emojis: { [key: string]: Emoji }; + aliases: { [key: string]: string }; +} + +export interface Category { + id: string; + name: string; + emojis: string[]; +} + +export interface Emoji { + name?: string; + a?: string; + unified?: string; + b?: string; + non_qualified?: string; + c?: string; + has_img_apple?: boolean; + d?: boolean; + has_img_google?: boolean; + e?: boolean; + has_img_twitter?: boolean; + f?: boolean; + has_img_emojione?: boolean; + g?: boolean; + has_img_facebook?: boolean; + h?: boolean; + has_img_messenger?: boolean; + i?: boolean; + keywords?: string[]; + j?: string[]; + sheet?: number[]; + k?: number[]; + emoticons?: string[]; + l?: string[]; + text?: string; + m?: string; + short_names?: string[]; + n?: string[]; + added_in?: number; + o?: number; + sheet_x?: number; + sheet_y?: number; + skin_variations?: { [key: string]: SkinVariation }; + obsoleted_by?: string; + obsoletes?: string; +} + +export interface SkinVariation { + unified: string; + non_qualified: null | string; + image: string; + sheet_x: number; + sheet_y: number; + added_in: string; + has_img_apple: boolean; + has_img_google: boolean; + has_img_twitter: boolean; + has_img_emojione: boolean; + has_img_facebook: boolean; + has_img_messenger: boolean; + obsoleted_by?: string; + obsoletes?: string; +} + +export function buildSearch(emoji: Emoji): string; + +export function compress(emoji: Emoji): void; + +export function uncompress(data: Data): void; diff --git a/types/emoji-mart/dist-es/utils/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index.d.ts deleted file mode 100644 index c6499e663c..0000000000 --- a/types/emoji-mart/dist-es/utils/emoji-index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type EmojiSkin = 1|2|3|4|5|6; - -export interface EmojiData { - id: string; - name: string; - colons: string; - /** Reverse mapping to keyof emoticons */ - emoticons: string[]; - unified: string; - skin: EmojiSkin|null; - native: string; -} - -// tslint:disable-next-line strict-export-declare-modifiers -declare const _default: { - search(query: ''): null - search(query: string): EmojiData|null - - emojis: { [emoji: string]: EmojiData } - - /** Mapping of string to keyof emojis */ - emoticons: { [emoticon: string]: string } -}; - -export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts new file mode 100644 index 0000000000..0d1d6b8881 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts @@ -0,0 +1,14 @@ +import { EmojiData } from './nimble-emoji-index'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const _default: { + search(query: ''): null; + search(query: string): EmojiData|null; + + emojis: { [emoji: string]: EmojiData }; + + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string }; +}; + +export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts new file mode 100644 index 0000000000..576a5d0cb7 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts @@ -0,0 +1,2 @@ +export { default as emojiIndex } from './emoji-index'; +export { default as nimbleEmojiIndex, EmojiData, CustomEmoji, EmojiSkin } from './nimble-emoji-index'; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts new file mode 100644 index 0000000000..010c313d19 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts @@ -0,0 +1,40 @@ +import { Data } from "../data"; + +import { CategoryName } from '../shared-props'; + +export type EmojiSkin = 1 | 2 | 3 | 4 | 5 | 6; + +export interface BaseEmoji { + id: string; + name: string; + colons: string; + /** Reverse mapping to keyof emoticons */ + emoticons: string[]; + unified: string; + skin: EmojiSkin | null; + native: string; +} + +export interface CustomEmoji { + // id is overridden by short_names[0] + id?: string; + // colons is overridden by :id: + colons?: string; + name: string; + /** Must contain at least one name. The first name is used as the unique id. */ + short_names: string[]; + emoticons?: string[]; + keywords?: string[]; + imageUrl: string; +} + +export type EmojiData = BaseEmoji | CustomEmoji; + +export default class NimbleEmojiIndex { + constructor(data: Data); + search(query: ''): null; + search(query: string): EmojiData[]|null; + emojis: { [emoji: string]: EmojiData }; + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string }; +} diff --git a/types/emoji-mart/dist-es/utils/shared-props.d.ts b/types/emoji-mart/dist-es/utils/shared-props.d.ts new file mode 100644 index 0000000000..aed45486c5 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/shared-props.d.ts @@ -0,0 +1,83 @@ +import * as React from 'react'; + +import { Data } from './data'; +import { EmojiData, EmojiSkin, CustomEmoji } from './emoji-index/nimble-emoji-index'; + +export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; +export type EmojiSet = 'apple' | 'google' | 'twitter' | 'emojione' | 'messenger' | 'facebook'; +export type EmojiSheetSize = 16 | 20 | 32 | 64; + +export interface EmojiProps { + onOver?(emoji: EmojiData, e: React.MouseEvent): void; + onLeave?(emoji: EmojiData, e: React.MouseEvent): void; + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + fallback?(emoji: EmojiData, props: EmojiProps): React.Component; + /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ + backgroundImageFn?: BackgroundImageFn; + native?: boolean; + forceSize?: boolean; + tooltip?: boolean; + /** defaults to 1 */ + skin?: EmojiSkin; + /** defaults to 64 */ + sheetSize?: EmojiSheetSize; + /** defaults to 52 */ + sheetColumns?: number; + /** defaults to 52 */ + sheetRows?: number; + /** defaults to 'apple' */ + set?: EmojiSet; + size: number; + emoji: string | EmojiData; + html?: boolean; +} + +export type CategoryName = 'search' | 'recent' | 'people' | 'nature' | 'foods' | 'activity' | 'places' | 'objects' | 'symbols' | 'flags' | 'custom'; + +// tslint:disable-next-line interface-name +export interface I18n { + search: string; + categories: Record; + notfound: string; + skintext: string; +} + +export type PartialI18n = Partial & { categories: Partial }>; + +export interface CustomIcons { + categories: Record React.Component>; +} + +export interface PickerProps { + /** NOTE: default is not preventable */ + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + onSelect?(emoji: EmojiData): void; + onSkinChange?(skin: EmojiSkin): void; + perLine?: number; + emojiSize?: number; + i18n?: PartialI18n; + style?: React.CSSProperties; + title?: string; + emoji?: string; + color?: string; + set?: EmojiSet; + skin?: EmojiSkin; + defaultSkin?: EmojiSkin; + native?: boolean; + backgroundImageFn?: BackgroundImageFn; + sheetSize?: EmojiSheetSize; + emojisToShowFilter?(emoji: EmojiData): boolean; + showPreview?: boolean; + showSkinTones?: boolean; + emojiTooltip?: boolean; + include?: CategoryName[]; + exclude?: CategoryName[]; + recent?: string[]; + autoFocus?: boolean; + /** NOTE: custom emoji are copied into a singleton object on every new mount */ + custom: CustomEmoji[]; + skinEmoji?: string; + notFound?(): React.Component; + notFoundEmoji?: string; + icons?: CustomIcons; +} diff --git a/types/emoji-mart/emoji-mart-tests.tsx b/types/emoji-mart/emoji-mart-tests.tsx index 7b7b8d0471..afd8e8b3ac 100644 --- a/types/emoji-mart/emoji-mart-tests.tsx +++ b/types/emoji-mart/emoji-mart-tests.tsx @@ -1,6 +1,6 @@ -// Port of https://github.com/missive/emoji-mart/blob/master/src/components/emoji.js +// Port of https://missive.github.io/emoji-mart/ -import React = require('react'); +import * as React from 'react'; import { Picker, Emoji, EmojiProps, CustomEmoji } from 'emoji-mart'; diff --git a/types/emoji-mart/index.d.ts b/types/emoji-mart/index.d.ts index 22c17731f3..a2911119d8 100644 --- a/types/emoji-mart/index.d.ts +++ b/types/emoji-mart/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for emoji-mart 2.2 +// Type definitions for emoji-mart 2.8 // Project: https://github.com/missive/emoji-mart // Definitions by: Diogo Franco +// Nick Winans // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -// These definitions should work with 2.3, but the tests doesn't pass on 2.3. +// TypeScript Version: 2.9 export * from './dist-es'; diff --git a/types/emoji-mart/tsconfig.json b/types/emoji-mart/tsconfig.json index 6ecc944e77..d929a3cc01 100644 --- a/types/emoji-mart/tsconfig.json +++ b/types/emoji-mart/tsconfig.json @@ -20,11 +20,17 @@ "files": [ "index.d.ts", "dist-es/components/category.d.ts", - "dist-es/components/emoji.d.ts", + "dist-es/components/emoji/emoji.d.ts", + "dist-es/components/emoji/nimble-emoji.d.ts", "dist-es/components/index.d.ts", - "dist-es/components/picker.d.ts", - "dist-es/utils/emoji-index.d.ts", + "dist-es/components/picker/picker.d.ts", + "dist-es/components/picker/nimble-picker.d.ts", + "dist-es/utils/emoji-index/emoji-index.d.ts", + "dist-es/utils/emoji-index/nimble-emoji-index.d.ts", + "dist-es/utils/emoji-index/index.d.ts", + "dist-es/utils/data.d.ts", "dist-es/utils/frequently.d.ts", + "dist-es/utils/shared-props.d.ts", "dist-es/utils/store.d.ts", "dist-es/index.d.ts", "emoji-mart-tests.tsx" From 6daee807ab903c6730dce84e172b934f3a48e4ca Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Aug 2018 20:32:38 -0500 Subject: [PATCH 170/346] Set TypeScript version back to 2.8 --- types/emoji-mart/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/emoji-mart/index.d.ts b/types/emoji-mart/index.d.ts index a2911119d8..38acd9e021 100644 --- a/types/emoji-mart/index.d.ts +++ b/types/emoji-mart/index.d.ts @@ -3,6 +3,6 @@ // Definitions by: Diogo Franco // Nick Winans // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.9 +// TypeScript Version: 2.8 export * from './dist-es'; From 6d06564862353038a6e13c4a70d44a1651735dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Th=C3=A9riault?= Date: Mon, 13 Aug 2018 21:49:44 -0400 Subject: [PATCH 171/346] Type def. for is-uuid npm package --- types/is-uuid/index.d.ts | 46 ++++++++++++++++++++++++++++++++++ types/is-uuid/is-uuid-tests.ts | 10 ++++++++ types/is-uuid/tsconfig.json | 23 +++++++++++++++++ types/is-uuid/tslint.json | 1 + 4 files changed, 80 insertions(+) create mode 100644 types/is-uuid/index.d.ts create mode 100644 types/is-uuid/is-uuid-tests.ts create mode 100644 types/is-uuid/tsconfig.json create mode 100644 types/is-uuid/tslint.json diff --git a/types/is-uuid/index.d.ts b/types/is-uuid/index.d.ts new file mode 100644 index 0000000000..f6e1f8626b --- /dev/null +++ b/types/is-uuid/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for is-uuid 1.0 +// Project: https://github.com/afram/is-uuid#readme +// Definitions by: André Thériault +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Returns true if the value is a v1 UUID + * @param value The value to test + */ +export function v1(value: string): boolean; + +/** + * Returns true if the value is a v2 UUID + * @param value The value to test + */ +export function v2(value: string): boolean; + +/** + * Returns true if the value is a v3 UUID + * @param value The value to test + */ +export function v3(value: string): boolean; + +/** + * Returns true if the value is a v4 UUID + * @param value The value to test + */ +export function v4(value: string): boolean; + +/** + * Returns true if the value is a v5 UUID + * @param value The value to test + */ +export function v5(value: string): boolean; + +/** + * Returns true if the value is a nil UUID + * @param value The value to test + */ +export function nil(value: string): boolean; + +/** + * Returns true for v1 - v5 UUID. Will return false for nil UUID + * @param value The value to test + */ +export function anyNonNil(value: string): boolean; diff --git a/types/is-uuid/is-uuid-tests.ts b/types/is-uuid/is-uuid-tests.ts new file mode 100644 index 0000000000..4e07b10905 --- /dev/null +++ b/types/is-uuid/is-uuid-tests.ts @@ -0,0 +1,10 @@ +import * as isUUID from 'is-uuid'; + +isUUID.v1('857b3f0a-a777-11e5-bf7f-feff819cdc9f'); +isUUID.v2('9a7b330a-a736-21e5-af7f-feaf819cdc9f'); +isUUID.v3('0a7b330a-a736-35ea-8f7f-feaf019cdc00'); +isUUID.v4('c51c80c2-66a1-442a-91e2-4f55b4256a72'); +isUUID.v5('5a2de30a-a736-5aea-8f7f-ad0f019cdc00'); + +isUUID.anyNonNil('c51c80c2-66a1-442a-91e2-4f55b4256a72'); +isUUID.nil('00000000-0000-0000-0000-000000000000'); diff --git a/types/is-uuid/tsconfig.json b/types/is-uuid/tsconfig.json new file mode 100644 index 0000000000..eec8e9597a --- /dev/null +++ b/types/is-uuid/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "is-uuid-tests.ts" + ] +} diff --git a/types/is-uuid/tslint.json b/types/is-uuid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-uuid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d99219134eb26a4779568d89b7de59e05dda846a Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Aug 2018 20:56:32 -0500 Subject: [PATCH 172/346] Various fixes and changes --- types/emoji-mart/dist-es/components/category.d.ts | 6 +++--- types/emoji-mart/dist-es/components/emoji/emoji.d.ts | 2 +- types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts | 2 +- .../emoji-mart/dist-es/components/picker/nimble-picker.d.ts | 2 +- types/emoji-mart/dist-es/components/picker/picker.d.ts | 2 +- types/emoji-mart/dist-es/index.d.ts | 3 ++- types/emoji-mart/dist-es/utils/shared-props.d.ts | 3 ++- types/emoji-mart/emoji-mart-tests.tsx | 4 ++-- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/types/emoji-mart/dist-es/components/category.d.ts b/types/emoji-mart/dist-es/components/category.d.ts index cde72441bf..efa52e9988 100644 --- a/types/emoji-mart/dist-es/components/category.d.ts +++ b/types/emoji-mart/dist-es/components/category.d.ts @@ -1,11 +1,11 @@ -import * as React from 'react'; +import React = require('react'); -import { Emoji, EmojiData, EmojiProps, I18n } from '..'; +import { Emoji, EmojiData, EmojiProps, I18n, CategoryName } from '..'; export interface Props { emojis?: Array; hasStickyPosition?: boolean; - id: string; + id: CategoryName; name: string; native: boolean; perLine: number; diff --git a/types/emoji-mart/dist-es/components/emoji/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts index 78ca216af6..d86d2b686f 100644 --- a/types/emoji-mart/dist-es/components/emoji/emoji.d.ts +++ b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React = require('react'); import { EmojiProps } from '../..'; diff --git a/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts index 03b9d3730f..77888f5a94 100644 --- a/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts +++ b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React = require('react'); import { EmojiProps, Data } from '../..'; diff --git a/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts index 4f286a12ca..cc564b2a5e 100644 --- a/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts +++ b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React = require('react'); import { Data, PickerProps } from '../..'; diff --git a/types/emoji-mart/dist-es/components/picker/picker.d.ts b/types/emoji-mart/dist-es/components/picker/picker.d.ts index 81841b19d6..01f8a41f8b 100644 --- a/types/emoji-mart/dist-es/components/picker/picker.d.ts +++ b/types/emoji-mart/dist-es/components/picker/picker.d.ts @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React = require('react'); import { PickerProps } from '../..'; diff --git a/types/emoji-mart/dist-es/index.d.ts b/types/emoji-mart/dist-es/index.d.ts index bfc61354dd..bb0c79be3e 100644 --- a/types/emoji-mart/dist-es/index.d.ts +++ b/types/emoji-mart/dist-es/index.d.ts @@ -6,7 +6,8 @@ export { PickerProps, EmojiProps, I18n, - PartialI18n + PartialI18n, + CategoryName } from './utils/shared-props'; export { diff --git a/types/emoji-mart/dist-es/utils/shared-props.d.ts b/types/emoji-mart/dist-es/utils/shared-props.d.ts index aed45486c5..bbd5966610 100644 --- a/types/emoji-mart/dist-es/utils/shared-props.d.ts +++ b/types/emoji-mart/dist-es/utils/shared-props.d.ts @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React = require('react'); import { Data } from './data'; import { EmojiData, EmojiSkin, CustomEmoji } from './emoji-index/nimble-emoji-index'; @@ -30,6 +30,7 @@ export interface EmojiProps { size: number; emoji: string | EmojiData; html?: boolean; + /** data is omitted here as it should be used for NimbleEmoji only - not emoji */ } export type CategoryName = 'search' | 'recent' | 'people' | 'nature' | 'foods' | 'activity' | 'places' | 'objects' | 'symbols' | 'flags' | 'custom'; diff --git a/types/emoji-mart/emoji-mart-tests.tsx b/types/emoji-mart/emoji-mart-tests.tsx index afd8e8b3ac..56b05453a9 100644 --- a/types/emoji-mart/emoji-mart-tests.tsx +++ b/types/emoji-mart/emoji-mart-tests.tsx @@ -1,6 +1,6 @@ -// Port of https://missive.github.io/emoji-mart/ +// Port of https://github.com/missive/emoji-mart/blob/v2.8.0/stories/index.js -import * as React from 'react'; +import React = require('react'); import { Picker, Emoji, EmojiProps, CustomEmoji } from 'emoji-mart'; From e3612e282716e8740dafa96cabedde5ddea115ef Mon Sep 17 00:00:00 2001 From: Nicholas Pappagalo Date: Mon, 13 Aug 2018 19:24:19 -0700 Subject: [PATCH 173/346] rmv self from definitions by section of package header --- types/styled-system/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index 38cda70448..d9c386242c 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -7,7 +7,6 @@ // Eloy Durán // Matthieu Vachon // Adam Lavin -// Nicholas Pappagalo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 From 86498ece8f9d43e81205d7327b3f10984c630648 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Aug 2018 21:42:51 -0500 Subject: [PATCH 174/346] Remove unused import --- types/emoji-mart/dist-es/utils/shared-props.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/emoji-mart/dist-es/utils/shared-props.d.ts b/types/emoji-mart/dist-es/utils/shared-props.d.ts index bbd5966610..c091e24556 100644 --- a/types/emoji-mart/dist-es/utils/shared-props.d.ts +++ b/types/emoji-mart/dist-es/utils/shared-props.d.ts @@ -1,6 +1,5 @@ import React = require('react'); -import { Data } from './data'; import { EmojiData, EmojiSkin, CustomEmoji } from './emoji-index/nimble-emoji-index'; export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; From 6dda1632760e007fd0c0eaeb177e9e32c92bebe4 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Aug 2018 23:42:18 -0500 Subject: [PATCH 175/346] steam-login: add types --- types/steam-login/index.d.ts | 61 ++++++++++++++++++++++++++ types/steam-login/steam-login-tests.ts | 35 +++++++++++++++ types/steam-login/tsconfig.json | 23 ++++++++++ types/steam-login/tslint.json | 1 + 4 files changed, 120 insertions(+) create mode 100644 types/steam-login/index.d.ts create mode 100644 types/steam-login/steam-login-tests.ts create mode 100644 types/steam-login/tsconfig.json create mode 100644 types/steam-login/tslint.json diff --git a/types/steam-login/index.d.ts b/types/steam-login/index.d.ts new file mode 100644 index 0000000000..13fc21c691 --- /dev/null +++ b/types/steam-login/index.d.ts @@ -0,0 +1,61 @@ +// Type definitions for steam-login 0.1 +// Project: http://github.com/cpancake/steam-login +// Definitions by: Nick Winans +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { Request, Response, NextFunction } from 'express'; + +export interface MiddlewareOptions { + verify: string; + realm: string; + apiKey: string; + useSession?: boolean; +} + +export interface SteamUser { + _json: { + steamid: string; + personaname: string; + profileurl: string; + avatar: string; + avatarmedium: string; + avatarfull: string; + personastate: number; + communityvisibilitystate: number; + profilestate?: number; + lastlogoff: number; + commentpermission?: number; + realname?: string; + primaryclanid?: string; + timecreated?: number; + gameid?: string; + gameserverip?: string; + gameextrainfo?: string; + loccountrycode?: string; + locstatecode?: string; + loccityid?: number; + }; + steamid: string; + username: string; + name: string; + profile: string; + avatar: { + small: string; + medium: string; + large: string; + }; +} + +export interface SteamRequest extends Request { + logout(): (req: Request) => () => void; + user: SteamUser; +} + +export function middleware(opts: MiddlewareOptions): (req: Request, res: Response, next: NextFunction) => void; + +export function enforceLogin(redirect: string): (req: Request, res: Response, next: NextFunction) => NextFunction; + +export function verify(): (req: Request, res: Response, next: NextFunction) => NextFunction; + +export function authenticate(): (req: Request, res: Response, next: NextFunction) => NextFunction; diff --git a/types/steam-login/steam-login-tests.ts b/types/steam-login/steam-login-tests.ts new file mode 100644 index 0000000000..e741a0f5de --- /dev/null +++ b/types/steam-login/steam-login-tests.ts @@ -0,0 +1,35 @@ +// Port of https://github.com/cpancake/steam-login/blob/master/example.js + +import * as express from 'express'; +import * as steam from 'steam-login'; +import * as session from 'express-session'; + +const app = express(); + +app.use(session({ resave: false, saveUninitialized: false, secret: 'a secret' })); +app.use(steam.middleware({ + realm: 'http://localhost:3000/', + verify: 'http://localhost:3000/verify', + apiKey: process.argv[2] +} +)); + +app.get('/', (req: steam.SteamRequest, res) => { + res.send(req.user == null ? 'not logged in' : 'hello ' + req.user.username).end(); +}); + +app.get('/authenticate', steam.authenticate(), (req, res) => { + res.redirect('/'); +}); + +app.get('/verify', steam.verify(), (req: steam.SteamRequest, res) => { + res.send(req.user).end(); +}); + +app.get('/logout', steam.enforceLogin('/'), (req: steam.SteamRequest, res) => { + req.logout(); + res.redirect('/'); +}); + +app.listen(3000); +console.log('listening'); diff --git a/types/steam-login/tsconfig.json b/types/steam-login/tsconfig.json new file mode 100644 index 0000000000..a1d49993f6 --- /dev/null +++ b/types/steam-login/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "steam-login-tests.ts" + ] +} diff --git a/types/steam-login/tslint.json b/types/steam-login/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/steam-login/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 5cae8a991523293a42411a38644c639c4a74e2c9 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Aug 2018 23:56:17 -0500 Subject: [PATCH 176/346] Update to support tsconfig "strictFunctionTypes": true --- types/steam-login/index.d.ts | 4 ++-- types/steam-login/steam-login-tests.ts | 2 +- types/steam-login/tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/steam-login/index.d.ts b/types/steam-login/index.d.ts index 13fc21c691..a765f8e7e0 100644 --- a/types/steam-login/index.d.ts +++ b/types/steam-login/index.d.ts @@ -48,8 +48,8 @@ export interface SteamUser { } export interface SteamRequest extends Request { - logout(): (req: Request) => () => void; - user: SteamUser; + logout?(): (req: Request) => () => void; + user?: SteamUser; } export function middleware(opts: MiddlewareOptions): (req: Request, res: Response, next: NextFunction) => void; diff --git a/types/steam-login/steam-login-tests.ts b/types/steam-login/steam-login-tests.ts index e741a0f5de..84eae31a01 100644 --- a/types/steam-login/steam-login-tests.ts +++ b/types/steam-login/steam-login-tests.ts @@ -27,7 +27,7 @@ app.get('/verify', steam.verify(), (req: steam.SteamRequest, res) => { }); app.get('/logout', steam.enforceLogin('/'), (req: steam.SteamRequest, res) => { - req.logout(); + req.logout ? req.logout() : null; res.redirect('/'); }); diff --git a/types/steam-login/tsconfig.json b/types/steam-login/tsconfig.json index a1d49993f6..8548e16277 100644 --- a/types/steam-login/tsconfig.json +++ b/types/steam-login/tsconfig.json @@ -7,7 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From c9244569c6aeb3a7149b71e15547b259fd783a81 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 14 Aug 2018 00:07:15 -0500 Subject: [PATCH 177/346] Simplify exported function returns --- types/steam-login/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/steam-login/index.d.ts b/types/steam-login/index.d.ts index a765f8e7e0..849a45b920 100644 --- a/types/steam-login/index.d.ts +++ b/types/steam-login/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -import { Request, Response, NextFunction } from 'express'; +import { Request, RequestHandler } from 'express'; export interface MiddlewareOptions { verify: string; @@ -52,10 +52,10 @@ export interface SteamRequest extends Request { user?: SteamUser; } -export function middleware(opts: MiddlewareOptions): (req: Request, res: Response, next: NextFunction) => void; +export function middleware(opts: MiddlewareOptions): RequestHandler; -export function enforceLogin(redirect: string): (req: Request, res: Response, next: NextFunction) => NextFunction; +export function enforceLogin(redirect: string): RequestHandler; -export function verify(): (req: Request, res: Response, next: NextFunction) => NextFunction; +export function verify(): RequestHandler; -export function authenticate(): (req: Request, res: Response, next: NextFunction) => NextFunction; +export function authenticate(): RequestHandler; From 9c9cacbae6518912ecb24e378cf98f43413cf551 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 14 Aug 2018 14:12:33 +0800 Subject: [PATCH 178/346] [echarts]: add jsdoc comments and update to ec4.0.4 - Added functions descriptions, parameter descriptions and etc. in the form of JSDoc to better support code impletion. - Changed a few interfaces according to https://echarts.apache.org/api.html . --- types/echarts/index.d.ts | 461 ++++++++++++++++++++++++++++++++++----- 1 file changed, 404 insertions(+), 57 deletions(-) diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index 15892864e5..08e87cab09 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -3,120 +3,412 @@ // Definitions by: Xie Jingyang // AntiMoron // Liveangela +// Ovilia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 declare namespace echarts { - function init(dom: HTMLDivElement | HTMLCanvasElement, theme?: object | string, opts?: { - devicePixelRatio?: number - renderer?: string - width?: number | string - height?: number | string - }): ECharts; + /** + * Creates an ECharts instance, and returns an echartsInstance. You shall + * not initialize multiple ECharts instances on a single container. + * + * @param {HTMLDivElement | HTMLCanvasElement} dom Instance container, + * usually is a `div` element with height and width defined. + * @param {object | string} [theme] Theme to be applied. + * This can be a configuring object of a theme, or a theme name + * registered through [echarts.registerTheme](https://echarts.apache.org/api.html#echarts.registerTheme). + * @param {object} [opts] Chart configurations. + * @param {number} [opts.devicePixelRatio] Ratio of one physical pixel to + * the size of one device independent pixels. Browser's + * `window.devicePixelRatio` is used by default. + * @param {string} [opts.renderer] Supports `'canvas'` or `'svg'`. + * See [Render by Canvas or SVG](https://echarts.apache.org/tutorial.html#Render%20by%20Canvas%20or%20SVG). + * @param {number} [opts.width] Specify width explicitly, in pixel. + * If setting to `null`/`undefined`/`'auto'`, width of `dom` + * (instance container) will be used. + * @param {number} [opts.height] Specify height explicitly, in pixel. + * If setting to `null`/`undefined`/`'auto'`, height of `dom` + * (instance container) will be used. + */ + function init( + dom: HTMLDivElement | HTMLCanvasElement, + theme?: object | string, + opts?: { + devicePixelRatio?: number + renderer?: string + width?: number | string + height?: number | string + } + ): ECharts - const graphic: Graphic; + /** + * Connects interaction of multiple chart series. For example: + * + ```js + // set group id of each instance respectively. + chart1.group = 'group1'; + chart2.group = 'group1'; + echarts.connect('group1'); + // or incoming instance array that need to be linked. + echarts.connect([chart1, chart2]); + ``` + * + * @param group Group id in string, or array of chart instance. + */ + function connect(group: string | ECharts[]): void - interface Graphic { - clipPointsByRect(points: number[][], rect: ERectangle): number[][]; - clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; - LinearGradient: { new(x: number, y: number, x2: number, y2: number, colorStops: object[], globalCoord?: boolean): LinearGradient } - } + /** + * Disconnects interaction of multiple chart series. To have one single + * instance to be removed, you can set `group` of chart instance to be null. + * + * @param {string} group Group id in string. + */ + function disConnect(group: string): void - function connect(group: string | string[]): void; + /** + * Destroys chart instance, after which the instance cannot be used any + * more. + * + * @param target Chart instance or container. + */ + function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement) + : void - function disConnect(group: string): void; + /** + * Returns chart instance of dom container. + * + * @param target Chart container. + */ + function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement) + : ECharts - function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement): void; + /** + * Registers available maps. This can only be used after including + * [geo](https://echarts.apache.org/option.html#geo) + * component or chart series of + * [map](https://echarts.apache.org/option.html#series-map). + * + * @param {string} mapName Map name, referring to `map` value set in + * [geo](https://echarts.apache.org/option.html#geo) + * component or + * [map](https://echarts.apache.org/option.html#series-map). + * @param {object} geoJson Data in GeoJson format. See + * [http://geojson.org/](http://geojson.org/) for more format information. + * @param {object} [specialAreas] Zoomed part of a specific area in the map + * for better visual effect. + * See [USA Population Estimates example](https://ecomfe.github.io/echarts-examples/public/editor.html?c=map-usa). + */ + function registerMap( + mapName: string, + geoJson: object, + specialAreas?: object + ): void - function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement): ECharts; - - function registerMap(mapName: string, geoJson: object, specialAreas?: object): void; - - function registerTheme(themeName: string, theme: object): void; + /** + * Registers a theme, should be specified when + * [initialize the chart instance](https://echarts.apache.org/api.html#echarts.init). + * + * @param {string} themeName Theme name. + * @param {object} theme Theme configurations. + */ + function registerTheme(themeName: string, theme: object): void interface MapObj { - /** geoJson data for map */ + /** + * geoJson data for map + */ geoJson: object, - /** special areas fro map */ + /** + * special areas fro map + */ specialAreas: object } - function getMap(mapName: string): MapObj; + /** + * Get a registed map. + * + * @param {string} mapName Map name. + * @return {MapObj} Map data. + */ + function getMap(mapName: string): MapObj - interface LinearGradient { - colorStops: object[]; - global: boolean; - type: string; - x: number - x2: number - y: number - y2: number + /** + * Util methods about graphics. + */ + const graphic: Graphic; + + interface Graphic { + /** + * Clip the given points by the given rectangular. + * + * @param {number[][]} points The points to be clipped, + * like [[23, 44], [12, 15], ...]. + * @param {ERectangle} rect The rectangular that is used to clip points. + */ + clipPointsByRect(points: number[][], rect: ERectangle): number[][]; + + /** + * Clip the first input rectangular by the second input rectangular. + * + * @param {ERectangle} targetRect The rectangular to be clipped. + * @param {ERectangle} rect The rectangular that is used to clip + * targetRect. + */ + clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; } interface ECharts { + /** + * Group name to be used in chart connection + */ group: string - setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean): void + /** + * Configuration item, data, universal interface, all parameters and + * data can all be modified through `setOption`. ECharts will merge + * new parameters and data, and then refresh chart. + * + * @param {EChartOption} option Configuration item and data. Please + * refer to [configuration item manual](https://echarts.apache.org/option.html) + * for more information. + * @param {boolean} [notMerge=false] Whether not to merge with previous + * `option` + * @param {boolean} [lazyUpdate=false] Whether not to update chart + * immediately + */ + setOption( + option: EChartOption, + notMerge?: boolean, + lazyUpdate?: boolean + ) : void + /** + * Configuration item, data, universal interface, all parameters and + * data can all be modified through `setOption`. ECharts will merge + * new parameters and data, and then refresh chart. + * + * @param {EChartOption} option Configuration item and data. Please + * refer to [configuration item manual](https://echarts.apache.org/option.html) + * for more information. + * @param {EChartsOptionConfig} [opts] Options about how to setOption + */ + setOption(option: EChartOption, opts?: EChartsOptionConfig): void + + /** + * Gets width of ECharts instance container. + * + * @return {number} Width. + */ getWidth(): number + /** + * Gets height of ECharts instance container. + * + * @return {number} Height. + */ getHeight(): number + /** + * Gets DOM element of ECharts instance container. + * + * @return {HTMLCanvasElement|HTMLDivElement} DOM container. + */ getDom(): HTMLCanvasElement | HTMLDivElement - getOption(): object + /** + * Gets `option` object maintained in current instance, which contains + * configuration item and data merged from previous `setOption` + * operations by users, along with user interaction states. + * For example, switching of legend, zooming area of data zoom, + * and so on. Therefore, a new instance that is exactly the same + * can be recovered from this option. + */ + getOption(): EChartOption - resize(): void + /** + * Resizes chart, which should be called manually when container size + * changes. When `opts` is not provided, DOM size is used. + * + * @param {EChartsResizeOption} opts Specify parameters explicitly. + */ + resize(opts?: EChartsResizeOption): void + /** + * Triggers chart action, like chart switch `legendToggleSelect`, + * zoom data area `dataZoom`, show tooltip `showTip` and so on. + * See [action](https://echarts.apache.org/api.html#action) and + * [events](https://echarts.apache.org/api.html#events) + * for more information. + * + * @param payload Trigger multiple actions through `batch` attribute. + */ dispatchAction(payload: object): void + /** + * Binds event-handling function. + * There are two kinds of events in ECharts, one of which is mouse + * events, which will be triggered when the mouse clicks certain + * element in the chart, the other kind will be triggered after + * `dispatchAction` is called. Every action has a corresponding + * event. + * If event is triggered externally by `dispatchAction`, and there + * is batch attribute in action to trigger batch action, then the + * corresponding response event parameters be in batch. + * + * @param {string} eventName Event names are all in lower-cases, + * for example, `'click'`, `'mousemove'`, `'legendselected'` + * @param {Function} handler Event-handling function, whose format + * is as following: + ```js + (event: object) + ``` + * @param {object} [context] context of callback function, what + * `this` refers to. + */ on(eventName: string, handler: Function, context?: object): void + /** + * Unbind event-handler function. + * + * @param {string} eventName Event names are all in lower-cases, + * for example, `'click'`, `'mousemove'`, `'legendselected'` + * @param {Function} [handler] The function to be unbound could be + * passed. Otherwise, all event functions of this type will be + * unbound. + */ off(eventName: string, handler?: Function): void - showLoading(type?: string, opts?: object): void + /** + * Convert a point from logical coordinate (e.g., in geo, cartesian, + * graph, ...) to pixel coordinate. + * + * @param {EChartsConvertFinder} finder Indicate in which coordinate + * system conversion is performed. + * Generally, index or id or name can be used to specify + * coordinate system. + * @param {string | any[]} value The value to be converted. + */ + convertToPixel(finder: EChartsConvertFinder, value: string | any[]) + : string | any[] + /** + * Convert a point from pixel coordinate to logical coordinate + * (e.g., in geo, cartesian, graph, ...). + * + * @param {EChartsConvertFinder} finder Indicate in which coordinate + * system conversion is performed. + * Generally, index or id or name can be used to specify + * coordinate system. + * @param {string | any[]} value The value to be converted. + */ + convertFromPixel(finder: EChartsConvertFinder, value: any[] | string) + : any[] | string + + /** + * Determine whether the given point is in the given coordinate systems or series. + * + * @param {EChartsConvertFinder} finder Indicate in which coordinate + * system conversion is performed. + * Generally, index or id or name can be used to specify + * coordinate system. + * @param {string | any[]} value The value to be judged, in pixel + * coordinate system. + */ + containPixel(finder: EChartsConvertFinder, value: any[]): boolean + + /** + * Shows loading animation. You can call this interface manually before + * data is loaded, and call `hideLoading` to hide loading animation + * after data is loaded. + * + * @param {string} [type='default'] + * @param {EChartsLoadingOption} [opts] + */ + showLoading(type?: string, opts?: EChartsLoadingOption): void + + /** + * Hides animation loading effect. + */ hideLoading(): void + /** + * Exports chart image; returns a base64 URL; can be set to `src` of + * `Image`. + * + * @param opts Options. + */ getDataURL(opts: { - /** 导出的格式,可选 png, jpeg */ + // Exporting format, can be either png, or jpeg type?: string, - /** 导出的图片分辨率比例,默认为 1。*/ + // Resolution ratio of exporting image, 1 by default. pixelRatio?: number, - /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ - backgroundColor?: string + // Background color of exporting image, use backgroundColor in + // option by default. + backgroundColor?: string, + // Excluded components list. e.g. ['toolbox'] + excludeComponents?: string[] }): string + /** + * Exports connected chart image; returns a base64 url; can be set to + * `src` of `Image`. Position of charts in exported image are + * related to that of the container. + * + * @param opts Options. + */ getConnectedDataURL(opts: { - /** 导出的格式,可选 png, jpeg */ + // Exporting format, can be either png, or jpeg type: string, - /** 导出的图片分辨率比例,默认为 1。 */ + // Resolution ratio of exporting image, 1 by default. pixelRatio: number, - /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ - backgroundColor: string + // Background color of exporting image, use backgroundColor in + // option by default. + backgroundColor: string, + // Excluded components list. e.g. ['toolbox'] + excludeComponents?: string[] }): string + /** + * The method is used in rendering millions of data + * (e.g. rendering geo data). In these scenario, the entire size of + * data is probably up to 10 or 100 MB, even using binary format. + * So chunked load data and rendering is required. When using + * `appendData`, the graphic elements that have been rendered will + * not be cleared, but keep rendering new graphic elements. + * + * @param opts Data options. + */ + appendData(opts: { + // Specify which series the data will be appended to. + seriesIndex?: string, + // The data to be appended. + data?: any[]|TypedArray, + }): void + + /** + * Clears current instance; removes all components and charts in + * current instance. + */ clear(): void + /** + * Returns whether current instance has been disposed. + * + * @return {boolean} Whether has been disposed. + */ isDisposed(): boolean + /** + * Disposes instance. Once disposed, the instance can not be used again. + */ dispose(): void - - /** 转换逻辑点到像素 */ - convertToPixel(finder: ConvertFinder | string, value: string | any[]): string | any[] - - convertFromPixel(finder: ConvertFinder | string, value: any[] | string): any[] | string - - containPixel(finder: ConvertFinder | string, - /** 要被判断的点,为像素坐标值,以 echarts 实例的 dom 节点的左上角为坐标 [0, 0] 点。*/ - value: any[]): boolean - - getModel(): { - getComponent(finder: string): any; - } } - interface ConvertFinder { + type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array + | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array + | Float64Array; + + interface EChartsConvertFinder { seriesIndex?: number, seriesId?: string, seriesName?: string, @@ -193,6 +485,29 @@ declare namespace echarts { zAxis3D?: object } + interface EChartsOptionConfig { + notMerge?: boolean, + lazyUpdate?: boolean, + silent?: boolean + } + + interface EChartsResizeOption { + /** + * Chart width. + */ + width?: number | string, + + /** + * Chart height. + */ + heiight?: number | string, + + /** + * Specify whether or not to prevent triggering events. + */ + silent?: boolean + } + interface EChartTitleOption { show?: boolean; text?: string; @@ -219,6 +534,38 @@ declare namespace echarts { shadowOffsetX?: number, shadowOffsetY?: number, } + + interface EChartsLoadingOption { + /** + * Loading text. + * @default 'loading' + */ + text?: string, + + /** + * Loading circle color. + * @default '#c23531' + */ + color?: string, + + /** + * Loading text color. + * @default '#000' + */ + textColor?: string, + + /** + * Mask background color. + * @default 'rgba(255, 255, 255, 0.8)' + */ + maskColor?: string, + + /** + * Zlevel of loading. If not 0, it creates a new canvas for loading. + * @default 0 + */ + zlevel?: 0 + } } declare module 'echarts' { From fcaa13327f9d8a828c5ab1a0ed82b3f8dfcb8885 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 14 Aug 2018 14:22:01 +0800 Subject: [PATCH 179/346] [echarts] add echarts version --- types/echarts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index 08e87cab09..bfbd7af809 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for echarts +// Type definitions for echarts 4.1.0 // Project: http://echarts.baidu.com/ // Definitions by: Xie Jingyang // AntiMoron From e2761ccf91a7dc3f9f5bfd065b2b459815561810 Mon Sep 17 00:00:00 2001 From: Terry Mun Date: Tue, 14 Aug 2018 09:08:16 +0200 Subject: [PATCH 180/346] Removed typings for unexposed internals Both `playerMap` and `readyMap` are internal weakmaps in Vimeo's player.js and are never exposed, so there is no need to export their types. --- types/vimeo__player/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index 6fac1db7d9..cf7475f246 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -111,6 +111,4 @@ export interface VimeoPromise extends Promise { } /*~ You can declare properties of the module using const, let, or var */ -export const playerMap: WeakMap; -export const readyMap: WeakMap; export default Player; From 4a8f29c946b9e4b9e839ba29a58bf436c337c87f Mon Sep 17 00:00:00 2001 From: Igor Schelkonogov Date: Tue, 14 Aug 2018 17:09:11 +0500 Subject: [PATCH 181/346] Include support for contextual rewrite --- types/webpack-dev-server/index.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/webpack-dev-server/index.d.ts b/types/webpack-dev-server/index.d.ts index dab8ae5467..435d2547d9 100644 --- a/types/webpack-dev-server/index.d.ts +++ b/types/webpack-dev-server/index.d.ts @@ -14,6 +14,7 @@ import * as express from 'express'; import * as serveStatic from 'serve-static'; import * as https from 'https'; import * as http from 'http'; +import { Url } from "url"; declare namespace WebpackDevServer { interface ListeningApp { @@ -31,9 +32,16 @@ declare namespace WebpackDevServer { type ProxyConfigArray = ProxyConfigArrayItem[]; + interface Context { + match: RegExpMatchArray; + parsedUrl: Url; + } + + type RewriteTo = (context: Context) => string; + interface Rewrite { from: RegExp; - to: string; + to: string | RegExp | RewriteTo; } interface HistoryApiFallbackConfig { From c589c779849c61bfd53e56b49777fcb95f40d418 Mon Sep 17 00:00:00 2001 From: Adam Lavin Date: Tue, 14 Aug 2018 13:25:00 +0100 Subject: [PATCH 182/346] Remove comment about styled-components --- types/styled-system/styled-system-tests.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index e16b90665d..c0f9ba9ded 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -1,4 +1,3 @@ -// Example uses styled-components, but styled-system works with most other css-in-js libraries as well import * as React from "react"; import { themeGet, From 0d0dec2df11ef2ed026f6785c92becaf602290dc Mon Sep 17 00:00:00 2001 From: Stian Jensen Date: Tue, 14 Aug 2018 15:21:07 +0200 Subject: [PATCH 183/346] Add Moment to react-native-datepicker types --- types/react-native-datepicker/index.d.ts | 3 ++- types/react-native-datepicker/package.json | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 types/react-native-datepicker/package.json diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index 929acdc375..365fb6ced6 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -6,11 +6,12 @@ import * as React from 'react'; import { ImageURISource } from 'react-native'; +import * as moment from 'moment'; export interface DatePickerProps { mode?: 'date' | 'datetime' | 'time'; androidMode?: 'default' | 'calendar' | 'spinner'; - date?: string | Date; + date?: string | Date | moment.Moment; format?: string; iconSource?: ImageURISource; iconComponent?: JSX.Element; diff --git a/types/react-native-datepicker/package.json b/types/react-native-datepicker/package.json new file mode 100644 index 0000000000..19e5fb0d14 --- /dev/null +++ b/types/react-native-datepicker/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "moment": ">=2.14.0" + } +} From b7887d9d6614a37ef7f7cbe9815625102ba28c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Tue, 14 Aug 2018 14:27:18 +0100 Subject: [PATCH 184/346] [react-navigation] Remove robertohuertasm from authors --- types/react-navigation/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 6e286c2217..46918c6762 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -11,7 +11,6 @@ // Qibang Sun // Sergei Butko: // Veit Lehmann: -// Roberto Huertas: // Steven Miller // Armando Assuncao // Ciaran Liedeman From 989432481b5a3e8a7ca30920c795843e28678c53 Mon Sep 17 00:00:00 2001 From: Arash Outadi Date: Tue, 14 Aug 2018 14:29:35 +0100 Subject: [PATCH 185/346] Add missing option to CheerioOptionsInterface --- types/cheerio/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index d264f4b8da..cb8031705e 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -214,6 +214,7 @@ interface CheerioOptionsInterface { recognizeCDATA?: boolean; recognizeSelfClosing?: boolean; normalizeWhitespace?: boolean; + ignoreWhitespace?: boolean; } interface CheerioSelector { From fe3c19d8bbac3c8e381e2d1e9cab5f7281cba6ce Mon Sep 17 00:00:00 2001 From: Alex Brick Date: Mon, 13 Aug 2018 09:45:12 +0200 Subject: [PATCH 186/346] [superagent-bunyan] Adding types for superagent-bunyan --- types/superagent-bunyan/index.d.ts | 12 ++++++++++ .../superagent-bunyan-tests.ts | 16 +++++++++++++ types/superagent-bunyan/tsconfig.json | 23 +++++++++++++++++++ types/superagent-bunyan/tslint.json | 1 + 4 files changed, 52 insertions(+) create mode 100644 types/superagent-bunyan/index.d.ts create mode 100644 types/superagent-bunyan/superagent-bunyan-tests.ts create mode 100644 types/superagent-bunyan/tsconfig.json create mode 100644 types/superagent-bunyan/tslint.json diff --git a/types/superagent-bunyan/index.d.ts b/types/superagent-bunyan/index.d.ts new file mode 100644 index 0000000000..1dfec979e4 --- /dev/null +++ b/types/superagent-bunyan/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for superagent-bunyan 5.2 +// Project: https://github.com/joaquimserafim/superagent-bunyan#readme +// Definitions by: Alex Brick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as Logger from 'bunyan'; +import { Plugin } from 'superagent'; + +declare function superagentLogger(logger: Logger, requestId?: string, extra?: object): Plugin; + +export = superagentLogger; diff --git a/types/superagent-bunyan/superagent-bunyan-tests.ts b/types/superagent-bunyan/superagent-bunyan-tests.ts new file mode 100644 index 0000000000..3a6f973e91 --- /dev/null +++ b/types/superagent-bunyan/superagent-bunyan-tests.ts @@ -0,0 +1,16 @@ +import * as request from 'superagent'; +import * as bunyan from 'bunyan'; + +import superagentLogger = require('superagent-bunyan'); + +const logger = bunyan.createLogger({name: 'my_log'}); + +logger.info('Hey!'); + +request + .get('http://localhost:3000') + .use(superagentLogger(logger)) + .use(superagentLogger(logger, 'requestId')) + .use(superagentLogger(logger, 'requestId', { foo: 'bar' })) + .use(superagentLogger(logger, undefined, { foo: 'bar' })) + .end((err, res) => {}); diff --git a/types/superagent-bunyan/tsconfig.json b/types/superagent-bunyan/tsconfig.json new file mode 100644 index 0000000000..0118838dcd --- /dev/null +++ b/types/superagent-bunyan/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", + "superagent-bunyan-tests.ts" + ] +} diff --git a/types/superagent-bunyan/tslint.json b/types/superagent-bunyan/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/superagent-bunyan/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a54ae6fc5f4bc08ab4228dbe3d97ba87454b784c Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Tue, 14 Aug 2018 23:49:28 +0900 Subject: [PATCH 187/346] react-native-vector-icons: fontawesome5, 5pro --- .../FontAwesome5.d.ts | 43 +++++++++++++++++++ .../FontAwesome5Pro.d.ts | 6 +++ 2 files changed, 49 insertions(+) create mode 100644 types/react-native-vector-icons/FontAwesome5.d.ts create mode 100644 types/react-native-vector-icons/FontAwesome5Pro.d.ts diff --git a/types/react-native-vector-icons/FontAwesome5.d.ts b/types/react-native-vector-icons/FontAwesome5.d.ts new file mode 100644 index 0000000000..7d40fe2c5d --- /dev/null +++ b/types/react-native-vector-icons/FontAwesome5.d.ts @@ -0,0 +1,43 @@ +import { Component } from "../../../../../Library/Caches/typescript/2.9/node_modules/@types/react"; +import { Icon, IconProps, ImageSource } from "./Icon"; + +export const FA5Style: { + regular: 0; + light: 1; + solid: 2; + brand: 3; +}; + +type ValueOf = T[keyof T]; + +// borrowed from +// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html +type Omit = Pick>; + +export type FontAwesome5IconVariants = keyof Omit; + +// borrowed from https://stackoverflow.com/a/49725198/1105281 +type RequireOnlyOne = Omit & + { + [K in Keys]-?: Required> & + Partial, undefined>> + }[Keys]; + +export type FontAwesome5IconProps = RequireOnlyOne< + { [K in FontAwesome5IconVariants]?: boolean } & IconProps, + FontAwesome5IconVariants +>; + +export default class FontAwesome5Icon extends Component< + FontAwesome5IconProps, + any +> { + static getImageSource( + name: string, + size?: number, + color?: string, + fa5Style?: ValueOf + ): Promise; + static loadFont(file?: string): Promise; + static hasIcon(name: string): boolean; +} diff --git a/types/react-native-vector-icons/FontAwesome5Pro.d.ts b/types/react-native-vector-icons/FontAwesome5Pro.d.ts new file mode 100644 index 0000000000..f8233abce5 --- /dev/null +++ b/types/react-native-vector-icons/FontAwesome5Pro.d.ts @@ -0,0 +1,6 @@ +import { Component } from "react"; +import FontAwesome5Icon, { FontAwesome5IconProps } from "./FontAwesome5"; + +export type FontAwesome5ProIconProps = FontAwesome5IconProps; +export { FA5Style } from "./FontAwesome5"; +export default FontAwesome5Icon; From 18f5c760696dbe4a3c13c9dc518210b0695275b0 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Tue, 14 Aug 2018 23:50:41 +0900 Subject: [PATCH 188/346] react-native-vector-icons: fontawesome5 test --- .../react-native-vector-icons-tests.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/react-native-vector-icons/react-native-vector-icons-tests.tsx b/types/react-native-vector-icons/react-native-vector-icons-tests.tsx index 51cb1eee81..e0dcaeb9b6 100644 --- a/types/react-native-vector-icons/react-native-vector-icons-tests.tsx +++ b/types/react-native-vector-icons/react-native-vector-icons-tests.tsx @@ -3,6 +3,8 @@ import { View, Text, TabBarIOS } from 'react-native'; import { createIconSet } from 'react-native-vector-icons'; import MaterialIcon from 'react-native-vector-icons/MaterialIcons'; import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; +import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5'; +import FontAwesome5ProIcon from 'react-native-vector-icons/FontAwesome5Pro'; import Ionicon from 'react-native-vector-icons/Ionicons'; const glyphMap = { @@ -27,6 +29,8 @@ class Example extends React.Component { {/* Normal Icon */} + + {/* Icon button */} Date: Wed, 15 Aug 2018 00:02:12 +0900 Subject: [PATCH 189/346] react-native-vector-icons: allow omitting variant --- types/react-native-vector-icons/FontAwesome5.d.ts | 8 ++++---- .../react-native-vector-icons-tests.tsx | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/react-native-vector-icons/FontAwesome5.d.ts b/types/react-native-vector-icons/FontAwesome5.d.ts index 7d40fe2c5d..18df444e79 100644 --- a/types/react-native-vector-icons/FontAwesome5.d.ts +++ b/types/react-native-vector-icons/FontAwesome5.d.ts @@ -16,14 +16,14 @@ type Omit = Pick>; export type FontAwesome5IconVariants = keyof Omit; -// borrowed from https://stackoverflow.com/a/49725198/1105281 -type RequireOnlyOne = Omit & +// modified from https://stackoverflow.com/a/49725198/1105281 +type AllowOnlyOne = Omit & { - [K in Keys]-?: Required> & + [K in Keys]-?: Partial> & Partial, undefined>> }[Keys]; -export type FontAwesome5IconProps = RequireOnlyOne< +export type FontAwesome5IconProps = AllowOnlyOne< { [K in FontAwesome5IconVariants]?: boolean } & IconProps, FontAwesome5IconVariants >; diff --git a/types/react-native-vector-icons/react-native-vector-icons-tests.tsx b/types/react-native-vector-icons/react-native-vector-icons-tests.tsx index e0dcaeb9b6..18b03edcaa 100644 --- a/types/react-native-vector-icons/react-native-vector-icons-tests.tsx +++ b/types/react-native-vector-icons/react-native-vector-icons-tests.tsx @@ -29,6 +29,7 @@ class Example extends React.Component { {/* Normal Icon */} + From dd09c5bced412294d13432e4b736717fc38bdc45 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Wed, 15 Aug 2018 00:03:39 +0900 Subject: [PATCH 190/346] fix messed up react import --- types/react-native-vector-icons/FontAwesome5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-vector-icons/FontAwesome5.d.ts b/types/react-native-vector-icons/FontAwesome5.d.ts index 18df444e79..44fca921cc 100644 --- a/types/react-native-vector-icons/FontAwesome5.d.ts +++ b/types/react-native-vector-icons/FontAwesome5.d.ts @@ -1,4 +1,4 @@ -import { Component } from "../../../../../Library/Caches/typescript/2.9/node_modules/@types/react"; +import { Component } from "react"; import { Icon, IconProps, ImageSource } from "./Icon"; export const FA5Style: { From 300ac3256322cc0280c6d3abfe129440f8d39c62 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Wed, 15 Aug 2018 00:05:41 +0900 Subject: [PATCH 191/346] react-native-vector-icons: FA5 definitions > tsconfig --- types/react-native-vector-icons/tsconfig.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-native-vector-icons/tsconfig.json b/types/react-native-vector-icons/tsconfig.json index f66f39ed95..993aae3195 100644 --- a/types/react-native-vector-icons/tsconfig.json +++ b/types/react-native-vector-icons/tsconfig.json @@ -25,6 +25,8 @@ "EvilIcons.d.ts", "Feather.d.ts", "FontAwesome.d.ts", + "FontAwesome5.d.ts", + "FontAwesome5Pro.d.ts", "Foundation.d.ts", "Ionicons.d.ts", "MaterialCommunityIcons.d.ts", From bd0f04155cfc0b8e70bb01a415be4f7a9cd19313 Mon Sep 17 00:00:00 2001 From: ikokostya Date: Tue, 14 Aug 2018 18:08:48 +0300 Subject: [PATCH 192/346] [node] Add dns.Resolver declaration (#28102) * [node] Add dns.Resolver declaration * Add test cases * Improve test cases --- types/node/index.d.ts | 20 ++++++++++++++++++++ types/node/node-tests.ts | 8 ++++++++ types/node/v8/index.d.ts | 20 ++++++++++++++++++++ types/node/v8/node-tests.ts | 8 ++++++++ types/node/v9/index.d.ts | 20 ++++++++++++++++++++ types/node/v9/node-tests.ts | 8 ++++++++ 6 files changed, 84 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 7745372a21..b702085203 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2770,6 +2770,7 @@ declare module "dns" { export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; export function setServers(servers: string[]): void; + export function getServers(): string[]; // Error codes export var NODATA: string; @@ -2796,6 +2797,25 @@ declare module "dns" { export var LOADIPHLPAPI: string; export var ADDRGETNETWORKPARAMS: string; export var CANCELLED: string; + + export class Resolver { + getServers: typeof getServers; + setServers: typeof setServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + cancel(): void; + } } declare module "net" { diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index ce46e31654..46154ce254 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -3388,6 +3388,14 @@ namespace dns_tests { const _addresses: string[] | dns.RecordWithTtl[] = addresses; }); } + { + const resolver = new dns.Resolver(); + resolver.setServers(["4.4.4.4"]); + resolver.resolve("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + resolver.cancel(); + } } /***************************************************************************** diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index d8a1cb431c..dc44245c59 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -2646,6 +2646,7 @@ declare module "dns" { export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; export function setServers(servers: string[]): void; + export function getServers(): string[]; // Error codes export var NODATA: string; @@ -2672,6 +2673,25 @@ declare module "dns" { export var LOADIPHLPAPI: string; export var ADDRGETNETWORKPARAMS: string; export var CANCELLED: string; + + export class Resolver { + getServers: typeof getServers; + setServers: typeof setServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + cancel(): void; + } } declare module "net" { diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 9cec14a88e..d89e6faacc 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -3127,6 +3127,14 @@ namespace dns_tests { const _addresses: string[] | dns.RecordWithTtl[] = addresses; }); } + { + const resolver = new dns.Resolver(); + resolver.setServers(["4.4.4.4"]); + resolver.resolve("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + resolver.cancel(); + } } /***************************************************************************** diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index 8150a68294..fd89e18e16 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -2728,6 +2728,7 @@ declare module "dns" { export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; export function setServers(servers: string[]): void; + export function getServers(): string[]; // Error codes export var NODATA: string; @@ -2754,6 +2755,25 @@ declare module "dns" { export var LOADIPHLPAPI: string; export var ADDRGETNETWORKPARAMS: string; export var CANCELLED: string; + + export class Resolver { + getServers: typeof getServers; + setServers: typeof setServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + cancel(): void; + } } declare module "net" { diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts index 3d7861f532..ace737fa3b 100644 --- a/types/node/v9/node-tests.ts +++ b/types/node/v9/node-tests.ts @@ -3160,6 +3160,14 @@ namespace dns_tests { const _addresses: string[] | dns.RecordWithTtl[] = addresses; }); } + { + const resolver = new dns.Resolver(); + resolver.setServers(["4.4.4.4"]); + resolver.resolve("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + resolver.cancel(); + } } /***************************************************************************** From ecba929771c1743300f30be1e7e21ef5eb25ddc9 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Tue, 14 Aug 2018 17:47:27 +0200 Subject: [PATCH 193/346] Fixed definitions for react-native/BatchedBridge. BatchedBridge (and MessageQueue) must be imported like this: import BatchedBridge from "react-native/Libraries/BatchedBridge/BatchedBridge"; So we must use default export. --- types/react-native/BatchedBridge.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/BatchedBridge.d.ts b/types/react-native/BatchedBridge.d.ts index dd63f73087..0f1b02a0f4 100644 --- a/types/react-native/BatchedBridge.d.ts +++ b/types/react-native/BatchedBridge.d.ts @@ -15,9 +15,9 @@ declare class MessageQueue { declare module "react-native/Libraries/BatchedBridge/BatchedBridge" { const BatchedBridge: MessageQueue; - export = BatchedBridge; + export default BatchedBridge; } declare module "react-native/Libraries/BatchedBridge/MessageQueue" { - export = MessageQueue; + export default MessageQueue; } From a0466280f37ee00cf532610f94a13d1220b25fd5 Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Tue, 14 Aug 2018 17:47:29 +0200 Subject: [PATCH 194/346] [express-fileupload]: add promised `.mv()` signature `.mv()` returns a Promise when callback argument is not provided --- types/express-fileupload/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/express-fileupload/index.d.ts b/types/express-fileupload/index.d.ts index 89331c066a..752581d612 100644 --- a/types/express-fileupload/index.d.ts +++ b/types/express-fileupload/index.d.ts @@ -29,6 +29,7 @@ declare namespace fileUpload { mimetype: string; data: Buffer; mv(path: string, callback: (err: any) => void): void; + mv(path: string): Promise; } interface Options { From 67c528c7e37440e77a71a984c7e36f05b9888c50 Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Tue, 14 Aug 2018 18:10:55 +0200 Subject: [PATCH 195/346] [express-fileupload]: add missing options and properties add missing `abortOnLimit` option and `truncated` property --- types/express-fileupload/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/express-fileupload/index.d.ts b/types/express-fileupload/index.d.ts index 752581d612..060476b109 100644 --- a/types/express-fileupload/index.d.ts +++ b/types/express-fileupload/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for express-fileupload 0.1 +// Type definitions for express-fileupload 0.4 // Project: https://github.com/richardgirges/express-fileupload#readme // Definitions by: Gintautas Miselis +// Sefa Ilkimen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -28,6 +29,7 @@ declare namespace fileUpload { encoding: string; mimetype: string; data: Buffer; + truncated: boolean; mv(path: string, callback: (err: any) => void): void; mv(path: string): Promise; } @@ -36,6 +38,7 @@ declare namespace fileUpload { debug?: boolean; safeFileNames?: boolean; preserveExtension?: boolean | string | number; + abortOnLimit?: boolean; [property: string]: any; } } From be37428451f1ee300efcdde260c7064391211566 Mon Sep 17 00:00:00 2001 From: Colin Bradley Date: Tue, 14 Aug 2018 18:53:54 +0100 Subject: [PATCH 196/346] dd-trace - compatability with opentracing --- types/dd-trace/package.json | 6 ++ types/dd-trace/src/opentracing/reference.d.ts | 29 ------- types/dd-trace/src/opentracing/span.d.ts | 5 +- .../src/opentracing/span_context.d.ts | 6 +- .../src/opentracing/span_options.d.ts | 37 -------- types/dd-trace/src/opentracing/tracer.d.ts | 86 +------------------ 6 files changed, 16 insertions(+), 153 deletions(-) create mode 100644 types/dd-trace/package.json delete mode 100644 types/dd-trace/src/opentracing/reference.d.ts delete mode 100644 types/dd-trace/src/opentracing/span_options.d.ts diff --git a/types/dd-trace/package.json b/types/dd-trace/package.json new file mode 100644 index 0000000000..90deb3c97b --- /dev/null +++ b/types/dd-trace/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "opentracing": ">=0.14.1" + } +} diff --git a/types/dd-trace/src/opentracing/reference.d.ts b/types/dd-trace/src/opentracing/reference.d.ts deleted file mode 100644 index 57def49166..0000000000 --- a/types/dd-trace/src/opentracing/reference.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import Span = require('./span'); -import SpanContext = require('./span_context'); - -declare class Reference { - /** - * @return The Reference type (e.g., REFERENCE_CHILD_OF or - * REFERENCE_FOLLOWS_FROM). - */ - type(): string; - - /** - * @return The SpanContext being referred to (e.g., the - * parent in a REFERENCE_CHILD_OF Reference). - */ - referencedContext(): SpanContext; - - /** - * Initialize a new Reference instance. - * - * @param type - the Reference type constant (e.g., - * REFERENCE_CHILD_OF or REFERENCE_FOLLOWS_FROM). - * @param referencedContext - the SpanContext being referred - * to. As a convenience, a Span instance may be passed in instead - * (in which case its .context() is used here). - */ - constructor(type: string, referencedContext: SpanContext | Span); -} - -export = Reference; \ No newline at end of file diff --git a/types/dd-trace/src/opentracing/span.d.ts b/types/dd-trace/src/opentracing/span.d.ts index e61a611efd..cf9286210b 100644 --- a/types/dd-trace/src/opentracing/span.d.ts +++ b/types/dd-trace/src/opentracing/span.d.ts @@ -1,7 +1,8 @@ import Tracer = require('./tracer'); import SpanContext = require('./span_context'); +import { Span } from 'opentracing'; -declare class Span { +declare class DatadogSpan extends Span { /** * Returns the SpanContext object associated with this Span. */ @@ -117,4 +118,4 @@ declare class Span { finish(finishTime?: number): void; } -export = Span; +export = DatadogSpan; diff --git a/types/dd-trace/src/opentracing/span_context.d.ts b/types/dd-trace/src/opentracing/span_context.d.ts index 4e3b532649..cf9565d5a5 100644 --- a/types/dd-trace/src/opentracing/span_context.d.ts +++ b/types/dd-trace/src/opentracing/span_context.d.ts @@ -1,3 +1,5 @@ +import { SpanContext } from 'opentracing'; + /** * SpanContext represents Span state that must propagate to descendant Spans * and across process boundaries. @@ -8,7 +10,7 @@ * identify or otherwise contextualize the associated Span instance (e.g., a * tuple). */ -declare class SpanContext { +declare class DatadogSpanContext extends SpanContext { /** * Use to create references to parent spans. */ @@ -35,4 +37,4 @@ interface SpanContextLike { spanId: number; } -export = SpanContext; +export = DatadogSpanContext; diff --git a/types/dd-trace/src/opentracing/span_options.d.ts b/types/dd-trace/src/opentracing/span_options.d.ts deleted file mode 100644 index 054d9024d1..0000000000 --- a/types/dd-trace/src/opentracing/span_options.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import Span = require('./span'); -import Reference = require('./reference'); -import SpanContext = require('./span_context'); - -interface SpanOptions { - /** - * a parent SpanContext (or Span, for convenience) that the newly-started - * span will be the child of (per REFERENCE_CHILD_OF). If specified, - * `references` must be unspecified. - */ - childOf?: Span | SpanContext; - - /** - * an array of Reference instances, each pointing to a causal parent - * SpanContext. If specified, `fields.childOf` must be unspecified. - */ - references?: Reference[]; - - /** - * set of key-value pairs which will be set as tags on the newly created - * Span. Ownership of the object is passed to the created span for - * efficiency reasons (the caller should not modify this object after - * calling startSpan). - */ - tags?: { - [key: string]: any; - }; - - /** - * a manually specified start time for the created Span object. The time - * should be specified in milliseconds as Unix timestamp. Decimal value are - * supported to represent time values with sub-millisecond accuracy. - */ - startTime?: number; -} - -export = SpanOptions; diff --git a/types/dd-trace/src/opentracing/tracer.d.ts b/types/dd-trace/src/opentracing/tracer.d.ts index a40559dbcd..252a0d558c 100644 --- a/types/dd-trace/src/opentracing/tracer.d.ts +++ b/types/dd-trace/src/opentracing/tracer.d.ts @@ -1,91 +1,11 @@ -import SpanOptions = require('./span_options'); -import Span = require('./span'); -import SpanContext = require('./span_context'); +import { Tracer } from 'opentracing'; /** * Tracer is the entry-point between the instrumentation API and the tracing * implementation. */ -declare class Tracer { - /** - * Starts and returns a new Span representing a logical unit of work. - * - * For example: - * - * // Start a new (parentless) root Span: - * var parent = Tracer.startSpan('DoWork'); - * - * // Start a new (child) Span: - * var child = Tracer.startSpan('load-from-db', { - * childOf: parent.context(), - * }); - * - * // Start a new async (FollowsFrom) Span: - * var child = Tracer.startSpan('async-cache-write', { - * references: [ - * opentracing.followsFrom(parent.context()) - * ], - * }); - * - * @param name - the name of the operation (REQUIRED). - * @param options - options for the newly created span. - * @return A new Span object. - */ - startSpan(name: string, options?: SpanOptions): Span; +declare class DatadogTracer extends Tracer { - /** - * Injects the given SpanContext instance for cross-process propagation - * within `carrier`. The expected type of `carrier` depends on the value of - * `format. - * - * OpenTracing defines a common set of `format` values (see - * FORMAT_TEXT_MAP, FORMAT_HTTP_HEADERS, and FORMAT_BINARY), and each has - * an expected carrier type. - * - * Consider this pseudocode example: - * - * var clientSpan = ...; - * ... - * // Inject clientSpan into a text carrier. - * var headersCarrier = {}; - * Tracer.inject(clientSpan.context(), Tracer.FORMAT_HTTP_HEADERS, headersCarrier); - * // Incorporate the textCarrier into the outbound HTTP request header - * // map. - * Object.assign(outboundHTTPReq.headers, headersCarrier); - * // ... send the httpReq - * - * @param spanContext - the SpanContext to inject into the - * carrier object. As a convenience, a Span instance may be passed - * in instead (in which case its .context() is used for the - * inject()). - * @param format - the format of the carrier. - * @param carrier - see the documentation for the chosen `format` - * for a description of the carrier object. - */ - inject(spanContext: SpanContext | Span, format: string, carrier: any): void; - - /** - * Returns a SpanContext instance extracted from `carrier` in the given - * `format`. - * - * OpenTracing defines a common set of `format` values (see - * FORMAT_TEXT_MAP, FORMAT_HTTP_HEADERS, and FORMAT_BINARY), and each has - * an expected carrier type. - * - * Consider this pseudocode example: - * - * // Use the inbound HTTP request's headers as a text map carrier. - * var headersCarrier = inboundHTTPReq.headers; - * var wireCtx = Tracer.extract(Tracer.FORMAT_HTTP_HEADERS, headersCarrier); - * var serverSpan = Tracer.startSpan('...', { childOf : wireCtx }); - * - * @param format - the format of the carrier. - * @param carrier - the type of the carrier object is determined by - * the format. - * @return The extracted SpanContext, or null if no such SpanContext could - * be found in `carrier` - */ - extract(format: string, carrier: any): SpanContext | null; } -export = Tracer; +export = DatadogTracer; From 36b6312eeed6a0bdaae2eb98270a27aba4cfbf58 Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Tue, 14 Aug 2018 13:03:55 -0600 Subject: [PATCH 197/346] add typings for async getSource and runtime.SafeString class --- types/nunjucks/index.d.ts | 8 +++++++- types/nunjucks/nunjucks-tests.ts | 2 ++ types/nunjucks/tslint.json | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/nunjucks/index.d.ts b/types/nunjucks/index.d.ts index d307bd27d5..1908f7e4c0 100644 --- a/types/nunjucks/index.d.ts +++ b/types/nunjucks/index.d.ts @@ -94,7 +94,7 @@ export function installJinjaCompat(): void; export interface ILoader { async?: boolean; - getSource(name: string): LoaderSource; + getSource(name: string, callback?: (err?: any, result?: LoaderSource) => void): LoaderSource | void; extend?(extender: ILoader): ILoader; } @@ -137,3 +137,9 @@ export class PrecompiledLoader extends Loader implements ILoader { init(searchPaths: string[], opts: any): void; getSource(name: string): LoaderSource; } + +export namespace runtime { + class SafeString { + constructor(...args: any[]); + } +} diff --git a/types/nunjucks/nunjucks-tests.ts b/types/nunjucks/nunjucks-tests.ts index 9f3afcddfe..91caf67a73 100644 --- a/types/nunjucks/nunjucks-tests.ts +++ b/types/nunjucks/nunjucks-tests.ts @@ -52,3 +52,5 @@ class MyLoader extends nunjucks.Loader implements nunjucks.ILoader { } env = new nunjucks.Environment(new MyLoader()); + +new nunjucks.runtime.SafeString(); diff --git a/types/nunjucks/tslint.json b/types/nunjucks/tslint.json index 2c7c1bed53..65fb79195f 100644 --- a/types/nunjucks/tslint.json +++ b/types/nunjucks/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": false + "interface-name": false, + "no-unnecessary-class": false // to allow SafeString class } } From 44988b0a8102c27738d4a700cffae5d5ae0e4900 Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Tue, 14 Aug 2018 13:12:01 -0600 Subject: [PATCH 198/346] WebLoader extends Loader, set version to 3.1 --- types/nunjucks/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/nunjucks/index.d.ts b/types/nunjucks/index.d.ts index 1908f7e4c0..b0a1e86508 100644 --- a/types/nunjucks/index.d.ts +++ b/types/nunjucks/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for nunjucks 3.0 +// Type definitions for nunjucks 3.1 // Project: http://mozilla.github.io/nunjucks/ // Definitions by: Ruben Slabbert // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -128,7 +128,7 @@ export class FileSystemLoader extends Loader implements ILoader { constructor(searchPaths?: string | string[], opts?: FileSystemLoaderOptions); } -export class WebLoader implements ILoader { +export class WebLoader extends Loader implements ILoader { constructor(baseUrl: string, opts?: any); getSource(name: string): LoaderSource; } From f0c300861b310dba0e22efc0f38e9a87a0944b4e Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Tue, 14 Aug 2018 13:16:50 -0600 Subject: [PATCH 199/346] add missing safestring methods --- types/nunjucks/index.d.ts | 6 +++++- types/nunjucks/nunjucks-tests.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/nunjucks/index.d.ts b/types/nunjucks/index.d.ts index b0a1e86508..e2bdbf2a8a 100644 --- a/types/nunjucks/index.d.ts +++ b/types/nunjucks/index.d.ts @@ -140,6 +140,10 @@ export class PrecompiledLoader extends Loader implements ILoader { export namespace runtime { class SafeString { - constructor(...args: any[]); + constructor(val: string); + val: string; + length: number; + valueOf(): string; + toString(): string; } } diff --git a/types/nunjucks/nunjucks-tests.ts b/types/nunjucks/nunjucks-tests.ts index 91caf67a73..6dd4d8fed7 100644 --- a/types/nunjucks/nunjucks-tests.ts +++ b/types/nunjucks/nunjucks-tests.ts @@ -53,4 +53,4 @@ class MyLoader extends nunjucks.Loader implements nunjucks.ILoader { env = new nunjucks.Environment(new MyLoader()); -new nunjucks.runtime.SafeString(); +new nunjucks.runtime.SafeString("an unsafe string"); From 887a2752a3622d147f501ab7f2689fa47969263a Mon Sep 17 00:00:00 2001 From: Tomi Turtiainen Date: Tue, 14 Aug 2018 22:26:18 +0300 Subject: [PATCH 200/346] Add typings for universal-cookie --- types/universal-cookie/index.d.ts | 102 ++++++++++++++++++ types/universal-cookie/tsconfig.json | 16 +++ types/universal-cookie/tslint.json | 1 + .../universal-cookie-tests.ts | 20 ++++ 4 files changed, 139 insertions(+) create mode 100644 types/universal-cookie/index.d.ts create mode 100644 types/universal-cookie/tsconfig.json create mode 100644 types/universal-cookie/tslint.json create mode 100644 types/universal-cookie/universal-cookie-tests.ts diff --git a/types/universal-cookie/index.d.ts b/types/universal-cookie/index.d.ts new file mode 100644 index 0000000000..4bba4adee6 --- /dev/null +++ b/types/universal-cookie/index.d.ts @@ -0,0 +1,102 @@ +// Type definitions for universal-cookie 2.2 +// Project: https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie#readme +// Definitions by: Tomi Turtiainen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export interface CookiesByName { + [cookieName: string]: string; +} + +export interface GetOpts { + /** + * do not convert the cookie into an object no matter what + */ + doNotParse: boolean; +} + +export interface CookieOpts { + /** + * cookie path, use / as the path if you want your cookie to be accessible on all pages + */ + path?: string; + + /** + * absolute expiration date for the cookie + */ + expires?: Date; + + /** + * relative max age of the cookie from when the client receives it in second + */ + maxAge?: number; + + /** + * domain for the cookie (sub.domain.com or .allsubdomains.com) + */ + domain?: string; + + /** + * Is only accessible through HTTPS? + */ + secure?: boolean; + + /** + * Is only the server can access the cookie? + */ + httpOnly?: boolean; +} + +export type ChangeListenerCallback = ( + name: string, + value: string | object, + options: CookieOpts +) => void; + +export default class Cookies { + constructor(cookieHeader?: string | CookiesByName); + + /** + * Get a cookie value + * + * @param name cookie name + * @param options.doNotParse do not convert the cookie into an object no matter what + */ + get(name: string, options?: GetOpts): string; + + /** + * Get all cookies + * + * @param options.doNotParse do not convert the cookie into an object no matter what + */ + getAll(options?: GetOpts): CookiesByName; + + /** + * Set a cookie value + * + * @param name cookie name + * @param value save the value and stringify the object if needed + * @param options Support all the cookie options from RFC 6265 + */ + set(name: string, value: string | object, options?: CookieOpts): void; + + /** + * Set a cookie value + * + * @param name cookie name + * @param options Support all the cookie options from RFC 6265 + */ + remove(name: string, options?: CookieOpts): void; + + /** + * Add a listener to when a cookie is set or removed. + * + * @param callback Call that will be called with the first argument containing name, value and options of the changed cookie. + */ + addChangeListener(callback: ChangeListenerCallback): void; + + /** + * Remove a listener from the change callback. + */ + removeChangeListener(callback: ChangeListenerCallback): void; +} diff --git a/types/universal-cookie/tsconfig.json b/types/universal-cookie/tsconfig.json new file mode 100644 index 0000000000..1c324ed8c6 --- /dev/null +++ b/types/universal-cookie/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "universal-cookie-tests.ts"] +} diff --git a/types/universal-cookie/tslint.json b/types/universal-cookie/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/universal-cookie/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/universal-cookie/universal-cookie-tests.ts b/types/universal-cookie/universal-cookie-tests.ts new file mode 100644 index 0000000000..9591fa3c5b --- /dev/null +++ b/types/universal-cookie/universal-cookie-tests.ts @@ -0,0 +1,20 @@ +import Cookies from "universal-cookie"; + +const cookies = new Cookies(); +new Cookies("My=Cookie"); +new Cookies({}); + +cookies.set("my", "cookie"); +cookies.set("object", { some: "value" }); +cookies.set("with", "options", { + path: "/" +}); + +cookies.get("my"); +cookies.getAll(); + +cookies.remove("object"); +cookies.remove("object", { path: "/" }); + +cookies.addChangeListener((name, value) => {}); +cookies.removeChangeListener((name, value) => {}); From ae7488c42654616e3d7997866d058f09aa6dc899 Mon Sep 17 00:00:00 2001 From: Ross Solomon Date: Tue, 14 Aug 2018 17:13:06 -0700 Subject: [PATCH 201/346] Remove codeowner; add back lint rule; fix types --- .github/CODEOWNERS | 1 - types/shallow-equals/index.d.ts | 4 +--- types/shallow-equals/tsconfig.json | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d15d79bc9d..8c7f823a07 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3968,7 +3968,6 @@ /types/set-value/ @DanielRosenwasser /types/settings/ @shreyjain1994 /types/sha1/ @arcdev1 -/types/shallow-equals/ @rsolomon /types/shallowequal/ @seansfkelley /types/shapefile/ @DenisCarriere /types/sharedworker/ @nakakura diff --git a/types/shallow-equals/index.d.ts b/types/shallow-equals/index.d.ts index 69e1a6c552..7d91b03923 100644 --- a/types/shallow-equals/index.d.ts +++ b/types/shallow-equals/index.d.ts @@ -8,7 +8,5 @@ export = shallow_equals; declare function shallow_equals( a?: A, b?: B, - compare?: (objA?: A, objB?: B) => boolean, + compare?: (objA: A, objB: B) => boolean, ): boolean; - -declare namespace shallow_equals {} diff --git a/types/shallow-equals/tsconfig.json b/types/shallow-equals/tsconfig.json index 74f59acd72..83137182f4 100644 --- a/types/shallow-equals/tsconfig.json +++ b/types/shallow-equals/tsconfig.json @@ -4,7 +4,7 @@ "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": ["../"], From 39ad4eadfcdd6dddf07744a688064ff727824f3f Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Wed, 15 Aug 2018 11:56:08 +0900 Subject: [PATCH 202/346] guess it wants me to export everything --- types/react-native-vector-icons/FontAwesome5.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-native-vector-icons/FontAwesome5.d.ts b/types/react-native-vector-icons/FontAwesome5.d.ts index 44fca921cc..79c77ff0e2 100644 --- a/types/react-native-vector-icons/FontAwesome5.d.ts +++ b/types/react-native-vector-icons/FontAwesome5.d.ts @@ -8,16 +8,16 @@ export const FA5Style: { brand: 3; }; -type ValueOf = T[keyof T]; +export type ValueOf = T[keyof T]; // borrowed from // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html -type Omit = Pick>; +export type Omit = Pick>; export type FontAwesome5IconVariants = keyof Omit; // modified from https://stackoverflow.com/a/49725198/1105281 -type AllowOnlyOne = Omit & +export type AllowOnlyOne = Omit & { [K in Keys]-?: Partial> & Partial, undefined>> From a2fe5554f7700458284d4a53bcf4b0be6b253659 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Tue, 14 Aug 2018 23:21:10 -0400 Subject: [PATCH 203/346] [react-native] Add hardwareAccelerated to Modal --- types/react-native/index.d.ts | 45 ++++++++++++++++++------------- types/react-native/test/index.tsx | 5 ++++ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 5a49af5685..184fc39724 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4754,7 +4754,7 @@ declare class MaskedViewComponent extends React.Component {} declare const MaskedViewBase: Constructor & typeof MaskedViewComponent; export class MaskedViewIOS extends MaskedViewBase {} -export interface ModalProps { +export interface ModalBaseProps { // Only `animated` is documented. The JS code says `animated` is // deprecated and `animationType` is preferred. animated?: boolean; @@ -4784,35 +4784,42 @@ export interface ModalProps { * The `onShow` prop allows passing a function that will be called once the modal has been shown. */ onShow?: (event: NativeSyntheticEvent) => void; +} + +export interface ModalPropsIOS { + /** + * The `presentationStyle` determines the style of modal to show + */ + presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; + /** * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations. * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field. - * @platform ios */ - supportedOrientations?: ( - | "portrait" - | "portrait-upside-down" - | "landscape" - | "landscape-left" - | "landscape-right")[]; + supportedOrientations?: Array<"portrait" | "portrait-upside-down" | "landscape" | "landscape-left" | "landscape-right">; + + /** + * The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed. + */ + onDismiss?: () => void; + /** * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. - * @platform ios */ onOrientationChange?: (event?: NativeSyntheticEvent) => void; - /** - * The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed. - * @platform ios - */ - onDismiss?: () => void; - /** - * The `presentationStyle` determines the style of modal to show - * @platform ios - */ - presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } +export interface ModalPropsAndroid { + /** + * Controls whether to force hardware acceleration for the underlying window. + */ + hardwareAccelerated?: boolean; +} + + +export type ModalProps = ModalBaseProps & ModalPropsIOS & ModalPropsAndroid; + export class Modal extends React.Component {} /** diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 0399d41321..60c4d89302 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -71,6 +71,7 @@ import { TextInputSubmitEditingEventData, WebView, KeyboardAvoidingView, + Modal, } from "react-native"; declare module "react-native" { @@ -754,3 +755,7 @@ const AlertIOSTest = () => { 'email-address' ); } + +const ModalTest = () => ( + +) From b6cf2fda64399bd99cf6fde97928ec2cbf91eeff Mon Sep 17 00:00:00 2001 From: jerray Date: Wed, 15 Aug 2018 13:58:19 +0800 Subject: [PATCH 204/346] Add server id property and persistence namespace --- types/mosca/index.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/mosca/index.d.ts b/types/mosca/index.d.ts index 178f150d05..aee3625d10 100644 --- a/types/mosca/index.d.ts +++ b/types/mosca/index.d.ts @@ -1,9 +1,11 @@ // Type definitions for mosca 2.8 // Project: https://github.com/mcollina/mosca // Definitions by: Joao Gabriel Gouveia +// Jerray Fu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class Server { + id: string; opts: any; modernOpts: any; clients: any; @@ -83,3 +85,15 @@ export interface Message { qos: number; retain: boolean; } + +export namespace persistence { + interface Persistence { + wire(server: Server): void; + } + type FactoryFunc = (options: { [key: string]: any }) => Persistence; + + const Redis: FactoryFunc; + const Mongo: FactoryFunc; + const LevelUp: FactoryFunc; + const Memory: FactoryFunc; +} From 3961ab348445cf7842811ef118120b420aed3291 Mon Sep 17 00:00:00 2001 From: Kodai Nakamura Date: Wed, 15 Aug 2018 15:23:24 +0900 Subject: [PATCH 205/346] Update types --- types/reach__router/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/reach__router/index.d.ts b/types/reach__router/index.d.ts index f52b3954e3..93727287bd 100644 --- a/types/reach__router/index.d.ts +++ b/types/reach__router/index.d.ts @@ -60,13 +60,15 @@ export interface LinkGetProps { export class Link extends React.Component> {} -export interface RedirectProps { +export interface RedirectProps { from?: string; to: string; noThrow?: boolean; + state?: TState; + replace?: boolean; } -export class Redirect extends React.Component {} +export class Redirect extends React.Component> {} export interface MatchProps { path: string; @@ -74,7 +76,7 @@ export interface MatchProps { } export type MatchRenderFn = ( - props: MatchRenderProps, + props: MatchRenderProps ) => React.ReactNode; export interface MatchRenderProps { @@ -104,7 +106,7 @@ export interface LocationProviderProps { } export type LocationProviderRenderFn = ( - context: LocationContext, + context: LocationContext ) => React.ReactNode; export interface LocationContext { From 32e4b4da232f2c0e2eff0b15ee8892ce9b0a3056 Mon Sep 17 00:00:00 2001 From: Kodai Nakamura Date: Wed, 15 Aug 2018 15:33:48 +0900 Subject: [PATCH 206/346] Update test --- types/reach__router/reach__router-tests.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/types/reach__router/reach__router-tests.tsx b/types/reach__router/reach__router-tests.tsx index 56e2305a2e..0cada3367d 100644 --- a/types/reach__router/reach__router-tests.tsx +++ b/types/reach__router/reach__router-tests.tsx @@ -1,4 +1,10 @@ -import { Link, Location, RouteComponentProps, Router } from "@reach/router"; +import { + Link, + Location, + RouteComponentProps, + Router, + Redirect +} from "@reach/router"; import * as React from "react"; import { render } from "react-dom"; @@ -21,9 +27,10 @@ render( + - {(context) => ( + {context => ( <>
hostname is {context.location.hostname}
); From e5a5972e6fef4261cdf13d696d1a25a2bd456ea7 Mon Sep 17 00:00:00 2001 From: "idan.d" Date: Fri, 17 Aug 2018 01:21:01 +0300 Subject: [PATCH 258/346] strictly typed Schema set arguments --- types/mongoose/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 5eea1625b5..c24427498f 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -769,8 +769,8 @@ declare module "mongoose" { * @param key option name * @param value if not passed, the current option value is returned */ - set(key: string): any; - set(key: string, value: any): this; + set(key: T): SchemaOptions[T]; + set(key: T, value: SchemaOptions[T]): this; /** * Adds static "class" methods to Models compiled from this schema. From ecc4b01429190fcf8dcff200b5b695349b8fe8ad Mon Sep 17 00:00:00 2001 From: "idan.d" Date: Fri, 17 Aug 2018 01:39:26 +0300 Subject: [PATCH 259/346] changed mongoose tests for schema set method --- types/mongoose/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index c24427498f..90bb04747f 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.1 +// Type definitions for Mongoose 5.2.2 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -10,6 +10,7 @@ // jussikinnula // ondratra // alfirin +// Idan Dardikman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 53b6b3a758ae77945af7b0a1238da547d7b6afa4 Mon Sep 17 00:00:00 2001 From: "idan.d" Date: Fri, 17 Aug 2018 01:43:13 +0300 Subject: [PATCH 260/346] Revert "changed mongoose tests for schema set method" This reverts commit ecc4b01429190fcf8dcff200b5b695349b8fe8ad. --- types/mongoose/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 90bb04747f..c24427498f 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.2 +// Type definitions for Mongoose 5.2.1 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -10,7 +10,6 @@ // jussikinnula // ondratra // alfirin -// Idan Dardikman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From fb2be72adecc7dcc74df962c456edfa2e8acea05 Mon Sep 17 00:00:00 2001 From: "idan.d" Date: Fri, 17 Aug 2018 01:43:48 +0300 Subject: [PATCH 261/346] changed mongoose tests for schema set method --- types/mongoose/mongoose-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 2fe1e1b12e..02227c681d 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -429,7 +429,7 @@ schema.queue('m1', [1, 2, 3]).queue('m2', [[]]); schema.remove('path'); schema.remove(['path1', 'path2', 'path3']); schema.requiredPaths(true)[0].toLowerCase(); -schema.set('key', 999).set('key'); +schema.set('id', true).set('id'); schema.static('static', cb).static({ s1: cb, s2: cb From fd13f0321ae8150c9c9e4e86c8abdf58de0a5347 Mon Sep 17 00:00:00 2001 From: "idan.d" Date: Fri, 17 Aug 2018 01:44:35 +0300 Subject: [PATCH 262/346] updated mongoose minor version number --- types/mongoose/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index c24427498f..90bb04747f 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.1 +// Type definitions for Mongoose 5.2.2 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -10,6 +10,7 @@ // jussikinnula // ondratra // alfirin +// Idan Dardikman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 2132a14ea96e61a3ef951d3dce3dad43e07d339c Mon Sep 17 00:00:00 2001 From: Tyrone Dougherty Date: Fri, 17 Aug 2018 11:11:59 +1000 Subject: [PATCH 263/346] @types/highcharts - add AnimationOptions type to ChartObject#update method signature and update tests accordingly --- types/highcharts/index.d.ts | 4 ++-- types/highcharts/test/index.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index afe1e51a98..2ec1d268d6 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -6487,10 +6487,10 @@ declare namespace Highcharts { * @param [boolean] redraw Whether to redraw the chart. Defaults to true. * @param [boolean] oneToOne When true, the series, xAxis and yAxis collections will be updated one to one, and * items will be either added or removed to match the new updated options. Defaults to false. - * @param [boolean] animation Whether to apply animation, and optionally animation configuration. + * @param [(boolean | AnimationOptions)] animation Whether to apply animation, and optionally animation configuration. * @since 5.0.0 */ - update(options: Options, redraw?: boolean, oneToOne?: boolean, animation?: boolean): void; + update(options: Options, redraw?: boolean, oneToOne?: boolean, animation?: boolean | AnimationOptions): void; /** * This method is deprecated as of 2.0.1. Updating the chart position after a move operation is no longer necessary. * @since 1.2.5 diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts index 1d6e921461..963a53d9bb 100644 --- a/types/highcharts/test/index.ts +++ b/types/highcharts/test/index.ts @@ -2457,6 +2457,11 @@ function test_ChartObject() { chart.update( {}); chart.update( {}, true); chart.update( {}, true, true); + chart.update( {}, true, true, true); + chart.update( {}, true, true, { + delay: 500, + duration: 3000 + }); } function test_ElementObject() { From 628934f8e6f2f392726871e59550b3d25bfed667 Mon Sep 17 00:00:00 2001 From: Tyrone Dougherty Date: Fri, 17 Aug 2018 11:52:22 +1000 Subject: [PATCH 264/346] @types/highcharts - Define the AnimationOptions interface and update tests accordingly --- types/highcharts/index.d.ts | 20 ++++++++++++++++++++ types/highcharts/test/index.ts | 5 ++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index 2ec1d268d6..fea56746da 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -474,6 +474,26 @@ declare namespace Highcharts { skipNullPoints?: boolean; } + interface AnimationOptions { + /** + * The animation duration in milliseconds. + */ + duration: number; + /** + * The name of an easing function as defined on the Math object. + */ + easing?: string; + /** + * A callback function to exectute when the animation finishes. + */ + complete?: () => void; + /** + * A callback function to execute on each step of each attribute or CSS property that's being animated. + * The first argument contains information about the animation and progress. + */ + step?: () => void; + } + interface AxisTitle { /** * Alignment of the title relative to the axis values. Possible values are 'low', 'middle' or 'high'. diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts index 963a53d9bb..bafb4a7516 100644 --- a/types/highcharts/test/index.ts +++ b/types/highcharts/test/index.ts @@ -2458,9 +2458,8 @@ function test_ChartObject() { chart.update( {}, true); chart.update( {}, true, true); chart.update( {}, true, true, true); - chart.update( {}, true, true, { - delay: 500, - duration: 3000 + chart.update( {}, true, true, { + duration: 3000, }); } From 3e8de0faacdf61f0dccdc7b83edee2c51d83e79e Mon Sep 17 00:00:00 2001 From: Tyrone Dougherty Date: Fri, 17 Aug 2018 11:58:07 +1000 Subject: [PATCH 265/346] @types/highcharts - add missing time parameter (and its associated TimeOptions interface type) to the Options interface --- types/highcharts/index.d.ts | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index fea56746da..3d17b3b281 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -5712,6 +5712,46 @@ declare namespace Highcharts { y?: number | null; } + interface TimeOptions { + /** + * A custom Date class for advanced date handling. For example, JDate can be hooked in to handle Jalali dates. + * @default undefined + * @since 4.0.4 + */ + Date?: Date; + /** + * A callback to return the time zone offset for a given datetime. It takes the timestamp in terms of milliseconds since + * January 1 1970, and returns the timezone offset in minutes. This provides a hook for drawing time based charts in + * specific time zones using their local DST crossover dates, with the help of external libraries. + * @default undefined + * @since 4.1.0 + */ + getTimezoneOffset?: (timestamp: Date) => number; + /** + * Requires moment.js. If the timezone option is specified, it creates a default getTimezoneOffset function that looks + * up the specified timezone in moment.js. If moment.js is not included, this throws a Highcharts error in the console, + * but does not crash the chart. + * @default undefined + * @since 5.0.7 + */ + timezone?: string; + /** + * The timezone offset in minutes. Positive values are west, negative values are east of UTC, as in the ECMAScript + * getTimezoneOffset method. Use this to display UTC based data in a predefined time zone. + * @default 0 + * @since 3.0.8 + */ + timezoneOffset?: number; + /** + * Whether to use UTC time for axis scaling, tickmark placement and time display in Highcharts.dateFormat. + * Advantages of using UTC is that the time displays equally regardless of the user agent's time zone settings. + * Local time can be used when the data is loaded in real time or when correct Daylight Saving Time transitions are required. + * @default undefined + * @since 6.0.5 + */ + useUTC?: boolean; + } + interface TitleOptions { /** * The horizontal alignment of the title. Can be one of 'left', 'center' and 'right'. @@ -6138,6 +6178,10 @@ declare namespace Highcharts { * The chart's subtitle */ subtitle?: SubtitleOptions; + /** + * The chart's time options + */ + time?: TimeOptions; /** * The chart's main title. */ From e4d1d1b9a4a124e8cdfb0998e4710f34a8943512 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Fri, 17 Aug 2018 11:57:59 +0900 Subject: [PATCH 266/346] [@types/jws] Allow headers to have extra values. --- types/jws/index.d.ts | 1 + types/jws/jws-tests.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/types/jws/index.d.ts b/types/jws/index.d.ts index f384fadefc..030d670f4a 100644 --- a/types/jws/index.d.ts +++ b/types/jws/index.d.ts @@ -149,4 +149,5 @@ export type Algorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | export interface Header { alg: Algorithm; + [key: string]: string; } diff --git a/types/jws/jws-tests.ts b/types/jws/jws-tests.ts index d5271b24ca..c6e62378f8 100644 --- a/types/jws/jws-tests.ts +++ b/types/jws/jws-tests.ts @@ -20,6 +20,13 @@ const signature = jws.sign({ secret: 'has a van', }); +// jws.sign with extra header values +const signatureWithHeaderParams = jws.sign({ + header: { alg: 'HS256', foo: 'bar' }, + payload: 'h. jon benjamin', + secret: 'has a van', +}); + // jws.decode const message = jws.decode('djfakdid'); From c95ca69eacb01f86ff06ecd9c1999607cec44560 Mon Sep 17 00:00:00 2001 From: Tyrone Dougherty Date: Fri, 17 Aug 2018 13:40:07 +1000 Subject: [PATCH 267/346] Remove unnecessary whitespace --- types/highcharts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index 3d17b3b281..a71e07c925 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -5720,7 +5720,7 @@ declare namespace Highcharts { */ Date?: Date; /** - * A callback to return the time zone offset for a given datetime. It takes the timestamp in terms of milliseconds since + * A callback to return the time zone offset for a given datetime. It takes the timestamp in terms of milliseconds since * January 1 1970, and returns the timezone offset in minutes. This provides a hook for drawing time based charts in * specific time zones using their local DST crossover dates, with the help of external libraries. * @default undefined From f62ee2bc692958546a300ce540eee64d2d481941 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Fri, 17 Aug 2018 12:47:02 +0900 Subject: [PATCH 268/346] Use name instead since in this code we use key often for a different meaning. --- types/jws/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jws/index.d.ts b/types/jws/index.d.ts index 030d670f4a..fdbf1851c4 100644 --- a/types/jws/index.d.ts +++ b/types/jws/index.d.ts @@ -149,5 +149,5 @@ export type Algorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | export interface Header { alg: Algorithm; - [key: string]: string; + [name: string]: string; } From 3b1261a247a8f9568b01b3a9bb996095054c5d34 Mon Sep 17 00:00:00 2001 From: yasupeke Date: Fri, 17 Aug 2018 16:24:00 +0900 Subject: [PATCH 269/346] fix comment --- types/react-paginate/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/react-paginate/index.d.ts b/types/react-paginate/index.d.ts index 0e0daa376a..83a03ac838 100644 --- a/types/react-paginate/index.d.ts +++ b/types/react-paginate/index.d.ts @@ -1,8 +1,12 @@ // Type definitions for react-paginate 5.2 // Project: https://github.com/AdeleD/react-paginate -// Definitions by: Yasunori Ohoka +// Definitions by: Simon Hartcher +// Wouter Hardeman +// pegel03 +// Simon Archer +// Yasunori Ohoka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.9 +// TypeScript Version: 2.8 import * as React from 'react'; From 9555e31a1ca6a697f3e03aa223b85c12da0be7e7 Mon Sep 17 00:00:00 2001 From: Sascha Englert Date: Fri, 17 Aug 2018 12:34:20 +0200 Subject: [PATCH 270/346] Added interfaces for Room and Rooms dictonaries --- types/socket.io/index.d.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/types/socket.io/index.d.ts b/types/socket.io/index.d.ts index 2b5100abb2..4396299a32 100644 --- a/types/socket.io/index.d.ts +++ b/types/socket.io/index.d.ts @@ -696,6 +696,22 @@ declare namespace SocketIO { query: any; } + /** + * The interface describing a room + */ + interface Room { + sockets: {[id: string]: boolean } + } + + /** + * The interface describing a dictionary of rooms + * Where room is the name of the room + */ + + interface Rooms { + [room: string]: Room + } + /** * The interface used when dealing with rooms etc */ @@ -708,9 +724,8 @@ declare namespace SocketIO { /** * A dictionary of all the rooms that we have in this namespace - * The rooms are made of a `sockets` key which is the dictionary of sockets per ID */ - rooms: {[room: string]: {sockets: {[id: string]: boolean }, length: number }}; + rooms: Rooms; /** * A dictionary of all the socket ids that we're dealing with, and all From 794a2adf7dc0afd46267afcb99b1fa6039ae73d0 Mon Sep 17 00:00:00 2001 From: Sascha Englert Date: Fri, 17 Aug 2018 12:49:21 +0200 Subject: [PATCH 271/346] Added missing length field --- types/socket.io/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/socket.io/index.d.ts b/types/socket.io/index.d.ts index 4396299a32..6c12e444b0 100644 --- a/types/socket.io/index.d.ts +++ b/types/socket.io/index.d.ts @@ -700,7 +700,8 @@ declare namespace SocketIO { * The interface describing a room */ interface Room { - sockets: {[id: string]: boolean } + sockets: {[id: string]: boolean }; + length: number; } /** @@ -709,7 +710,7 @@ declare namespace SocketIO { */ interface Rooms { - [room: string]: Room + [room: string]: Room; } /** From bac1c2efce28bc074ba496671e1a65b4a1a5d029 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 17 Aug 2018 08:28:17 -0400 Subject: [PATCH 272/346] Remove optional ? from callback params http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#optional-parameters-in-callbacks --- types/dialogflow/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts index 96c4b11016..c847b662c2 100644 --- a/types/dialogflow/index.d.ts +++ b/types/dialogflow/index.d.ts @@ -18,16 +18,16 @@ export namespace v2 { getAgent( request: GetAgentRequest, options?: gax.CallOptions, - cb?: (err?: Error, agent?: Agent) => void + cb?: (err: Error, agent: Agent) => void ): Promise<[Agent]>; searchAgents( request: SearchAgentRequest, options?: gax.CallOptions, cb?: ( - err?: Error, - agents?: Agent[], - arg3?: any, - response?: any + err: Error, + agents: Agent[], + arg3: any, + response: any ) => void ): Promise; searchAgentsStream( @@ -37,22 +37,22 @@ export namespace v2 { trainAgent( request: TrainAgentRequest, options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void + cb?: (err: Error, operation: gax.Operation) => void ): Promise<[gax.Operation]>; exportAgent( request: ExportAgentRequest, options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void + cb?: (err: Error, operation: gax.Operation) => void ): Promise<[gax.Operation]>; importAgent( request: ImportAgentRequest, options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void + cb?: (err: Error, operation: gax.Operation) => void ): Promise<[gax.Operation]>; restoreAgent( request: RestoreAgentRequest, options?: gax.CallOptions, - cb?: (err?: Error, operation?: gax.Operation) => void + cb?: (err: Error, operation: gax.Operation) => void ): Promise<[gax.Operation]>; } From 9ce09927776770b74d4dbb2e3eaa55693bc9121e Mon Sep 17 00:00:00 2001 From: Francis Gulotta Date: Fri, 17 Aug 2018 06:17:42 -0700 Subject: [PATCH 273/346] iltorb: Add promised based api --- types/iltorb/iltorb-tests.ts | 8 ++++++++ types/iltorb/index.d.ts | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/iltorb/iltorb-tests.ts b/types/iltorb/iltorb-tests.ts index 66bda251d4..202b9ebbd0 100644 --- a/types/iltorb/iltorb-tests.ts +++ b/types/iltorb/iltorb-tests.ts @@ -20,6 +20,14 @@ br.compress(Buffer.from('foo', 'utf8'), onCompress); br.compress(Buffer.from('foo', 'utf8'), opts, onCompress); +br + .compress(Buffer.from('foobar')) + .then(compressedData => { + br.decompress(compressedData).then(data => { + console.log(data.equals(Buffer.from('foobar'))); + }); + }); + const stream = br.compressStream(); stream.flush(); diff --git a/types/iltorb/index.d.ts b/types/iltorb/index.d.ts index 5ac707a51b..a1cf04844c 100644 --- a/types/iltorb/index.d.ts +++ b/types/iltorb/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for iltorb 2.0 +// Type definitions for iltorb 2.3 // Project: https://github.com/MayhemYDG/iltorb // Definitions by: Arturas Molcanovas +// Francis Gulotta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -25,8 +26,10 @@ export type IltorbCallback = (err: Error | null | undefined, output: Buffer) => export function compress(buffer: Buffer, options: BrotliEncodeParams, callback: IltorbCallback): void; export function compress(buffer: Buffer, callback: IltorbCallback): void; +export function compress(buffer: Buffer, options?: BrotliEncodeParams): Promise; export function decompress(buffer: Buffer, callback: IltorbCallback): void; +export function decompress(buffer: Buffer): Promise; export function compressSync(buffer: Buffer, options?: BrotliEncodeParams): Buffer; export function decompressSync(buffer: Buffer): Buffer; From e6e7ed3a9e6d74d7cca78c0ff69908e4fd659d9d Mon Sep 17 00:00:00 2001 From: Romain Faust Date: Fri, 17 Aug 2018 15:36:49 +0200 Subject: [PATCH 274/346] [@types/gulp-jsonmin] Add type definitions --- types/gulp-jsonmin/gulp-jsonmin-tests.ts | 5 +++++ types/gulp-jsonmin/index.d.ts | 18 ++++++++++++++++++ types/gulp-jsonmin/tsconfig.json | 23 +++++++++++++++++++++++ types/gulp-jsonmin/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/gulp-jsonmin/gulp-jsonmin-tests.ts create mode 100644 types/gulp-jsonmin/index.d.ts create mode 100644 types/gulp-jsonmin/tsconfig.json create mode 100644 types/gulp-jsonmin/tslint.json diff --git a/types/gulp-jsonmin/gulp-jsonmin-tests.ts b/types/gulp-jsonmin/gulp-jsonmin-tests.ts new file mode 100644 index 0000000000..5c0cf66cc3 --- /dev/null +++ b/types/gulp-jsonmin/gulp-jsonmin-tests.ts @@ -0,0 +1,5 @@ +import * as GulpJsonmin from 'gulp-jsonmin'; + +GulpJsonmin(); +GulpJsonmin({}); +GulpJsonmin({ verbose: true }); diff --git a/types/gulp-jsonmin/index.d.ts b/types/gulp-jsonmin/index.d.ts new file mode 100644 index 0000000000..16a4347dd2 --- /dev/null +++ b/types/gulp-jsonmin/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for gulp-jsonmin 1.1 +// Project: https://github.com/englercj/gulp-jsonmin +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Transform } from 'stream'; + +declare function jsonmin(options?: jsonmin.Options): Transform; + +declare namespace jsonmin { + interface Options { + verbose?: boolean; + } +} + +export = jsonmin; diff --git a/types/gulp-jsonmin/tsconfig.json b/types/gulp-jsonmin/tsconfig.json new file mode 100644 index 0000000000..7f1244285f --- /dev/null +++ b/types/gulp-jsonmin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-jsonmin-tests.ts" + ] +} diff --git a/types/gulp-jsonmin/tslint.json b/types/gulp-jsonmin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-jsonmin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a02804fd8da20d27c48252ed309a331001329acc Mon Sep 17 00:00:00 2001 From: Alexey Morozov Date: Fri, 17 Aug 2018 16:42:07 +0300 Subject: [PATCH 275/346] Update sparqljs to v2.1 (remove parser options, support CLEAR and DROP operations) --- types/sparqljs/index.d.ts | 59 +++++++++++++++++++++++--------- types/sparqljs/sparqljs-tests.ts | 49 ++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 19 deletions(-) diff --git a/types/sparqljs/index.d.ts b/types/sparqljs/index.d.ts index 4b63cf8a59..dfc04ccfcd 100644 --- a/types/sparqljs/index.d.ts +++ b/types/sparqljs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for sparqljs 1.5 +// Type definitions for sparqljs 2.1 // Project: https://github.com/RubenVerborgh/SPARQL.js // Definitions by: Alexey Morozov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,6 @@ export const Parser: { new ( prefixes?: { [prefix: string]: string }, baseIRI?: string, - options?: ParserOptions, ): SparqlParser; }; @@ -16,11 +15,6 @@ export const Generator: { new (options?: GeneratorOptions): SparqlGenerator; }; -export interface ParserOptions { - /** @default true */ - collapseGroups?: boolean; -} - export interface GeneratorOptions { allPrefixes?: boolean; } @@ -94,6 +88,7 @@ export type UpdateOperation = InsertDeleteOperation | ManagementOperation; export interface InsertDeleteOperation { updateType: 'insert' | 'delete' | 'deletewhere' | 'insertdelete'; + graph?: string; insert?: Quads[]; delete?: Quads[]; where?: Pattern[]; @@ -101,17 +96,47 @@ export interface InsertDeleteOperation { export type Quads = BgpPattern | GraphQuads; -export interface ManagementOperation { - type: 'load' | 'copy' | 'move' | 'add'; +export type ManagementOperation = + | CopyMoveAddOperation + | LoadOperation + | CreateOperation + | ClearDropOperation; + +export interface CopyMoveAddOperation { + type: 'copy' | 'move' | 'add'; silent: boolean; - source: string | { - type: 'graph'; - default: boolean; - }; - destination?: string | { - type: 'graph'; - name: string; - }; + source: GraphOrDefault; + destination: GraphOrDefault; +} + +export interface LoadOperation { + type: 'load'; + silent: boolean; + source: string; + destination: string | false; +} + +export interface CreateOperation { + type: 'create'; + silent: boolean; + graph: string; +} + +export interface ClearDropOperation { + type: 'clear' | 'drop'; + silent: boolean; + graph: GraphReference; +} + +export interface GraphOrDefault { + type: 'graph'; + name?: string; + default?: boolean; +} + +export interface GraphReference extends GraphOrDefault { + named?: boolean; + all?: boolean; } /** diff --git a/types/sparqljs/sparqljs-tests.ts b/types/sparqljs/sparqljs-tests.ts index b8c0e36109..2fe29b40c8 100644 --- a/types/sparqljs/sparqljs-tests.ts +++ b/types/sparqljs/sparqljs-tests.ts @@ -26,8 +26,7 @@ function officialExamples() { function advancedOptions() { const parser = new SparqlJs.Parser( {rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'}, - 'http://example.com', - {collapseGroups: true} + 'http://example.com' ); const generator = new SparqlJs.Generator({allPrefixes: false}); } @@ -122,3 +121,49 @@ function basicQueries() { ], }; } + +/** + * Update query structure + */ +function updateQueries() { + const bgp: SparqlJs.BgpPattern = { + type: 'bgp', + triples: [], + }; + + const update: SparqlJs.Update = { + type: 'update', + prefixes: { + rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + }, + updates: [ + { + updateType: 'insertdelete', + graph: 'http://example.com/foo', + insert: [bgp], + delete: [bgp], + where: [], + }, + { + type: 'copy', + silent: true, + source: { + type: 'graph', + name: 'http://example.com/foo', + }, + destination: { + type: 'graph', + default: true, + }, + }, + { + type: 'clear', + silent: false, + graph: { + type: 'graph', + all: true, + }, + }, + ], + }; +} From d6fba2b95bf621a737575596ded49ca516d68bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 Aug 2018 16:43:27 +0200 Subject: [PATCH 276/346] Update NavigationActions API v2 --- types/react-navigation/index.d.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 31c3269af4..d1125201f2 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -996,25 +996,16 @@ export namespace NavigationActions { const BACK: 'Navigation/BACK'; const INIT: 'Navigation/INIT'; const NAVIGATE: 'Navigation/NAVIGATE'; - const RESET: 'Navigation/RESET'; const SET_PARAMS: 'Navigation/SET_PARAMS'; - const URI: 'Navigation/URI'; - const POP: 'Navigation/POP'; - const POP_TO_TOP: 'Navigation/POP_TO_TOP'; function init(options?: NavigationInitActionPayload): NavigationInitAction; function navigate( options: NavigationNavigateActionPayload ): NavigationNavigateAction; - function reset(options: NavigationResetActionPayload): NavigationResetAction; function back(options?: NavigationBackActionPayload): NavigationBackAction; function setParams( options: NavigationSetParamsActionPayload ): NavigationSetParamsAction; - function pop(options: NavigationPopActionPayload): NavigationPopAction; - function popToTop( - options: NavigationPopToTopActionPayload - ): NavigationPopToTopAction; } /** From e7c35dc81205d35145fc670a3224269c72f65bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 Aug 2018 16:49:19 +0200 Subject: [PATCH 277/346] Update Test --- .../react-navigation-tests.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 60ca9b4758..30f4cad9a1 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -410,14 +410,6 @@ const navigateAction: NavigationNavigateAction = NavigationActions.navigate({ action: NavigationActions.navigate({ routeName: "BarScreen" }) }); -const resetAction: NavigationResetAction = NavigationActions.reset({ - index: 0, - key: "foo", - actions: [ - NavigationActions.navigate({ routeName: "FooScreen" }) - ] -}); - const backAction: NavigationBackAction = NavigationActions.back({ key: "foo" }); @@ -429,16 +421,6 @@ const setParamsAction: NavigationSetParamsAction = NavigationActions.setParams({ } }); -const popAction: NavigationPopAction = NavigationActions.pop({ - n: 1, - immediate: true -}); - -const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ - key: "foo", - immediate: true -}); - class Page1 extends React.Component { } const RootNavigator: NavigationContainer = createSwitchNavigator({ From 22b493043c6fb617245aff813a91271123e516be Mon Sep 17 00:00:00 2001 From: michahell Date: Fri, 17 Aug 2018 17:04:08 +0200 Subject: [PATCH 278/346] changes isRest parameter to union type `&` and optional `isRest?: boolean` argument --- types/office-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 10e8412382..b99714b1fd 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -13586,7 +13586,7 @@ declare namespace Office { * asyncContext: Any state data that is passed to the asynchronous method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. */ - getCallbackTokenAsync(options: Office.AsyncContextOptions | { isRest: boolean }, callback: (result: AsyncResult) => void): void; + getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * From 0834314448067ae57526f9a4cb8b5e27c5369e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Fri, 17 Aug 2018 17:28:18 +0200 Subject: [PATCH 279/346] [puppeteer/v0] Fix tests (#28199) --- types/puppeteer/v0/puppeteer-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/puppeteer/v0/puppeteer-tests.ts b/types/puppeteer/v0/puppeteer-tests.ts index 913d46a789..963fb1c8c1 100644 --- a/types/puppeteer/v0/puppeteer-tests.ts +++ b/types/puppeteer/v0/puppeteer-tests.ts @@ -27,8 +27,8 @@ import * as puppeteer from "puppeteer"; // Get the "viewport" of the page, as reported by the page. const dimensions = await page.evaluate(() => { return { - width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight, + width: document.documentElement!.clientWidth, + height: document.documentElement!.clientHeight, deviceScaleFactor: window.devicePixelRatio }; }); From cc046b2941d8539d884e2cb65769740393a1a4e1 Mon Sep 17 00:00:00 2001 From: Ole Frank Jensen Date: Fri, 17 Aug 2018 19:25:45 +0200 Subject: [PATCH 280/346] export Focused type to make available externally --- types/react-credit-cards/index.d.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/types/react-credit-cards/index.d.ts b/types/react-credit-cards/index.d.ts index da41f6f05e..4cbf2f9830 100644 --- a/types/react-credit-cards/index.d.ts +++ b/types/react-credit-cards/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-credit-cards 0.7 // Project: https://github.com/amarofashion/react-credit-cards -// Definitions by: Vytautas Strimaitis +// Definitions by: Vytautas Strimaitis , Ole Frank // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -8,24 +8,28 @@ import * as React from "react"; export interface CallbackArgument { isValid: boolean; - type: { issuer: string; maxLength: number; }; + type: { issuer: string; maxLength: number }; } +export type Focused = "name" | "number" | "expiry" | "cvc"; + export interface ReactCreditCardProps { acceptedCards?: ReadonlyArray; callback?: (type: CallbackArgument, isValid: boolean) => void; cvc: string | number; expiry: string | number; - focused?: "name" | "number" | "expiry" | "cvc"; + focused?: Focused; issuer?: string; - locale?: { valid: string; }; + locale?: { valid: string }; name: string; number: string | number; - placeholders?: { name: string; }; + placeholders?: { name: string }; preview?: boolean; } -declare class ReactCreditCard extends React.Component { -} +declare class ReactCreditCard extends React.Component< + ReactCreditCardProps, + never +> {} export default ReactCreditCard; From 990cd39cbe1fea7ec082adb81d1786a38d5e4998 Mon Sep 17 00:00:00 2001 From: Ole Frank Jensen Date: Fri, 17 Aug 2018 19:30:55 +0200 Subject: [PATCH 281/346] update version number in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5b1b03057..09fe064d48 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "definitely-typed", - "version": "0.0.2", + "version": "0.0.3", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped", "repository": { "type": "git", From 1e3a662abbfb73bd4272af04865593debc575616 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 17 Aug 2018 12:02:39 -0700 Subject: [PATCH 282/346] office-js-clean-up --- types/office-js/index.d.ts | 3480 +++++++++++++++++++++++++----------- 1 file changed, 2415 insertions(+), 1065 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index ac0d1309e8..9d81b35902 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -231,7 +231,7 @@ declare namespace Office { resolve(value: T | PromiseLike): Promise; /** - * Creates a new resolved promise . + * Creates a new resolved promise. * @returns A resolved promise. */ resolve(): Promise; @@ -244,9 +244,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -263,21 +265,26 @@ declare namespace Office { /** * Occurs when the runtime environment is loaded and the add-in is ready to start interacting with the application and hosted document. * - * The reason parameter of the initialize event listener function returns an `InitializationReason` enumeration value that specifies how initialization occurred. A task pane or content add-in can be initialized in two ways: + * The reason parameter of the initialize event listener function returns an `InitializationReason` enumeration value that specifies how + * initialization occurred. A task pane or content add-in can be initialized in two ways: * - * - The user just inserted it from Recently Used Add-ins section of the Add-in drop-down list on the Insert tab of the ribbon in the Office host application, or from Insert add-in dialog box. + * - The user just inserted it from Recently Used Add-ins section of the Add-in drop-down list on the Insert tab of the ribbon in the Office + * host application, or from Insert add-in dialog box. * * - The user opened a document that already contains the add-in. * - * *Note*: The reason parameter of the initialize event listener function only returns an `InitializationReason` enumeration value for task pane and content add-ins. It does not return a value for Outlook add-ins. + * *Note*: The reason parameter of the initialize event listener function only returns an `InitializationReason` enumeration value for task pane + * and content add-ins. It does not return a value for Outlook add-ins. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -294,9 +301,13 @@ declare namespace Office { */ function initialize(reason: InitializationReason): void; /** - * Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise will wait until the Office host is ready to accept API calls. - * Note that though this API is intended to be used inside an Office add-in, it can also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office host application, it will call the callback and resolve the promise with "null" for both the host and platform. - * @param callback - An optional callback method, that will receive the host and platform info. Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve. + * Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise + * will wait until the Office host is ready to accept API calls. Note that though this API is intended to be used inside an Office add-in, it can + * also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office host application, it will call + * the callback and resolve the promise with "null" for both the host and platform. + * + * @param callback - An optional callback method, that will receive the host and platform info. + * Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve. * @returns A Promise that contains the host and platform info, once initialization is completed. */ function onReady(callback?: (info: { host: HostType, platform: PlatformType }) => any): Promise<{ host: HostType, platform: PlatformType }>; @@ -307,9 +318,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -335,9 +348,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -367,9 +382,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -396,9 +413,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -449,9 +468,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -498,19 +519,24 @@ declare namespace Office { * @remarks *
HostsAccess, Excel, Outlook, PowerPoint, Project, Word
* - * When the function you pass to the `callback` parameter of an "Async" method executes, it receives an AsyncResult object that you can access from the `callback` function's only parameter. + * When the function you pass to the `callback` parameter of an "Async" method executes, it receives an AsyncResult object that you can access + * from the `callback` function's only parameter. */ interface AsyncResult { /** - * Gets the user-defined item passed to the optional `asyncContext` parameter of the invoked method in the same state as it was passed in. This returns the user-defined item (which can be of any JavaScript type: String, Number, Boolean, Object, Array, Null, or Undefined) passed to the optional `asyncContext` parameter of the invoked method. Returns Undefined, if you didn't pass anything to the asyncContext parameter. + * Gets the user-defined item passed to the optional `asyncContext` parameter of the invoked method in the same state as it was passed in. + * This returns the user-defined item (which can be of any JavaScript type: String, Number, Boolean, Object, Array, Null, or Undefined) passed + * to the optional `asyncContext` parameter of the invoked method. Returns Undefined, if you didn't pass anything to the asyncContext parameter. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -531,9 +557,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -554,9 +582,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -574,16 +604,19 @@ declare namespace Office { * Gets the payload or content of this asynchronous operation, if any. * * @remarks - * You access the AsyncResult object in the function passed as the argument to the callback parameter of an "Async" method, such as the `getSelectedDataAsync` and `setSelectedDataAsync` methods of the {@link Office.Document | Document} object. + * You access the AsyncResult object in the function passed as the argument to the callback parameter of an "Async" method, such as the + * `getSelectedDataAsync` and `setSelectedDataAsync` methods of the {@link Office.Document | Document} object. * * Note: What the value property returns for a particular "Async" method varies depending on the purpose and context of that method. * To determine what is returned by the value property for an "Async" method, refer to the "Callback value" section of the method's topic. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -614,13 +647,17 @@ declare namespace Office { * True, if the current platform allows the add-in to display a UI for selling or upgrading; otherwise returns False. * * @remarks - * The iOS App Store doesn't support apps with add-ins that provide links to additional payment systems. However, Office Add-ins running on the Windows desktop or for Office Online in the browser do allow such links. If you want the UI of your add-in to provide a link to an external payment system on platforms other than iOS, you can use the commerceAllowed property to control when that link is displayed. + * The iOS App Store doesn't support apps with add-ins that provide links to additional payment systems. However, Office Add-ins running on + * the Windows desktop or for Office Online in the browser do allow such links. If you want the UI of your add-in to provide a link to an + * external payment system on platforms other than iOS, you can use the commerceAllowed property to control when that link is displayed. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -634,15 +671,18 @@ declare namespace Office { * Gets the locale (language) specified by the user for editing the document or item. * * @remarks - * The `contentLanguage` value reflects the **Editing Language** setting specified with **File > Options > Language** in the Office host application. + * The `contentLanguage` value reflects the **Editing Language** setting specified with **File > Options > Language** in the Office host + * application. * * In content add-ins for Access web apps, the `contentLanguage` property gets the add-in culture (e.g., "en-GB"). * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -667,7 +707,8 @@ declare namespace Office { * * The returned value is a string in the RFC 1766 Language tag format, such as en-US. * - * The `displayLanguage` value reflects the current **Display Language** setting specified with **File > Options > Language** in the Office host application. + * The `displayLanguage` value reflects the current **Display Language** setting specified with **File > Options > Language** in the Office + * host application. * * In content add-ins for Access web apps, the `displayLanguage property` gets the add-in language (e.g., "en-US"). * @@ -675,9 +716,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -698,9 +741,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -755,7 +800,8 @@ declare namespace Office { /** * Gets an object that represents the custom settings or state of a mail add-in saved to a user's mailbox. * - * The RoamingSettings object lets you store and access data for a mail add-in that is stored in a user's mailbox, so that is available to that add-in when it is running from any host client application used to access that mailbox. + * The RoamingSettings object lets you store and access data for a mail add-in that is stored in a user's mailbox, so that is available to + * that add-in when it is running from any host client application used to access that mailbox. * * [Api set: Mailbox 1.0] * @@ -766,16 +812,20 @@ declare namespace Office { */ roamingSettings: Office.RoamingSettings; /** - * Specifies whether the platform and device allows touch interaction. True if the add-in is running on a touch device, such as an iPad; false otherwise. + * Specifies whether the platform and device allows touch interaction. + * True if the add-in is running on a touch device, such as an iPad; false otherwise. * * @remarks - * Use the touchEnabled property to determine when your add-in is running on a touch device and if necessary, adjust the kind of controls, and size and spacing of elements in your add-in's UI to accommodate touch interactions. + * Use the touchEnabled property to determine when your add-in is running on a touch device and if necessary, adjust the kind of controls, and + * size and spacing of elements in your add-in's UI to accommodate touch interactions. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -795,13 +845,16 @@ declare namespace Office { * Provides specific information about an error that occurred during an asynchronous data operation. * * @remarks - * The Error object is accessed from the AsyncResult object that is returned in the function passed as the callback argument of an asynchronous data operation, such as the setSelectedDataAsync method of the Document object. + * The Error object is accessed from the AsyncResult object that is returned in the function passed as the callback argument of an asynchronous + * data operation, such as the setSelectedDataAsync method of the Document object. * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -830,7 +883,8 @@ declare namespace Office { } namespace AddinCommands { /** - * The event object is passed as a parameter to add-in functions invoked by UI-less command buttons. The object allows the add-in to identify which button was clicked and to signal the host that it has completed its processing. + * The event object is passed as a parameter to add-in functions invoked by UI-less command buttons. The object allows the add-in to identify + * which button was clicked and to signal the host that it has completed its processing. * * @remarks * @@ -847,9 +901,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -861,7 +917,10 @@ declare namespace Office { /** * Indicates that the add-in has completed processing that was triggered by an add-in command button or event handler. * - * This method must be called at the end of a function which was invoked by an add-in command defined with an Action element with an xsi:type attribute set to ExecuteFunction. Calling this method signals the host client that the function is complete and that it can clean up any state involved with invoking the function. For example, if the user closes Outlook before this method is called, Outlook will warn that a function is still executing. + * This method must be called at the end of a function which was invoked by an add-in command defined with an Action element with an + * xsi:type attribute set to ExecuteFunction. Calling this method signals the host client that the function is complete and that it can + * clean up any state involved with invoking the function. For example, if the user closes Outlook before this method is called, Outlook + * will warn that a function is still executing. * * This method must be called in an event handler added via Office.context.mailbox.addHandlerAsync after completing processing of the event. * @@ -875,9 +934,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -889,7 +950,9 @@ declare namespace Office { *
* * @param options Optional. An object literal that contains one or more of the following properties. - * allowEvent: A boolean value. When the completed method is used to signal completion of an event handler, this value indicates of the handled event should continue execution or be canceled. For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. + * allowEvent: A boolean value. When the completed method is used to signal completion of an event handler, + * this value indicates of the handled event should continue execution or be canceled. + * For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. */ completed(options?: any): void; } @@ -900,7 +963,8 @@ declare namespace Office { interface Source { /** - * The id of the control that triggered calling this function. The id comes from the manifest and is the unique ID of your Office Add-in as a GUID. + * The id of the control that triggered calling this function. The id comes from the manifest and is the unique ID of your Office Add-in + * as a GUID. */ id: string; } @@ -908,7 +972,8 @@ declare namespace Office { /** * Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes, in your Office Add-ins. * - * Visit "{@link https://docs.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Dialog API in your Office Add-ins}" for more information. + * Visit "{@link https://docs.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Dialog API in your Office Add-ins}" + * for more information. */ interface UI { /** @@ -919,10 +984,12 @@ declare namespace Office { * * Requirement setsDialogApi, Mailbox 1.4 * - * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 for Outlook. - * For more on how to specify a requirement set in your manifest, see {@link https://docs.microsoft.com/en-us/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office hosts and API requirements}. + * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 + * for Outlook. For more on how to specify a requirement set in your manifest, see + * {@link https://docs.microsoft.com/en-us/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office hosts and API requirements}. * - * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to other domains. + * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to + * other domains. * * Any page calling `office.context.ui.messageParent` must also be on the same domain as the parent page. * @@ -930,7 +997,8 @@ declare namespace Office { * * The following design considerations apply to dialog boxes: * - * - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in Commands (custom ribbon buttons or menu items). + * - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in + * Commands (custom ribbon buttons or menu items). * * - Every dialog box can be moved and resized by the user. * @@ -942,13 +1010,15 @@ declare namespace Office { * * - Display authentication pages to collect user credentials. * - * - Display an error/progress/input screen from a ShowTaspane or ExecuteAction command. + * - Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command. * * - Temporarily increase the surface area that a user has available to complete a task. * * Do not use a dialog box to interact with a document. Use a task pane instead. * - * For a design pattern that you can use to create a dialog box, see {@link https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns/blob/master/Patterns/Client_Dialog.md | Client Dialog} in the Office Add-in UX Design Patterns repository on GitHub. + * For a design pattern that you can use to create a dialog box, see + * {@link https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns/blob/master/Patterns/Client_Dialog.md | Client Dialog} in the Office + * Add-in UX Design Patterns repository on GitHub. * * **displayDialogAsync Errors**: * @@ -971,7 +1041,8 @@ declare namespace Office { * * * - * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the + * following information. * * * @@ -1016,7 +1087,8 @@ declare namespace Office { * * - Called from a UI-less command button: No effect. Any dialog opened by displayDialogAsync will remain open. * - * - Called from a taskpane: The taskpane will close. Any dialog opened by displayDialogAsync will also close. If the taskpane supports pinning and was pinned by the user, it will be un-pinned. + * - Called from a taskpane: The taskpane will close. Any dialog opened by displayDialogAsync will also close. + * If the taskpane supports pinning and was pinned by the user, it will be un-pinned. * * - Called from a module extension: No effect. */ @@ -1057,7 +1129,10 @@ declare namespace Office { */ width?: number, /** - * Determines whether the dialog box should be displayed within an IFrame. This setting is only applicable in Office Online clients, and is ignored by other platforms. If false (default), the dialog will be displayed as a new browser window (pop-up). Recommended for authentication pages that cannot be displayed in an IFrame. If true, the dialog will be displayed as a floating overlay with an IFrame. This is best for user experience and performance. + * Determines whether the dialog box should be displayed within an IFrame. This setting is only applicable in Office Online clients, and is + * ignored by other platforms. If false (default), the dialog will be displayed as a new browser window (pop-up). Recommended for + * authentication pages that cannot be displayed in an IFrame. If true, the dialog will be displayed as a floating overlay with an IFrame. + * This is best for user experience and performance. */ displayInIframe?: boolean /** @@ -1066,11 +1141,14 @@ declare namespace Office { asyncContext?: any } /** - * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain and access the add-in token. Indirectly, enable the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. + * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain and access the add-in token. + * Indirectly, enable the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. */ interface Auth { /** - * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. Server side code can use this token to access Microsoft Graph for the add-in's web application by using the {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. + * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. + * Server side code can use this token to access Microsoft Graph for the add-in's web application by using the + * {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. * * Important: In Outlook, this API is not supported if the add-in is loaded in an Outlook.com or Gmail mailbox. * @@ -1080,7 +1158,8 @@ declare namespace Office { *
Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | IdentityAPI}
* - * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. + * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational + * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. * * @param options - Optional. Accepts an AuthOptions object to define sign-on behaviors. * @param callback - Optional. Accepts a callback method to handle the token acquisition attempt. If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. @@ -1093,7 +1172,8 @@ declare namespace Office { */ interface AuthOptions { /** - * Causes Office to display the add-in consent experience. Useful if the add-in's Azure permissions have changed or if the user's consent has been revoked. + * Causes Office to display the add-in consent experience. Useful if the add-in's Azure permissions have changed or if the user's consent has + * been revoked. */ forceConsent?: boolean, /** @@ -1101,7 +1181,11 @@ declare namespace Office { */ forceAddAccount?: boolean, /** - * Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should be used with the authChallenge option. + * Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor + * authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development + * time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" + * call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should + * be used with the authChallenge option. */ authChallenge?: string /** @@ -1147,7 +1231,8 @@ declare namespace Office { */ coercionType?: Office.CoercionType | string /** - * Specifies whether values, such as numbers and dates, are returned with their formatting applied. Use Office.ValueFormat or text value. Default: Unformatted data. + * Specifies whether values, such as numbers and dates, are returned with their formatting applied. Use Office.ValueFormat or text value. + * Default: Unformatted data. */ valueFormat?: Office.ValueFormat | string /** @@ -1167,7 +1252,8 @@ declare namespace Office { */ columnCount?: number /** - * Specify whether to get only the visible (filtered in) data or all the data (default is all). Useful when filtering data. Use Office.FilterType or text value. + * Specify whether to get only the visible (filtered in) data or all the data (default is all). Useful when filtering data. + * Use Office.FilterType or text value. */ filterType?: Office.FilterType | string /** @@ -1187,7 +1273,8 @@ declare namespace Office { */ interface SetBindingDataOptions { /** - * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. + * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of + * columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. * * Example: `[{cells: Office.Table.Data, format: {fontColor: "yellow"}}, {cells: {row: 3, column: 4}, format: {borderColor: "white", fontStyle: "bold"}}]` */ @@ -1205,15 +1292,18 @@ declare namespace Office { */ rows?: string /** - * Specifies the zero-based starting row for a subset of the data in the binding. Only for table or matrix bindings. If omitted, data is set starting in the first row. + * Specifies the zero-based starting row for a subset of the data in the binding. Only for table or matrix bindings. If omitted, data is set + * starting in the first row. */ startRow?: number /** - * Specifies the zero-based starting column for a subset of the data. Only for table or matrix bindings. If omitted, data is set starting in the first column. + * Specifies the zero-based starting column for a subset of the data. Only for table or matrix bindings. If omitted, data is set starting in + * the first column. */ startColumn?: number /** - * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. Example: `{bandedRows: true, filterButton: false}` + * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. + * Example: `{bandedRows: true, filterButton: false}` */ tableOptions?: object /** @@ -1226,7 +1316,8 @@ declare namespace Office { */ interface RangeFormatConfiguration { /** - * Specifies the range. Example of using Office.Table enum: Office.Table.All. Example of using RangeCoordinates: {row: 3, column: 4} specifies the cell in the 3rd (zero-based) row in the 4th (zero-based) column. + * Specifies the range. Example of using Office.Table enum: Office.Table.All. Example of using RangeCoordinates: {row: 3, column: 4} specifies + * the cell in the 3rd (zero-based) row in the 4th (zero-based) column. */ cells: Office.Table | RangeCoordinates /** @@ -1235,7 +1326,8 @@ declare namespace Office { format: object } /** - * Specifies a cell, or row, or column, by its zero-based row and/or column number. Example: {row: 3, column: 4} specifies the cell in the 3rd (zero-based) row in the 4th (zero-based) column. + * Specifies a cell, or row, or column, by its zero-based row and/or column number. Example: {row: 3, column: 4} specifies the cell in the 3rd + * (zero-based) row in the 4th (zero-based) column. */ interface RangeCoordinates { /** @@ -1282,11 +1374,14 @@ declare namespace Office { */ id?: string /** - * Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. If no promptText argument is passed, "Please make a selection" is displayed. + * Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. + * If no promptText argument is passed, "Please make a selection" is displayed. */ promptText?: string /** - * Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. The headers provided in the TableData object specify the labels used in the field selection UI. Note: This parameter is used only in add-ins for Access. It is ignored if provided when calling the method in an add-in for Excel. + * Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. + * The headers provided in the TableData object specify the labels used in the field selection UI. + * Note: This parameter is used only in add-ins for Access. It is ignored if provided when calling the method in an add-in for Excel. */ sampleData?: Office.TableData /** @@ -1333,7 +1428,8 @@ declare namespace Office { */ valueFormat?: Office.ValueFormat | string /** - * Specify whether to get only the visible (that is, filtered-in) data or all the data. Useful when filtering data. Use {@link Office.FilterType} or string equivalent. This parameter is ignored in Word documents. + * Specify whether to get only the visible (that is, filtered-in) data or all the data. Useful when filtering data. + * Use {@link Office.FilterType} or string equivalent. This parameter is ignored in Word documents. */ filterType?: Office.FilterType | string /** @@ -1347,15 +1443,19 @@ declare namespace Office { * @remarks * The behavior caused by the {@link Office.SelectionMode | options.selectionMode} option varies by host: * - * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. `Office.SelectionMode.None` for text bindings, selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). + * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. `Office.SelectionMode.None` for text bindings, + * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * - * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. `Office.SelectionMode.None` Doesn't select anything. + * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. + * `Office.SelectionMode.None` doesn't select anything. * - * In Word: `Office.SelectionMode.Selected` selects all content in the binding. `Office.SelectionMode.None` for text bindings, moves the cursor to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). + * In Word: `Office.SelectionMode.Selected` selects all content in the binding. `Office.SelectionMode.None` for text bindings, moves the cursor to + * the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). */ interface GoToByIdOptions { /** - * Specifies whether the location specified by the id parameter is selected (highlighted). Use {@link Office.SelectionMode} or string equivalent. See the Remarks for more information. + * Specifies whether the location specified by the id parameter is selected (highlighted). + * Use {@link Office.SelectionMode} or string equivalent. See the Remarks for more information. */ selectionMode?: Office.SelectionMode | string /** @@ -1368,7 +1468,8 @@ declare namespace Office { */ interface SetSelectedDataOptions { /** - * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. + * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of + * columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. * * Example: `[{cells: Office.Table.Data, format: {fontColor: "yellow"}}, {cells: {row: 3, column: 4}, format: {borderColor: "white", fontStyle: "bold"}}]` */ @@ -1378,23 +1479,30 @@ declare namespace Office { */ coercionType?: Office.CoercionType | string /** - * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. Example: `{bandedRows: true, filterButton: false}` + * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. + * Example: `{bandedRows: true, filterButton: false}` */ tableOptions?: object /** - * This option is applicable for inserting images. Indicates the insert location in relation to the top of the slide for PowerPoint, and its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. + * This option is applicable for inserting images. Indicates the insert location in relation to the top of the slide for PowerPoint, and its + * relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. */ imageTop?: number /** - * This option is applicable for inserting images. Indicates the image width. If this option is provided without the imageHeight, the image will scale to match the value of the image width. If both image width and image height are provided, the image will be resized accordingly. If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. + * This option is applicable for inserting images. Indicates the image width. If this option is provided without the imageHeight, the image + * will scale to match the value of the image width. If both image width and image height are provided, the image will be resized accordingly. + * If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. */ imageWidth?: number /** - * This option is applicable for inserting images. Indicates the insert location in relation to the left side of the slide for PowerPoint, and its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. + * This option is applicable for inserting images. Indicates the insert location in relation to the left side of the slide for PowerPoint, and + * its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. */ imageLeft?: number /** - * This option is applicable for inserting images. Indicates the image height. If this option is provided without the imageWidth, the image will scale to match the value of the image height. If both image width and image height are provided, the image will be resized accordingly. If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. + * This option is applicable for inserting images. Indicates the image height. If this option is provided without the imageWidth, the image + * will scale to match the value of the image height. If both image width and image height are provided, the image will be resized accordingly. + * If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. */ imageHeight?: number /** @@ -1418,15 +1526,19 @@ declare namespace Office { /** * Provides access to the properties for Office theme colors. * - * Using Office theme colors lets you coordinate the color scheme of your add-in with the current Office theme selected by the user with File > Office Account > Office Theme UI, which is applied across all Office host applications. Using Office theme colors is appropriate for mail and task pane add-ins. + * Using Office theme colors lets you coordinate the color scheme of your add-in with the current Office theme selected by the user with File > + * Office Account > Office Theme UI, which is applied across all Office host applications. Using Office theme colors is appropriate for mail and + * task pane add-ins. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that these properties are supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that these properties are supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -1482,15 +1594,17 @@ declare namespace Office { /** * Returns a promise of an object described in the expression. Callback is invoked only if method fails. * @param expression The object to be retrieved. Example "bindings#BindingName", retrieves a binding promise for a binding named 'BindingName' - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1508,9 +1622,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1534,9 +1650,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1552,7 +1670,8 @@ declare namespace Office { */ Text, /** - * Tabular data without a header row. Data is returned as an array of arrays, for example in this form: [[row1column1, row1column2],[row2column1, row2column2]] + * Tabular data without a header row. Data is returned as an array of arrays, for example in this form: + * [[row1column1, row1column2],[row2column1, row2column2]] */ Matrix, /** @@ -1570,9 +1689,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1591,7 +1712,8 @@ declare namespace Office { */ Text, /** - * Return or set data as tabular data with no headers. Data is returned or set as an array of arrays containing one-dimensional runs of characters. For example, three rows of string values in two columns would be: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. + * Return or set data as tabular data with no headers. Data is returned or set as an array of arrays containing one-dimensional runs of + * characters. For example, three rows of string values in two columns would be: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. * * Note: Only applies to data in Excel and Word. */ @@ -1615,9 +1737,11 @@ declare namespace Office { */ Ooxml, /** - * Return a JSON object that contains an array of the ids, titles, and indexes of the selected slides. For example, `{"slides":[{"id":257,"title":"Slide 2","index":2},{"id":256,"title":"Slide 1","index":1}]}` for a selection of two slides. + * Return a JSON object that contains an array of the ids, titles, and indexes of the selected slides. For example, + * `{"slides":[{"id":257,"title":"Slide 2","index":2},{"id":256,"title":"Slide 1","index":1}]}` for a selection of two slides. * - * Note: Only applies to data in PowerPoint when calling the {@link Office.Document | Document}.getSelectedData method to get the current slide or selected range of slides. + * Note: Only applies to data in PowerPoint when calling the {@link Office.Document | Document}.getSelectedData method to get the current + * slide or selected range of slides. */ SlideRange, /** @@ -1635,9 +1759,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1666,9 +1792,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1709,7 +1837,8 @@ declare namespace Office { /** * Specifies the kind of event that was raised. Returned by the `type` property of an *EventArgs object. * - * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and `Office.EventType.ViewSelectionChanged` event types. + * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and + * `Office.EventType.ViewSelectionChanged` event types. * *
BindingDataChanged and BindingSelectionChanged hosts
Access, Excel, Word
* @@ -1717,9 +1846,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -1737,9 +1868,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1757,9 +1890,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1771,17 +1906,18 @@ declare namespace Office { */ BindingDataChanged, /** - * Occurs when the selection is changed within the binding. - * To add an event handler for the BindingSelectionChanged event of a binding, use the addHandlerAsync method of the Binding object. - * The event handler receives an argument of type {@link Office.BindingSelectionChangedEventArgs}. + * Occurs when the selection is changed within the binding. To add an event handler for the BindingSelectionChanged event of a binding, use + * the addHandlerAsync method of the Binding object. The event handler receives an argument of type {@link Office.BindingSelectionChangedEventArgs}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1805,9 +1941,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1852,9 +1990,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1883,9 +2023,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1916,9 +2058,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1945,9 +2089,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1991,9 +2137,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2026,9 +2174,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2053,14 +2203,17 @@ declare namespace Office { * Specifies whether values, such as numbers and dates, returned by the invoked method are returned with their formatting applied. * * @remarks - * For example, if the valueFormat parameter is specified as "formatted", a number formatted as currency, or a date formatted as mm/dd/yy in the host application will have its formatting preserved. - * If the valueFormat parameter is specified as "unformatted", a date will be returned in its underlying sequential serial number form. + * For example, if the valueFormat parameter is specified as "formatted", a number formatted as currency, or a date formatted as mm/dd/yy in the + * host application will have its formatting preserved. If the valueFormat parameter is specified as "unformatted", a date will be returned in its + * underlying sequential serial number form. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2089,13 +2242,19 @@ declare namespace Office { * * The Binding object exposes the functionality possessed by all bindings regardless of type. * - * The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: {@link Office.MatrixBinding}, {@link Office.TableBinding}, or {@link Office.TextBinding}. All three of these objects inherit the getDataAsync and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the id and type properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- and table-specific features, such as counting the number of rows and columns. + * The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: + * {@link Office.MatrixBinding}, {@link Office.TableBinding}, or {@link Office.TextBinding}. All three of these objects inherit the getDataAsync + * and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the id and type + * properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- + * and table-specific features, such as counting the number of rows and columns. * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2121,7 +2280,8 @@ declare namespace Office { */ type: Office.BindingType; /** - * Adds an event handler to the object for the specified {@link Office.EventType}. Supported EventTypes are `Office.EventType.BindingDataChanged` and `Office.EventType.BindingSelectionChanged`. + * Adds an event handler to the object for the specified {@link Office.EventType}. Supported EventTypes are + * `Office.EventType.BindingDataChanged` and `Office.EventType.BindingSelectionChanged`. * * @remarks * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. @@ -2138,7 +2298,8 @@ declare namespace Office { * @remarks *
Requirement SetsMatrixBindings, TableBindings, TextBindings
* - * When called from a MatrixBinding or TableBinding, the getDataAsync method will return a subset of the bound values if the optional startRow, startColumn, rowCount, and columnCount parameters are specified (and they specify a contiguous and valid range). + * When called from a MatrixBinding or TableBinding, the getDataAsync method will return a subset of the bound values if the optional startRow, + * startColumn, rowCount, and columnCount parameters are specified (and they specify a contiguous and valid range). * * @param options Provides options for how to get the data in a binding. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. @@ -2152,7 +2313,7 @@ declare namespace Office { * * @param eventType The event type. For bindings, it can be `Office.EventType.BindingDataChanged` or `Office.EventType.BindingSelectionChanged`. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2162,7 +2323,8 @@ declare namespace Office { * *
Requirement SetsMatrixBindings, TableBindings, TextBindings
* - * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as described in the following table. + * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as + * described in the following table. * * * @@ -2183,7 +2345,8 @@ declare namespace Office { * *
* - * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the binding as follows: + * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the + * binding as follows: * * * @@ -2233,13 +2396,16 @@ declare namespace Office { * * - The total number of cells in the value passed to the data parameter can't exceed 20,000 in a single call to this method. * - * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells. + * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. + * A single formatting group consists of a set of formatting applied to a specified range of cells. * * In all other cases, an error is returned. * - * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are specified, and they specify a valid range. + * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are + * specified, and they specify a valid range. * - * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following + * information. * *
* @@ -2278,7 +2444,7 @@ declare namespace Office { * * @param options Provides options for how to set the data in a binding. * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; } @@ -2317,7 +2483,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the count for the last contiguous selection within the binding is returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ columnCount: number; /** @@ -2325,7 +2493,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the count for the last contiguous selection within the binding is returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ rowCount: number; /** @@ -2333,7 +2503,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the coordinates for the last contiguous selection within the binding are returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ startColumn: number; /** @@ -2341,7 +2513,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the coordinates for the last contiguous selection within the binding are returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ startRow: number; /** @@ -2361,9 +2535,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2382,21 +2558,29 @@ declare namespace Office { * * For Excel, the itemName parameter can refer to a named range or a table. * - * By default, adding a table in Excel assigns the name "Table1" for the first table you add, "Table2" for the second table you add, and so on. To assign a meaningful name for a table in the Excel UI, use the Table Name property on the Table Tools | Design tab of the ribbon. + * By default, adding a table in Excel assigns the name "Table1" for the first table you add, "Table2" for the second table you add, and so on. + * To assign a meaningful name for a table in the Excel UI, use the Table Name property on the Table Tools | Design tab of the ribbon. * - * Note: In Excel, when specifying a table as a named item, you must fully qualify the name to include the worksheet name in the name of the table in this format: "Sheet1!Table1" + * Note: In Excel, when specifying a table as a named item, you must fully qualify the name to include the worksheet name in the name of + * the table in this format: "Sheet1!Table1" * - * For Word, the itemName parameter refers to the Title property of a Rich Text content control. (You can't bind to content controls other than the Rich Text content control). + * For Word, the itemName parameter refers to the Title property of a Rich Text content control. (You can't bind to content controls other + * than the Rich Text content control). * - * By default, a content control has no Title value assigned. To assign a meaningful name in the Word UI, after inserting a Rich Text content control from the Controls group on the Developer tab of the ribbon, use the Properties command in the Controls group to display the Content Control Properties dialog box. Then set the Title property of the content control to the name you want to reference from your code. + * By default, a content control has no Title value assigned. To assign a meaningful name in the Word UI, after inserting a Rich Text content + * control from the Controls group on the Developer tab of the ribbon, use the Properties command in the Controls group to display the Content + * Control Properties dialog box. Then set the Title property of the content control to the name you want to reference from your code. * - * Note: In Word, if there are multiple Rich Text content controls with the same Title property value (name), and you try to bind to one these content controls with this method (by specifying its name as the itemName parameter), the operation will fail. + * Note: In Word, if there are multiple Rich Text content controls with the same Title property value (name), and you try to bind to one + * these content controls with this method (by specifying its name as the itemName parameter), the operation will fail. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2408,7 +2592,7 @@ declare namespace Office { * @param itemName Name of the bindable object in the document. For Example 'MyExpenses' table in Excel." * @param bindingType The {@link Office.BindingType} for the data. The method returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the binding that is created. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: AddBindingFromNamedItemOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2417,13 +2601,16 @@ declare namespace Office { * @remarks *
Requirement SetsNot in a set
* - * Adds a binding object of the specified type to the Bindings collection, which will be identified with the supplied id. The method fails if the specified selection cannot be bound. + * Adds a binding object of the specified type to the Bindings collection, which will be identified with the supplied id. + * The method fails if the specified selection cannot be bound. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2432,9 +2619,10 @@ declare namespace Office { * *
Excel Y Y Y
* - * @param bindingType Specifies the type of the binding object to create. Required. Returns null if the selected object cannot be coerced into the specified type. + * @param bindingType Specifies the type of the binding object to create. Required. + * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addFromPromptAsync(bindingType: BindingType, options?: AddBindingFromPromptOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2445,14 +2633,18 @@ declare namespace Office { * * Adds the specified type of binding object to the Bindings collection, which will be identified with the supplied id. * - * Note In Excel, if you call the addFromSelectionAsync method passing in the Binding.id of an existing binding, the Binding.type of that binding is used, and its type cannot be changed by specifying a different value for the bindingType parameter. - * If you need to use an existing id and change the bindingType, call the Bindings.releaseByIdAsync method first to release the binding, and then call the addFromSelectionAsync method to reestablish the binding with a new type. + * Note In Excel, if you call the addFromSelectionAsync method passing in the Binding.id of an existing binding, the Binding.type of that + * binding is used, and its type cannot be changed by specifying a different value for the bindingType parameter. + * If you need to use an existing id and change the bindingType, call the Bindings.releaseByIdAsync method first to release the binding, and + * then call the addFromSelectionAsync method to reestablish the binding with a new type. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2462,9 +2654,10 @@ declare namespace Office { * *
Word Y Y Y
* - * @param bindingType Specifies the type of the binding object to create. Required. Returns null if the selected object cannot be coerced into the specified type. + * @param bindingType Specifies the type of the binding object to create. Required. + * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addFromSelectionAsync(bindingType: BindingType, options?: AddBindingFromSelectionOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2475,9 +2668,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2488,7 +2683,7 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2501,9 +2696,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2515,7 +2712,7 @@ declare namespace Office { * * @param id Specifies the unique name of the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2528,9 +2725,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2542,7 +2741,7 @@ declare namespace Office { * * @param id Specifies the unique name to be used to identify the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } @@ -2554,9 +2753,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2594,7 +2795,7 @@ declare namespace Office { * * @param xPath The XPath expression that specifies the nodes to get. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2604,7 +2805,7 @@ declare namespace Office { *
Requirement SetsCustomXmlParts
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2614,7 +2815,7 @@ declare namespace Office { *
Requirement SetsCustomXmlParts
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2624,7 +2825,7 @@ declare namespace Office { *
Requirement SetsCustomXmlParts
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2635,7 +2836,7 @@ declare namespace Office { * * @param value The value to be set on the node * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2648,7 +2849,7 @@ declare namespace Office { * * @param text Required. The text value of the XML node. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2659,7 +2860,7 @@ declare namespace Office { * * @param xml The XML to be set on the node * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } @@ -2671,9 +2872,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2702,10 +2905,12 @@ declare namespace Office { * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * - * @param eventType Specifies the type of event to add. For a CustomXmlPart object, the eventType parameter can be specified as `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. - * @param handler The event handler function to add, whose only parameter is of type {@link Office.NodeDeletedEventArgs}, {@link Office.NodeInsertedEventArgs}, or {@link Office.NodeReplacedEventArgs} + * @param eventType Specifies the type of event to add. For a CustomXmlPart object, the eventType parameter can be specified as + * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. + * @param handler The event handler function to add, whose only parameter is of type {@link Office.NodeDeletedEventArgs}, + * {@link Office.NodeInsertedEventArgs}, or {@link Office.NodeReplacedEventArgs} * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2714,7 +2919,7 @@ declare namespace Office { * @remarks * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2724,7 +2929,7 @@ declare namespace Office { * * @param xPath An XPath expression that specifies the nodes you want returned. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2733,7 +2938,7 @@ declare namespace Office { * @remarks * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2741,10 +2946,11 @@ declare namespace Office { * * @remarks * - * @param eventType Specifies the type of event to remove. For a CustomXmlPart object, the eventType parameter can be specified as `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. + * @param eventType Specifies the type of event to remove. For a CustomXmlPart object, the eventType parameter can be specified as + * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. * @param handler The name of the handler to remove. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; } @@ -2756,9 +2962,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2778,7 +2986,8 @@ declare namespace Office { /** * Gets the node which was just deleted from the {@link Office.CustomXmlPart} object. * - * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. + * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in + * that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. */ oldNode: CustomXmlNode; } @@ -2790,9 +2999,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2819,9 +3030,11 @@ declare namespace Office { * @remarks * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2843,7 +3056,8 @@ declare namespace Office { /** * Gets the node which was just deleted (replaced) from the CustomXmlPart object. * - * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. + * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in + * that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. */ oldNode: CustomXmlNode; } @@ -2856,9 +3070,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2872,7 +3088,7 @@ declare namespace Office { * * @param xml The XML to add to the newly created custom XML part. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2880,7 +3096,7 @@ declare namespace Office { * * @param id The GUID of the custom XML part, including opening and closing braces. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2888,7 +3104,7 @@ declare namespace Office { * * @param ns The namespace URI. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } @@ -2901,9 +3117,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2921,7 +3139,7 @@ declare namespace Office { * @param prefix Specifies the prefix to add to the prefix mapping list. Required. * @param ns Specifies the namespace URI to assign to the newly added prefix. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2929,11 +3147,12 @@ declare namespace Office { * * @remarks * - * If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one added or used by the data store internally, in which case it will return an error. + * If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one + * added or used by the data store internally, in which case it will return an error. * * @param prefix TSpecifies the prefix to get the namespace for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2941,11 +3160,12 @@ declare namespace Office { * * @remarks * - * If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in the namespace manager, the method returns the first prefix that matches the supplied namespace. + * If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in + * the namespace manager, the method returns the first prefix that matches the supplied namespace. * * @param ns Specifies the namespace to get the prefix for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } @@ -2960,13 +3180,16 @@ declare namespace Office { * Gets an object that provides access to the bindings defined in the document. * * @remarks - * You don't instantiate the Document object directly in your script. To call members of the Document object to interact with the current document or worksheet, use `Office.context.document` in your script. + * You don't instantiate the Document object directly in your script. To call members of the Document object to interact with the current + * document or worksheet, use `Office.context.document` in your script. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2984,9 +3207,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3002,9 +3227,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3023,9 +3250,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3044,9 +3273,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3068,9 +3299,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3081,10 +3314,11 @@ declare namespace Office { * *
Word Y Y Y
* - * @param eventType For a Document object event, the eventType parameter can be specified as `Office.EventType.Document.SelectionChanged` or `Office.EventType.Document.ActiveViewChanged`, or the corresponding text value of this enumeration. + * @param eventType For a Document object event, the eventType parameter can be specified as `Office.EventType.Document.SelectionChanged` or + * `Office.EventType.Document.ActiveViewChanged`, or the corresponding text value of this enumeration. * @param handler The event handler function to add, whose only parameter is of type {@link Office.DocumentSelectionChangedEventArgs}. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3097,9 +3331,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3110,18 +3346,22 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** - * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins for iOS, file slice is supported up to 65536 (64 KB). Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. + * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins for iOS, file slice is supported up to 65536 (64 KB). + * Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. * * @remarks *
Requirement SetsFile
* - * For add-ins running in Office host applications other than Office for iOS, the getFileAsync method supports getting files in slices of up to 4194304 bytes (4 MB). For add-ins running in Office for iOS apps, the getFileAsync method supports getting files in slices of up to 65536 (64 KB). + * For add-ins running in Office host applications other than Office for iOS, the getFileAsync method supports getting files in slices of up + * to 4194304 bytes (4 MB). For add-ins running in Office for iOS apps, the getFileAsync method supports getting files in slices of up to + * 65536 (64 KB). * - * The fileType parameter can be specified by using the {@link Office.FileType} enumeration or text values. But the possible values vary with the host: + * The fileType parameter can be specified by using the {@link Office.FileType} enumeration or text values. But the possible values vary with + * the host: * * Excel Online, Win32, Mac, and iOS: `Office.FileType.Compressed` * @@ -3133,9 +3373,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3147,7 +3389,7 @@ declare namespace Office { * * @param fileType The format in which the file will be returned * @param options Provides options for setting the size of slices that the document will be divided into. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getFileAsync(fileType: FileType, options?: GetFileOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3160,9 +3402,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3173,7 +3417,7 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3182,7 +3426,8 @@ declare namespace Office { * @remarks *
Requirement SetsSelection
* - * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. * * * @@ -3242,9 +3487,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3260,7 +3507,7 @@ declare namespace Office { * * @param options Provides options for customizing what data is returned and how it is formatted. * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getSelectedDataAsync(coerciontype: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3273,17 +3520,22 @@ declare namespace Office { * * The behavior caused by the selectionMode option varies by host: * - * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). + * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, + * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * - * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. `Office.SelectionMode.None` Doesn't select anything. + * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. `Office.SelectionMode.None` Doesn't + * select anything. * - * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). + * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor + * to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3296,7 +3548,7 @@ declare namespace Office { * @param id The identifier of the object or location to go to. * @param goToType The type of the location to go to. * @param options Provides options for whether to select the location that is navigated to. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ goToByIdAsync(id: string | number, goToType: GoToType, options?: GoToByIdOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3307,9 +3559,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3321,7 +3575,7 @@ declare namespace Office { * * @param eventType The event type. For document can be 'Document.SelectionChanged' or 'Document.ActiveViewChanged'. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3392,9 +3646,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3410,16 +3666,28 @@ declare namespace Office { * If the value passed for `data` is: * * - A string: Plain text or anything that can be coerced to a string will be inserted. - * In Excel, you can also specify data as a valid formula to add that formula to the selected cell. For example, setting data to "=SUM(A1:A5)" will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added formula (or any pre-existing formula) from the bound cell. If you call the Document.getSelectedDataAsync method on the selected cell to read its data, the method can return only the data displayed in the cell (the formula's result). + * In Excel, you can also specify data as a valid formula to add that formula to the selected cell. For example, setting data to "=SUM(A1:A5)" + * will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added + * formula (or any pre-existing formula) from the bound cell. If you call the Document.getSelectedDataAsync method on the selected cell to + * read its data, the method can return only the data displayed in the cell (the formula's result). * - * - An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an array like this: [["R1C1"], ["R2C1"], ["R3C1"]] - * In Excel, you can also specify data as an array of arrays that contains valid formulas to add them to the selected cells. For example if no other data will be overwritten, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to the selection. Just as when setting a formula on a single cell as "text", you can't read the added formulas (or any pre-existing formulas) after they have been set - you can only read the formulas' results. + * - An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, + * you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an + * array like this: [["R1C1"], ["R2C1"], ["R3C1"]] + * + * In Excel, you can also specify data as an array of arrays that contains valid formulas to add them to the selected cells. For example if no + * other data will be overwritten, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to the selection. Just as + * when setting a formula on a single cell as "text", you can't read the added formulas (or any pre-existing formulas) after they have been + * set - you can only read the formulas' results. * * - A TableData object: A table with headers will be inserted. - * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and specify the coercionType as Microsoft.Office.Matrix or "matrix". + * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to + * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to + * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and + * specify the coercionType as Microsoft.Office.Matrix or "matrix". * * @param options Provides options for how to insert data to the selection. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. */ setSelectedDataAsync(data: string | TableData | any[][], options?: SetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; @@ -3427,15 +3695,17 @@ declare namespace Office { * Project documents only. Get Project field (Ex. ProjectWebAccessURL). * @param fieldId Project level fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3449,15 +3719,17 @@ declare namespace Office { * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3469,15 +3741,17 @@ declare namespace Office { /** * Project documents only. Get the current selected Resource's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3489,15 +3763,17 @@ declare namespace Office { /** * Project documents only. Get the current selected Task's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3509,15 +3785,17 @@ declare namespace Office { /** * Project documents only. Get the current selected View Type (Ex. Gantt) and View Name. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3530,15 +3808,17 @@ declare namespace Office { * Project documents only. Get the Task Name, WSS Task Id, and ResourceNames for given taskId. * @param taskId Either a string or value of the Task Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3552,15 +3832,17 @@ declare namespace Office { * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3572,15 +3854,17 @@ declare namespace Office { /** * Project documents only. Get the WSS Url and list name for the Tasks List, the MPP is synced too. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3595,15 +3879,17 @@ declare namespace Office { * Important: This API works only in Project 2016 on Windows desktop. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3618,15 +3904,17 @@ declare namespace Office { * Important: This API works only in Project 2016 on Windows desktop. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3642,15 +3930,17 @@ declare namespace Office { * * @param resourceIndex The index of the resource in the collection of resources for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3666,15 +3956,17 @@ declare namespace Office { * * @param taskIndex The index of the task in the collection of tasks for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3692,15 +3984,17 @@ declare namespace Office { * @param fieldId Resource Fields. * @param fieldValue Value of the target field. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3718,15 +4012,17 @@ declare namespace Office { * @param fieldId Task Fields. * @param fieldValue Value of the target field. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3757,9 +4053,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3787,9 +4085,11 @@ declare namespace Office { * *
Requirement SetsFile
* - * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync method to close the file when you are finished working with it. + * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync + * method to close the file when you are finished working with it. * - * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -3814,7 +4114,7 @@ declare namespace Office { * *
* - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ closeAsync(callback?: (result: AsyncResult) => void): void; /** @@ -3823,7 +4123,8 @@ declare namespace Office { * @remarks *
Requirement SetsFile
* - * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -3849,7 +4150,7 @@ declare namespace Office { *
* * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; } @@ -3869,9 +4170,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3913,14 +4216,17 @@ declare namespace Office { * * The name of a setting is a string, while the value can be a string, number, boolean, null, object, or array. * - * The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object when the add-in is activated. + * The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object + * when the add-in is activated. * The developer is responsible for calling the saveAsync method after adding or deleting settings to save the settings in the document. */ interface Settings { /** * Adds an event handler for the settingsChanged event. * - * Important: Your add-in's code can register a handler for the settingsChanged event when the add-in is running with any Excel client, but the event will fire only when the add-in is loaded with a spreadsheet that is opened in Excel Online, and more than one user is editing the spreadsheet (co-authoring). Therefore, effectively the settingsChanged event is supported only in Excel Online in co-authoring scenarios. + * Important: Your add-in's code can register a handler for the settingsChanged event when the add-in is running with any Excel client, but + * the event will fire only when the add-in is loaded with a spreadsheet that is opened in Excel Online, and more than one user is editing the + * spreadsheet (co-authoring). Therefore, effectively the settingsChanged event is supported only in Excel Online in co-authoring scenarios. * * @remarks * @@ -3931,7 +4237,7 @@ declare namespace Office { * @param eventType Specifies the type of event to add. Required. * @param handler The event handler function to add. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * *
* @@ -3958,9 +4264,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3977,9 +4285,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4001,12 +4311,14 @@ declare namespace Office { * *
Requirement SetsSettings
* - * This method is useful in Excel, Word, and PowerPoint coauthoring scenarios when multiple instances of the same add-in are working against the same document. - * Because each add-in is working against an in-memory copy of the settings loaded from the document at the time the user opened it, the settings values used by each user can get out of sync. - * This can happen whenever an instance of the add-in calls the Settings.saveAsync method to persist all of that user's settings to the document. - * Calling the refreshAsync method from the event handler for the settingsChanged event of the add-in will refresh the settings values for all users. + * This method is useful in Excel, Word, and PowerPoint coauthoring scenarios when multiple instances of the same add-in are working against + * the same document. Because each add-in is working against an in-memory copy of the settings loaded from the document at the time the user + * opened it, the settings values used by each user can get out of sync. This can happen whenever an instance of the add-in calls the + * Settings.saveAsync method to persist all of that user's settings to the document. Calling the refreshAsync method from the event handler + * for the settingsChanged event of the add-in will refresh the settings values for all users. * - * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -4033,9 +4345,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4046,13 +4360,15 @@ declare namespace Office { * *
Word Y Y Y
* - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ refreshAsync(callback?: (result: AsyncResult) => void): void; /** * Removes the specified setting. * - * Important: Be aware that the Settings.remove method affects only the in-memory copy of the settings property bag. To persist the removal of the specified setting in the document, at some point after calling the Settings.remove method and before the add-in is closed, you must call the Settings.saveAsync method. + * Important: Be aware that the Settings.remove method affects only the in-memory copy of the settings property bag. To persist the removal of + * the specified setting in the document, at some point after calling the Settings.remove method and before the add-in is closed, you must + * call the Settings.saveAsync method. * * @remarks *
Requirement SetsSettings
@@ -4061,9 +4377,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4084,17 +4402,22 @@ declare namespace Office { * *
Requirement SetsSettings
* - * If the optional handler parameter is omitted when calling the removeHandlerAsync method, all event handlers for the specified eventType will be removed. + * If the optional handler parameter is omitted when calling the removeHandlerAsync method, all event handlers for the specified eventType + * will be removed. * - * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. + * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback + * function's only parameter. * - * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the + * following information. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4106,18 +4429,21 @@ declare namespace Office { * * @param eventType Specifies the type of event to remove. Required. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Persists the in-memory copy of the settings property bag in the document. * * @remarks - * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the set and get methods to work with the in-memory copy of the settings property bag. - * When you want to persist the settings so that they are available the next time the add-in is used, use the saveAsync method. + * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the + * set and get methods to work with the in-memory copy of the settings property bag. When you want to persist the settings so that they are + * available the next time the add-in is used, use the saveAsync method. * - * Note: The saveAsync method persists the in-memory settings property bag into the document file. However, the changes to the document file itself are saved only when the user (or AutoRecover setting) saves the document to the file system. - * The refreshAsync method is only useful in coauthoring scenarios when other instances of the same add-in might change the settings and those changes should be made available to all instances. + * Note: The saveAsync method persists the in-memory settings property bag into the document file. However, the changes to the document file + * itself are saved only when the user (or AutoRecover setting) saves the document to the file system. The refreshAsync method is only useful + * in coauthoring scenarios when other instances of the same add-in might change the settings and those changes should be made available to + * all instances. * *
* @@ -4144,9 +4470,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4158,26 +4486,31 @@ declare namespace Office { *
* * @param options Provides options for saving settings. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * * Important: Be aware that the Settings.set method affects only the in-memory copy of the settings property bag. - * To make sure that additions or changes to settings will be available to your add-in the next time the document is opened, at some point after calling the Settings.set method and before the add-in is closed, you must call the Settings.saveAsync method to persist settings in the document. + * To make sure that additions or changes to settings will be available to your add-in the next time the document is opened, at some point + * after calling the Settings.set method and before the add-in is closed, you must call the Settings.saveAsync method to persist settings in + * the document. * * @remarks *
Requirement SetsSettings
* - * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name in the in-memory copy of the settings property bag. - * After you call the Settings.saveAsync method, the value is stored in the document as the serialized JSON representation of its data type. A maximum of 2MB is available for the settings of each add-in. + * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name + * in the in-memory copy of the settings property bag. After you call the Settings.saveAsync method, the value is stored in the document as + * the serialized JSON representation of its data type. A maximum of 2MB is available for the settings of each add-in. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4203,9 +4536,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4216,7 +4551,8 @@ declare namespace Office { */ interface Slice { /** - * Gets the raw data of the file slice in `Office.FileType.Text` ("text") or `Office.FileType.Compressed` ("compressed") format as specified by the fileType parameter of the call to the Document.getFileAsync method. + * Gets the raw data of the file slice in `Office.FileType.Text` ("text") or `Office.FileType.Compressed` ("compressed") format as specified + * by the fileType parameter of the call to the Document.getFileAsync method. * * @remarks * @@ -4238,9 +4574,11 @@ declare namespace Office { * @remarks *
Requirement SetsTableBindings
* - * The TableBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the Binding object. + * The TableBinding object inherits the `id` property, `type` property, `getDataAsync` method, and `setDataAsync` method from the + * {@link Office.Binding} object. * - * For Excel, note that after you establish a table binding in Excel, each new row a user adds to the table is automatically included in the binding and rowCount increases. + * For Excel, note that after you establish a table binding, each new row a user adds to the table is automatically included in the binding and + * rowCount increases. */ interface TableBinding extends Binding { /** @@ -4250,9 +4588,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4270,9 +4610,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4287,20 +4629,27 @@ declare namespace Office { * Gets the number of rows in the TableBinding, as an integer value. * * @remarks - * When you insert an empty table by selecting a single row in Excel 2013 and Excel Online (using Table on the Insert tab), both Office host applications create a single row of headers followed by a single blank row. However, if your add-in's script creates a binding for this newly inserted table (for example, by using the addFromSelectionAsync method), and then checks the value of the rowCount property, the value returned will differ depending whether the spreadsheet is open in Excel 2013 or Excel Online. + * When you insert an empty table by selecting a single row in Excel 2013 and Excel Online (using Table on the Insert tab), both Office host + * applications create a single row of headers followed by a single blank row. However, if your add-in's script creates a binding for this + * newly inserted table (for example, by using the {@link Office.Bindings}.addFromSelectionAsync method), and then checks the value of the + * rowCount property, the value returned will differ depending whether the spreadsheet is open in Excel 2013 or Excel Online. + * * - In Excel on the desktop, rowCount will return 0 (the blank row following the headers is not counted). * * - In Excel Online, rowCount will return 1 (the blank row following the headers is counted). * - * You can work around this difference in your script by checking if rowCount == 1, and if so, then checking if the row contains all empty strings. + * You can work around this difference in your script by checking if rowCount == 1, and if so, then checking if the row contains all empty + * strings. * * In content add-ins for Access, for performance reasons the rowCount property always returns -1. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4316,23 +4665,30 @@ declare namespace Office { * * @remarks * - * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. + * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more + * columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. * - * The success or failure of an addColumnsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be completely rolled back (and the AsyncResult.status property returned to the callback will report failure): + * The success or failure of an addColumnsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be + * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * - * - Each row in the array you pass as the data argument must have the same number of rows as the table being updated. If not, the entire operation will fail. + * - Each row in the array you pass as the data argument must have the same number of rows as the table being updated. If not, the entire + * operation will fail. * - * - Each row and cell in the array must successfully add that row or cell to the table in the newly added column(s). If any row or cell fails to be set for any reason, the entire operation will fail. + * - Each row and cell in the array must successfully add that row or cell to the table in the newly added column(s). If any row or cell + * fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * - * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in a single call to this method. + * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in + * a single call to this method. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4343,7 +4699,7 @@ declare namespace Office { * * @param tableData An array of arrays ("matrix") or a TableData object that contains one or more columns of data to add to the table. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -4351,23 +4707,27 @@ declare namespace Office { * * @remarks * - * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. + * The success or failure of an addRowsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be + * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * - * The success or failure of an addRowsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be completely rolled back (and the AsyncResult.status property returned to the callback will report failure): + * - Each row in the array you pass as the data argument must have the same number of columns as the table being updated. If not, the entire + * operation will fail. * - * - Each row in the array you pass as the data argument must have the same number of columns as the table being updated. If not, the entire operation will fail. - * - * - Each column and cell in the array must successfully add that column or cell to the table in the newly added rows(s). If any column or cell fails to be set for any reason, the entire operation will fail. + * - Each column and cell in the array must successfully add that column or cell to the table in the newly added rows(s). If any column or + * cell fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * - * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in a single call to this method. + * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in + * a single call to this method. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4379,7 +4739,7 @@ declare namespace Office { * * @param rows An array of arrays ("matrix") or a TableData object that contains one or more rows of data to add to the table. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -4391,9 +4751,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4404,7 +4766,7 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -4415,9 +4777,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4426,7 +4790,7 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -4434,7 +4798,7 @@ declare namespace Office { * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. * @param formats An array specifying the format properties to get. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -4445,7 +4809,8 @@ declare namespace Office { * **Specifying the cellFormat parameter** * * Use the cellFormat parameter to set or change cell formatting values, such as width, height, font, background, alignment, and so on. - * The value you pass as the cellFormat parameter is an array that contains a list of one or more JavaScript objects that specify which cells to target (`cells:`) and the formats (`format:`) to apply to them. + * The value you pass as the cellFormat parameter is an array that contains a list of one or more JavaScript objects that specify which cells + * to target (`cells:`) and the formats (`format:`) to apply to them. * * Each JavaScript object in the cellFormat array has this form: `{cells:{ cell_range }, format:{ format_definition }}` * @@ -4484,9 +4849,11 @@ declare namespace Office { * * * - * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel (Right-click > Format Cells or Home > Format > Format Cells). + * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel + * (Right-click > Format Cells or Home > Format > Format Cells). * - * You specify the value of the `format:` property as a list of one or more property name - value pairs in a JavaScript object literal. The property name specifies the name of the formatting property to set, and value specifies the property value. + * You specify the value of the `format:` property as a list of one or more property name - value pairs in a JavaScript object literal. The + * property name specifies the name of the formatting property to set, and value specifies the property value. * You can specify multiple values for a given format, such as both a font's color and size. * * Here's three `format:` property value examples: @@ -4512,9 +4879,11 @@ declare namespace Office { * * For more detail, see how to {@link https://support.office.com/article/create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4 | Create a custom number format}. * - * To set formatting on tables when writing data, use the tableOptions and cellFormat optional parameters of the `Document.setSelectedDataAsync` or `TableBinding.setDataAsync` methods. + * To set formatting on tables when writing data, use the tableOptions and cellFormat optional parameters of the + * `Document.setSelectedDataAsync` or `TableBinding.setDataAsync` methods. * - * Setting formatting with the optional parameters of the `Document.setSelectedDataAsync` and `TableBinding.setDataAsync` methods only works to set formatting when writing data the first time. + * Setting formatting with the optional parameters of the `Document.setSelectedDataAsync` and `TableBinding.setDataAsync` methods only works + * to set formatting when writing data the first time. * To make formatting changes after writing data, use the following methods: * * - To update cell formatting, such as font color and style, use the `TableBinding.setFormatsAsync` method (this method). @@ -4523,9 +4892,11 @@ declare namespace Office { * * - To clear formatting, use the `TableBinding.clearFormats` method. * - * For more details and examples, see {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. + * For more details and examples, see + * {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. * - * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -4552,9 +4923,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4564,7 +4937,7 @@ declare namespace Office { * * @param cellFormat An array that contains one or more JavaScript objects that specify which cells to target and the formatting to apply to them. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setFormatsAsync(cellFormat?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -4602,9 +4975,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4614,7 +4989,7 @@ declare namespace Office { * * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ @@ -4639,9 +5014,11 @@ declare namespace Office { * *
Requirement SetsTableBindings
* - * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers for a two-column table you would set the header property to [['header1', 'header2']]. + * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers + * for a two-column table you would set the header property to [['header1', 'header2']]. * - * If you specify null for the headers property (or leaving the property empty when you construct a TableData object), the following results occur when your code executes: + * If you specify null for the headers property (or leaving the property empty when you construct a TableData object), the following results + * occur when your code executes: * * - If you insert a new table, the default column headers for the table are created. * @@ -4649,16 +5026,19 @@ declare namespace Office { */ headers: any[]; /** - * Gets or sets the rows in the table. Returns an array of arrays that contains the data in the table. Returns an empty array ``, if there are no rows. + * Gets or sets the rows in the table. Returns an array of arrays that contains the data in the table. Returns an empty array ``, if there are + * no rows. * * @remarks * * *
HostsExcel, Word
Requirement SetsTableBindings
* - * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. + * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of + * string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. * - * If you specify null for the rows property (or leave the property empty when you construct a TableData object), the following results occur when your code executes: + * If you specify null for the rows property (or leave the property empty when you construct a TableData object), the following results occur + * when your code executes: * * - If you insert a new table, a blank row will be inserted. * @@ -4667,15 +5047,18 @@ declare namespace Office { rows: any[][]; } /** - * Specifies enumerated values for the `cells` property in the cellFormat parameter of {@link https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | table formatting methods}. + * Specifies enumerated values for the `cells` property in the cellFormat parameter of + * {@link https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | table formatting methods}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4703,13 +5086,16 @@ declare namespace Office { * @remarks *
Requirement SetsTextBindings
* - * The TextBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the {@link Office.Binding} object. It does not implement any additional properties or methods of its own. + * The TextBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the {@link Office.Binding} + * object. It does not implement any additional properties or methods of its own. * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4728,9 +5114,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4748,7 +5136,8 @@ declare namespace Office { */ CurrencySymbol, /** - * The placement of the currency symbol: Not specified = -1; Before the value with no space ($0) = 0; After the value with no space (0$) = 1; Before the value with a space ($ 0) = 2; After the value with a space (0 $) = 3. + * The placement of the currency symbol: Not specified = -1; Before the value with no space ($0) = 0; After the value with no space (0$) = 1; + * Before the value with a space ($ 0) = 2; After the value with a space (0 $) = 3. */ CurrencySymbolPosition, DurationUnits, @@ -4795,13 +5184,17 @@ declare namespace Office { * @remarks * A ProjectResourceFields constant can be used as a parameter of the {@link Office.Document | Document}.getResourceFieldAsync method. * - * For more information about working with fields in Project, see {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In Project Help, search for Available fields. + * For more information about working with fields in Project, see + * {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In + * Project Help, search for Available fields. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4811,7 +5204,8 @@ declare namespace Office { */ enum ProjectResourceFields { /** - * The accrual method that defines how a task accrues the cost of the resource: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how a task accrues the cost of the resource: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Accrual, /** @@ -5617,13 +6011,17 @@ declare namespace Office { * @remarks * A ProjectTaskFields constant can be used as a parameter of the {@link Office.Document | Document}.getTaskFieldAsync method. * - * For more information about working with fields in Project, see the {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In Project Help, search for Available fields. + * For more information about working with fields in Project, see the + * {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. + * In Project Help, search for Available fields. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -5885,7 +6283,8 @@ declare namespace Office { */ Baseline10FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline10FixedCostAccrual, /** @@ -5921,7 +6320,8 @@ declare namespace Office { */ Baseline1FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline1FixedCostAccrual, /** @@ -5957,7 +6357,8 @@ declare namespace Office { */ Baseline2FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline2FixedCostAccrual, /** @@ -5993,7 +6394,8 @@ declare namespace Office { */ Baseline3FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline3FixedCostAccrual, /** @@ -6029,7 +6431,8 @@ declare namespace Office { */ Baseline4FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline4FixedCostAccrual, /** @@ -6065,7 +6468,8 @@ declare namespace Office { */ Baseline5FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline5FixedCostAccrual, /** @@ -6101,7 +6505,8 @@ declare namespace Office { */ Baseline6FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline6FixedCostAccrual, /** @@ -6137,7 +6542,8 @@ declare namespace Office { */ Baseline7FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline7FixedCostAccrual, /** @@ -6173,7 +6579,8 @@ declare namespace Office { */ Baseline8FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline8FixedCostAccrual, /** @@ -6209,7 +6616,8 @@ declare namespace Office { */ Baseline9FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline9FixedCostAccrual, /** @@ -6245,7 +6653,8 @@ declare namespace Office { */ BaselineFixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ BaselineFixedCostAccrual, /** @@ -6275,7 +6684,8 @@ declare namespace Office { */ ConstraintDate, /** - * A constraint type for the task: As Soon As Possible = 0, As Late As Possible = 1, Must Start On = 2, Must Finish On = 3, Start No Earlier Than = 4, Start No Later Than = 5, Finish No Earlier Than = 6, Finish No Later Than = 7. + * A constraint type for the task: As Soon As Possible = 0, As Late As Possible = 1, Must Start On = 2, Must Finish On = 3, + * Start No Earlier Than = 4, Start No Later Than = 5, Finish No Earlier Than = 6, Finish No Later Than = 7. */ ConstraintType, /** @@ -6419,7 +6829,8 @@ declare namespace Office { */ FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ FixedCostAccrual, /** @@ -6763,13 +7174,16 @@ declare namespace Office { * Specifies the types of views that the {@link Office.Document | Document}.getSelectedViewAsync method can recognize. * * @remarks - * The {@link Office.Document | Document}.getSelectedViewAsync method returns the ProjectViewTypes constant value and name that corresponds to the active view. + * The {@link Office.Document | Document}.getSelectedViewAsync method returns the ProjectViewTypes constant value and name that corresponds to the + * active view. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -7097,7 +7511,8 @@ declare namespace Office { */ TwoColumns = "TwoColumns", /** - Three column view. Displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a desktop computer. + Three column view. Displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a desktop + computer. */ ThreeColumns = "ThreeColumns" } @@ -7853,7 +8268,8 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to end. * - * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to + * convert the end property value to the client's local date and time. * * *Read mode* * @@ -7863,7 +8279,8 @@ declare namespace Office { * * The end property returns a Time object. * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -7937,7 +8354,8 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to begin. * - * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method + * to convert the value to the client's local date and time. * * *Read mode* * @@ -7947,7 +8365,8 @@ declare namespace Office { * * The start property returns a Time object. * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -8020,7 +8439,8 @@ declare namespace Office { size: number; } /** - * The body object provides methods for adding and updating the content of the message or appointment. It is returned in the body property of the selected item. + * The body object provides methods for adding and updating the content of the message or appointment. + * It is returned in the body property of the selected item. * * [Api set: Mailbox 1.1] * @@ -8035,7 +8455,9 @@ declare namespace Office { * * This method returns the entire current body in the format specified by coercionType. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. + * The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * * [Api set: Mailbox 1.3] * @@ -8059,7 +8481,9 @@ declare namespace Office { * * This method returns the entire current body in the format specified by coercionType. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. + * The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * * [Api set: Mailbox 1.3] * @@ -8069,7 +8493,8 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
* * @param coercionType The format for the returned body. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The body is provided in the requested format in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. The body is provided in the requested format in the asyncResult.value property. */ getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; @@ -8085,15 +8510,18 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The content type is returned as one of the CoercionType values in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type + * {@link Office.AsyncResult}. The content type is returned as one of the CoercionType values in the asyncResult.value property. */ getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (
) to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8116,15 +8544,18 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. */ prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8144,9 +8575,11 @@ declare namespace Office { /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8156,15 +8589,18 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters. * * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. */ prependAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8179,9 +8615,12 @@ declare namespace Office { /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8204,15 +8643,19 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. */ setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8232,9 +8675,12 @@ declare namespace Office { /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8246,15 +8692,19 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. */ setAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8272,9 +8722,12 @@ declare namespace Office { /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8297,15 +8750,19 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8325,9 +8782,12 @@ declare namespace Office { /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8339,15 +8799,19 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. Any errors encountered will be provided in the asyncResult.error property. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8365,7 +8829,8 @@ declare namespace Office { /** * Represents a contact stored on the server. Read mode only. * - * The list of contacts associated with an email message or appointment is returned in the contacts property of the {@link Office.Entities} object that is returned by the getEntities or getEntitiesByType method of the active item. + * The list of contacts associated with an email message or appointment is returned in the contacts property of the {@link Office.Entities} object + * that is returned by the getEntities or getEntitiesByType method of the active item. * * [Api set: Mailbox 1.0] * @@ -8401,7 +8866,10 @@ declare namespace Office { urls: Array; } /** - * The CustomProperties object represents custom properties that are specific to a particular item and specific to a mail add-in for Outlook. For example, there might be a need for a mail add-in to save some data that is specific to the current email message that activated the add-in. If the user revisits the same message in the future and activates the mail add-in again, the add-in will be able to retrieve the data that had been saved as custom properties. + * The CustomProperties object represents custom properties that are specific to a particular item and specific to a mail add-in for Outlook. + * For example, there might be a need for a mail add-in to save some data that is specific to the current email message that activated the add-in. + * If the user revisits the same message in the future and activates the mail add-in again, the add-in will be able to retrieve the data that had + * been saved as custom properties. * * Because Outlook for Mac doesn't cache custom properties, if the user's network goes down, mail add-ins cannot access their custom properties. * @@ -8431,7 +8899,9 @@ declare namespace Office { * * The set method sets the specified property to the specified value. You must use the saveAsync method to save the property to the server. * - * The set method creates a new property if the specified property does not already exist; otherwise, the existing value is replaced with the new value. The value parameter can be of any type; however, it is always passed to the server as a string. + * The set method creates a new property if the specified property does not already exist; + * otherwise, the existing value is replaced with the new value. + * The value parameter can be of any type; however, it is always passed to the server as a string. * * [Api set: Mailbox 1.0] * @@ -8461,11 +8931,17 @@ declare namespace Office { /** * Saves item-specific custom properties to the server. * - * You must call the saveAsync method to persist any changes made with the set method or the remove method of the CustomProperties object. The saving action is asynchronous. + * You must call the saveAsync method to persist any changes made with the set method or the remove method of the CustomProperties object. + * The saving action is asynchronous. * - * It's a good practice to have your callback function check for and handle errors from saveAsync. In particular, a read add-in can be activated while the user is in a connected state in a read form, and subsequently the user becomes disconnected. If the add-in calls saveAsync while in the disconnected state, saveAsync would return an error. Your callback method should handle this error accordingly. + * It's a good practice to have your callback function check for and handle errors from saveAsync. + * In particular, a read add-in can be activated while the user is in a connected state in a read form, and subsequently the user becomes + * disconnected. + * If the add-in calls saveAsync while in the disconnected state, saveAsync would return an error. + * Your callback method should handle this error accordingly. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * @param asyncContext Optional. Any state data that is passed to the callback method. * * [Api set: Mailbox 1.0] @@ -8504,7 +8980,8 @@ declare namespace Office { /** * Gets a string that represents the version of either the host application or the Exchange Server. * - * If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the host application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. + * If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the host + * application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. * * [Api set: Mailbox 1.0] * @@ -8523,11 +9000,13 @@ declare namespace Office { * * Outlook Web App has three views that correspond to the width of the screen and the window, and the number of columns that can be displayed: * - * - OneColumn, which is displayed when the screen is narrow. Outlook Web App uses this single-column layout on the entire screen of a smartphone. + * - OneColumn, which is displayed when the screen is narrow. Outlook Web App uses this single-column layout on the entire screen of a + * smartphone. * * - TwoColumns, which is displayed when the screen is wider. Outlook Web App uses this view on most tablets. * - * - ThreeColumns, which is displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a desktop computer. + * - ThreeColumns, which is displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a + * desktop computer. * * [Api set: Mailbox 1.0] * @@ -8558,7 +9037,9 @@ declare namespace Office { */ displayName: string; /** - * Gets the response that an attendee returned for an appointment. This property applies to only an attendee of an appointment, as represented by the optionalAttendees or requiredAttendees property. This property returns undefined in other scenarios. + * Gets the response that an attendee returned for an appointment. + * This property applies to only an attendee of an appointment, as represented by the optionalAttendees or requiredAttendees property. + * This property returns undefined in other scenarios. */ appointmentResponse: Office.MailboxEnums.ResponseType; /** @@ -8589,17 +9070,25 @@ declare namespace Office { /** * Represents a collection of entities found in an email message or appointment. Read mode only. * - * The Entities object is a container for the entity arrays returned by the getEntities and getEntitiesByType methods when the item (either an email message or an appointment) contains one or more entities that have been found by the server. You can use these entities in your code to provide additional context information to the viewer, such as a map to an address found in the item, or to open a dialer for a phone number found in the item. + * The Entities object is a container for the entity arrays returned by the getEntities and getEntitiesByType methods when the item + * (either an email message or an appointment) contains one or more entities that have been found by the server. + * You can use these entities in your code to provide additional context information to the viewer, such as a map to an address found in the item, + * or to open a dialer for a phone number found in the item. * - * If no entities of the type specified in the property are present in the item, the property associated with that entity is null. For example, if a message contains a street address and a phone number, the addresses property and phoneNumbers property would contain information, and the other properties would be null. + * If no entities of the type specified in the property are present in the item, the property associated with that entity is null. + * For example, if a message contains a street address and a phone number, the addresses property and phoneNumbers property would contain + * information, and the other properties would be null. * - * To be recognized as an address, the string must contain a United States postal address that has at least a subset of the elements of a street number, street name, city, state, and zip code. + * To be recognized as an address, the string must contain a United States postal address that has at least a subset of the elements of a street + * number, street name, city, state, and zip code. * * To be recognized as a phone number, the string must contain a North American phone number format. * - * Entity recognition relies on natural language recognition that is based on machine learning of large amounts of data. The recognition of an entity is non-deterministic and success sometimes relies on the particular context in the item. + * Entity recognition relies on natural language recognition that is based on machine learning of large amounts of data. + * The recognition of an entity is non-deterministic and success sometimes relies on the particular context in the item. * - * When the property arrays are returned by the getEntitiesByType method, only the property for the specified entity contains data; all other properties are null. + * When the property arrays are returned by the getEntitiesByType method, only the property for the specified entity contains data; + * all other properties are null. * * [Api set: Mailbox 1.0] * @@ -8672,7 +9161,8 @@ declare namespace Office { * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @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. */ getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** @@ -8690,22 +9180,25 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, + * which is an {@link Office.AsyncResult} object. */ getAsync(callback?: (result: AsyncResult) => void): void; } /** - * The subclass of {@link Office.Item} dealing with apppointments. + * The subclass of {@link Office.Item} dealing with appointments. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface Appointment extends Item { } /** * The appointment organizer mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface AppointmentCompose extends Appointment, ItemCompose { /** @@ -8749,9 +9242,11 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to end. * - * The end property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * The end property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -8777,7 +9272,8 @@ declare namespace Office { */ itemType: Office.MailboxEnums.ItemType; /** - * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are used to get and set the location of the appointment. + * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are + * used to get and set the location of the appointment. * * [Api set: Mailbox 1.0] * @@ -8801,7 +9297,9 @@ declare namespace Office { */ notificationMessages: Office.NotificationMessages; /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees for a meeting. + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. + * The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees + * for a meeting. * * [Api set: Mailbox 1.0] * @@ -8815,11 +9313,13 @@ declare namespace Office { /** * Gets or sets the recurrence pattern of an appointment. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single + * appointment and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -8833,7 +9333,9 @@ declare namespace Office { */ recurrence: Recurrence; /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees for a meeting. + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. + * The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees + * for a meeting. * * [Api set: Mailbox 1.0] * @@ -8847,11 +9349,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -8867,9 +9374,11 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to begin. * - * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -8925,7 +9434,9 @@ 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. * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -8989,7 +9500,9 @@ declare namespace Office { * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** @@ -9010,10 +9523,12 @@ declare namespace Office { * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -9021,7 +9536,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -9032,8 +9548,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -9041,11 +9559,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9068,17 +9590,23 @@ 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 AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9096,11 +9624,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9120,11 +9652,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9137,17 +9673,21 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * - * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client prompts the user to save, discard, or close the action. + * The behaviors of the close method depends on the current state of the item being composed. + * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. * - * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, discard, or cancel even if no changes have occurred since the item was last saved. + * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, + * discard, or cancel even if no changes have occurred since the item was last saved. * * [Api set: Mailbox 1.3] * @@ -9175,9 +9715,11 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult.} + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -9185,9 +9727,11 @@ declare namespace Office { /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.0] * @@ -9200,7 +9744,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. @@ -9209,9 +9754,11 @@ declare namespace Office { /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.0] * @@ -9224,16 +9771,22 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -9243,14 +9796,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9273,13 +9832,19 @@ 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 AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9297,7 +9862,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9317,7 +9886,12 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. + * In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9330,13 +9904,16 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -9351,10 +9928,12 @@ declare namespace Office { * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -9373,8 +9952,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -9382,11 +9963,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9414,17 +10001,25 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9447,11 +10042,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9476,11 +10077,16 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9498,13 +10104,17 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9524,17 +10134,28 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the + * default style is applied in Outlook. + * If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9546,13 +10167,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. */ setSelectedDataAsync(data: string): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9564,16 +10188,24 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the + * default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9585,8 +10217,11 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } @@ -9594,7 +10229,8 @@ declare namespace Office { /** * The appointment attendee mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of 'Office.context.mailbox.item'. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of 'Office.context.mailbox.item'. Refer to the Object Model pages for more information. */ interface AppointmentRead extends Appointment, ItemRead { /** @@ -9608,7 +10244,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see + * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ attachments: Office.AttachmentDetails[]; @@ -9653,9 +10290,11 @@ declare namespace Office { /** * Gets the date and time that the appointment is to end. * - * The end property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * The end property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -9705,9 +10344,14 @@ declare namespace Office { /** * Gets the Exchange Web Services item identifier for the current item. * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * The itemId property is not available in compose mode. + * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier + * in the AsyncResult.value parameter in the callback function. * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. + * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * [Api set: Mailbox 1.0] * @@ -9749,7 +10393,8 @@ declare namespace Office { /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. + * To get the subject of the item with the prefixes intact, use the subject property. * * [Api set: Mailbox 1.0] * @@ -9775,7 +10420,8 @@ declare namespace Office { /** * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. * - * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to the meeting. + * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to + * the meeting. * * [Api set: Mailbox 1.0] * @@ -9801,11 +10447,13 @@ declare namespace Office { /** * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single + * appointment and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -9821,7 +10469,8 @@ declare namespace Office { /** * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. * - * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to the meeting. + * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to + * the meeting. * * [Api set: Mailbox 1.0] * @@ -9835,7 +10484,8 @@ declare namespace Office { /** * Gets the date and time that the appointment is to begin. * - * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * * [Api set: Mailbox 1.0] * @@ -9849,11 +10499,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it + * should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -9886,7 +10541,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -9901,10 +10557,12 @@ declare namespace Office { * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -9913,7 +10571,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -9924,20 +10583,25 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. + * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the + * selected appointment. * * In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. * * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -9960,7 +10624,9 @@ declare namespace Office { * * If any of the string parameters exceed their limits, displayReplyForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -9980,7 +10646,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -9996,9 +10663,11 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -10016,9 +10685,11 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -10047,7 +10718,9 @@ declare namespace Office { * @param entityType One of the EntityType enumeration values. * * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. If no entities of the specified type are present in the item's body, the method returns an empty array. Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. + * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. + * If no entities of the specified type are present in the item's body, the method returns an empty array. + * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks * @@ -10103,7 +10776,8 @@ declare namespace Office { /** * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element in the manifest XML file with the specified FilterName element value. + * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element + * in the manifest XML file with the specified FilterName element value. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -10116,22 +10790,33 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. + * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, + * the method returns null. + * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, + * the method return an empty array. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.0] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -10143,9 +10828,12 @@ declare namespace Office { /** * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule element in the manifest XML file with the specified RegExName element value. + * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule + * element in the manifest XML file with the specified RegExName element value. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -10180,18 +10868,27 @@ declare namespace Office { */ getSelectedEntities(): Entities; /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. Highlighted matches apply to contextual add-ins. + * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. + * Highlighted matches apply to contextual add-ins. * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.6] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -10203,9 +10900,13 @@ declare namespace Office { /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -10215,15 +10916,18 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -10238,10 +10942,12 @@ declare namespace Office { * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -10249,7 +10955,8 @@ declare namespace Office { /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -10260,8 +10967,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -10269,7 +10978,8 @@ declare namespace Office { } /** - * The item namespace is used to access the currently selected message, meeting request, or appointment. You can determine the type of the item by using the `itemType` property. + * The item namespace is used to access the currently selected message, meeting request, or appointment. + * You can determine the type of the item by using the `itemType` property. * * [Api set: Mailbox 1.0] * @@ -10320,7 +11030,8 @@ declare namespace Office { /** * Gets the type of item that an instance represents. * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or + * an appointment. * * [Api set: Mailbox 1.0] * @@ -10345,13 +11056,17 @@ declare namespace Office { notificationMessages: Office.NotificationMessages; /** - * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * Read and compose modes for appointment items. Read mode for meeting request items. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. + * `undefined` is returned for messages that are not meeting requests. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment + * and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -10368,11 +11083,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -10404,10 +11124,12 @@ declare namespace Office { * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -10427,8 +11149,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -10437,9 +11161,13 @@ declare namespace Office { /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -10449,15 +11177,18 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -10472,10 +11203,12 @@ declare namespace Office { * `removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -10484,7 +11217,8 @@ declare namespace Office { /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -10495,8 +11229,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -10505,7 +11241,8 @@ declare namespace Office { /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface ItemCompose extends Item { /** @@ -10552,8 +11289,12 @@ declare namespace Office { * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the + * attachment list. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -10596,7 +11337,8 @@ declare namespace Office { * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the + * attachment list. */ addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; /** @@ -10617,18 +11359,25 @@ declare namespace Office { * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10651,17 +11400,24 @@ 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 AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10679,11 +11435,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10703,11 +11463,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10720,18 +11484,23 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * - * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client prompts the user to save, discard, or close the action. + * The behaviors of the close method depends on the current state of the item being composed. + * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. * - * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, discard, or cancel even if no changes have occurred since the item was last saved. + * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, + * discard, or cancel even if no changes have occurred since the item was last saved. * * [Api set: Mailbox 1.3] * @@ -10759,9 +11528,11 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -10769,9 +11540,11 @@ declare namespace Office { /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes + * from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.0] * @@ -10784,16 +11557,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.0] * @@ -10806,16 +11583,22 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10838,13 +11621,19 @@ 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 AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10862,7 +11651,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10882,7 +11675,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10895,18 +11692,26 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Offfice.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -10934,17 +11739,25 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -10967,11 +11780,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -10996,11 +11815,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -11018,13 +11843,17 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11044,17 +11873,28 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. + * If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11066,13 +11906,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. */ setSelectedDataAsync(data: string): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11084,16 +11927,25 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. + * If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11105,15 +11957,19 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface ItemRead extends Item { /** @@ -11126,7 +11982,9 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. + * For more information, see + * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ attachments: Office.AttachmentDetails[]; @@ -11134,7 +11992,8 @@ declare namespace Office { * Gets the Exchange Web Services item class of the selected item. * * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class IPM.Appointment.Contoso. + * You can create custom message classes that extends a default message class, for example, a custom appointment message class + * IPM.Appointment.Contoso. * * [Api set: Mailbox 1.0] * @@ -11144,7 +12003,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. + * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or + * appointment item. * * * @@ -11168,9 +12028,14 @@ declare namespace Office { /** * Gets the Exchange Web Services item identifier for the current item. * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * The itemId property is not available in compose mode. + * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier + * in the AsyncResult.value parameter in the callback function. * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. + * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * [Api set: Mailbox 1.0] * @@ -11184,7 +12049,8 @@ declare namespace Office { /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by + * email programs. To get the subject of the item with the prefixes intact, use the subject property. * * [Api set: Mailbox 1.0] * @@ -11212,13 +12078,16 @@ declare namespace Office { */ subject: string; /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. + * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the + * selected appointment. * * In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. * * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11241,7 +12110,9 @@ declare namespace Office { * * If any of the string parameters exceed their limits, displayReplyForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11261,7 +12132,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -11277,9 +12149,11 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -11287,7 +12161,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -11297,9 +12172,11 @@ declare namespace Office { * *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -11328,14 +12205,17 @@ declare namespace Office { * @param entityType One of the EntityType enumeration values. * * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. If no entities of the specified type are present in the item's body, the method returns an empty array. Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. + * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. + * If no entities of the specified type are present in the item's body, the method returns an empty array. + * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* - * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. + * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the + * following table. * * * @@ -11384,7 +12264,8 @@ declare namespace Office { /** * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element in the manifest XML file with the specified FilterName element value. + * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element + * in the manifest XML file with the specified FilterName element value. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11397,22 +12278,33 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. + * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, + * the method returns null. + * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, + * the method return an empty array. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.0] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -11424,9 +12316,12 @@ declare namespace Office { /** * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule element in the manifest XML file with the specified RegExName element value. + * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule + * element in the manifest XML file with the specified RegExName element value. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11461,18 +12356,25 @@ declare namespace Office { */ getSelectedEntities(): Entities; /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. Highlighted matches apply to contextual add-ins. + * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. + * Highlighted matches apply to contextual add-ins. * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.6] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -11485,15 +12387,19 @@ declare namespace Office { /** * A subclass of {@link Office.Item} for messages. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface Message extends Item { /** * Gets an identifier for the email conversation that contains a particular message. * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. + * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will + * change and that value you obtained earlier will no longer apply. * - * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * You get null for this property for a new item in a compose form. + * If the user sets a subject and saves the item, the conversationId property will return a value. * * [Api set: Mailbox 1.0] * @@ -11509,7 +12415,8 @@ declare namespace Office { /** * The message compose mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface MessageCompose extends Message, ItemCompose { /** @@ -11537,9 +12444,11 @@ declare namespace Office { */ body: Office.Body; /** - * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the + * current item. * - * The cc property returns a {@link Office.Recipients} object that provides methods to get or update the recipients on the Cc line of the message. + * The cc property returns a {@link Office.Recipients} object that provides methods to get or update the recipients on the Cc line of + * the message. * * [Api set: Mailbox 1.0] * @@ -11553,9 +12462,12 @@ declare namespace Office { /** * Gets an identifier for the email conversation that contains a particular message. * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. + * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change + * and that value you obtained earlier will no longer apply. * - * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * You get null for this property for a new item in a compose form. + * If the user sets a subject and saves the item, the conversationId property will return a value. * * [Api set: Mailbox 1.0] * @@ -11595,7 +12507,8 @@ declare namespace Office { /** * Gets the email address of the sender of a message. * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * The from and sender properties represent the same person unless the message is sent by a delegate. + * In that case, the from property represents the delegator, and the sender property represents the delegate. * * The from property returns a From object that provides a method to get the from value. * @@ -11613,7 +12526,8 @@ declare namespace Office { /** * Gets the type of item that an instance represents. * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or + * an appointment. * * [Api set: Mailbox 1.0] * @@ -11637,13 +12551,17 @@ declare namespace Office { */ notificationMessages: Office.NotificationMessages; /** - * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * Read and compose modes for appointment items. Read mode for meeting request items. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. + * `undefined` is returned for messages that are not meeting requests. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment + * and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -11659,11 +12577,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -11693,7 +12616,8 @@ declare namespace Office { */ subject: Subject; /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the + * current item. * * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. * @@ -11735,8 +12659,12 @@ declare namespace Office { * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * inInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the + * attachment list. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.asyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -11800,7 +12728,10 @@ declare namespace Office { * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** @@ -11821,10 +12752,12 @@ declare namespace Office { * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -11832,7 +12765,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -11843,8 +12777,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -11852,11 +12788,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -11879,17 +12819,24 @@ 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 AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -11907,11 +12854,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -11931,11 +12882,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -11948,17 +12903,22 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * - * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client prompts the user to save, discard, or close the action. + * The behaviors of the close method depends on the current state of the item being composed. + * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. * - * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, discard, or cancel even if no changes have occurred since the item was last saved. + * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, + * discard, or cancel even if no changes have occurred since the item was last saved. * * [Api set: Mailbox 1.3] * @@ -11972,7 +12932,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is activated by an actionable message. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -11986,9 +12947,11 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -11996,9 +12959,11 @@ declare namespace Office { /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.0] * @@ -12011,16 +12976,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.0] * @@ -12033,18 +13002,24 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -12054,14 +13029,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12084,13 +13065,19 @@ 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 AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12108,7 +13095,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12128,7 +13119,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12141,13 +13136,16 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -12162,10 +13160,12 @@ declare namespace Office { * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -12173,7 +13173,8 @@ declare namespace Office { /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -12184,8 +13185,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -12193,11 +13196,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12225,17 +13234,25 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12258,11 +13275,16 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12287,11 +13309,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12309,13 +13337,17 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12335,17 +13367,27 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12357,13 +13399,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. */ setSelectedDataAsync(data: string): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12375,16 +13420,24 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12396,15 +13449,19 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type{@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The message read mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface MessageRead extends Message, ItemRead { /** @@ -12418,7 +13475,9 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. + * For more information, see + * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ attachments: Office.AttachmentDetails[]; @@ -12435,9 +13494,11 @@ declare namespace Office { */ body: Office.Body; /** - * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the + * current item. * - * The cc property returns an array that contains an EmailAddressDetails object for each recipient listed on the Cc line of the message. The collection is limited to a maximum of 100 members. + * The cc property returns an array that contains an EmailAddressDetails object for each recipient listed on the Cc line of the message. + * The collection is limited to a maximum of 100 members. * * [Api set: Mailbox 1.0] * @@ -12451,9 +13512,12 @@ declare namespace Office { /** * Gets an identifier for the email conversation that contains a particular message. * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. + * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change + * and that value you obtained earlier will no longer apply. * - * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * You get null for this property for a new item in a compose form. + * If the user sets a subject and saves the item, the conversationId property will return a value. * * [Api set: Mailbox 1.0] * @@ -12493,7 +13557,8 @@ declare namespace Office { /** * Gets the email address of the sender of a message. * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * The from and sender properties represent the same person unless the message is sent by a delegate. + * In that case, the from property represents the delegator, and the sender property represents the delegate. * * Note: The recipientType property of the EmailAddressDetails object in the from property is undefined. * @@ -12523,7 +13588,8 @@ declare namespace Office { /** * Gets the Exchange Web Services item class of the selected item. * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class IPM.Appointment.Contoso. + * You can create custom message classes that extends a default message class, for example, a custom appointment message class + * IPM.Appointment.Contoso. * * [Api set: Mailbox 1.0] * @@ -12533,7 +13599,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. + * The itemClass property specifies the message class of the selected item. + * The following are the default message classes for the message or appointment item. * * * @@ -12558,9 +13625,14 @@ declare namespace Office { /** * Gets the Exchange Web Services item identifier for the current item. * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * The itemId property is not available in compose mode. + * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier + * in the AsyncResult.value parameter in the callback function. * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. + * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * [Api set: Mailbox 1.0] * @@ -12574,7 +13646,8 @@ declare namespace Office { /** * Gets the type of item that an instance represents. * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or + * an appointment. * * [Api set: Mailbox 1.0] * @@ -12588,7 +13661,9 @@ declare namespace Office { /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by + * email programs. + * To get the subject of the item with the prefixes intact, use the subject property. * * [Api set: Mailbox 1.0] * @@ -12612,13 +13687,17 @@ declare namespace Office { */ notificationMessages: Office.NotificationMessages; /** - * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * Read and compose modes for appointment items. Read mode for meeting request items. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. + * `undefined` is returned for messages that are not meeting requests. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment + * and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -12634,11 +13713,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -12654,7 +13738,8 @@ declare namespace Office { /** * Gets the email address of the sender of an email message. * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * The from and sender properties represent the same person unless the message is sent by a delegate. + * In that case, the from property represents the delegator, and the sender property represents the delegate. * * Note: The recipientType property of the EmailAddressDetails object in the sender property is undefined. * @@ -12684,9 +13769,11 @@ declare namespace Office { */ subject: string; /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the + * current item. * - * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. + * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. + * The collection is limited to a maximum of 100 members. * * [Api set: Mailbox 1.0] * @@ -12701,7 +13788,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -12716,10 +13804,12 @@ declare namespace Office { * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -12728,7 +13818,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -12739,20 +13830,25 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. + * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the + * selected appointment. * * In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. * * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -12775,7 +13871,9 @@ declare namespace Office { * * If any of the string parameters exceed their limits, displayReplyForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -12793,9 +13891,11 @@ declare namespace Office { */ displayReplyForm(formData: string | ReplyFormData): void; /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. + * Gets initialization data passed when the add-in is + * {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -12811,17 +13911,21 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. + * Gets initialization data passed when the add-in is + * {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the + * web for Office 365. * * [Api set: Mailbox Preview] * @@ -12831,9 +13935,11 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ @@ -12862,7 +13968,9 @@ declare namespace Office { * @param entityType One of the EntityType enumeration values. * * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. If no entities of the specified type are present in the item's body, the method returns an empty array. Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. + * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. + * If no entities of the specified type are present in the item's body, the method returns an empty array. + * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks * @@ -12870,7 +13978,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * - * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. + * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the + * following table. * * * @@ -12919,7 +14028,8 @@ declare namespace Office { /** * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element in the manifest XML file with the specified FilterName element value. + * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element + * in the manifest XML file with the specified FilterName element value. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -12932,22 +14042,33 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. + * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, + * the method returns null. + * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, + * the method return an empty array. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.0] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -12959,9 +14080,12 @@ declare namespace Office { /** * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule element in the manifest XML file with the specified RegExName element value. + * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule + * element in the manifest XML file with the specified RegExName element value. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -12996,18 +14120,27 @@ declare namespace Office { */ getSelectedEntities(): Entities; /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. Highlighted matches apply to contextual add-ins. + * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. + * Highlighted matches apply to contextual add-ins. * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.6] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or + * the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -13019,9 +14152,13 @@ declare namespace Office { /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -13031,14 +14168,17 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -13053,10 +14193,12 @@ declare namespace Office { * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -13064,7 +14206,8 @@ declare namespace Office { /** * Removes an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the + * recurrence pattern of a series. * * [Api set: Mailbox Preview] * @@ -13075,8 +14218,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ @@ -13142,11 +14287,13 @@ declare namespace Office { /** * Gets the location of an appointment. * - * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. The location of the appointment is provided as a string in the asyncResult.value property. + * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. + * The location of the appointment is provided as a string in the asyncResult.value property. * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.1] * @@ -13164,9 +14311,11 @@ declare namespace Office { /** * Gets the location of an appointment. * - * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. The location of the appointment is provided as a string in the asyncResult.value property. + * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. + * The location of the appointment is provided as a string in the asyncResult.value property. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.1] * @@ -13179,12 +14328,14 @@ declare namespace Office { /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -13207,7 +14358,8 @@ declare namespace Office { /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. * @@ -13224,7 +14376,8 @@ declare namespace Office { /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. @@ -13243,10 +14396,12 @@ declare namespace Office { /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -13283,11 +14438,18 @@ declare namespace Office { * * Contains the following members: * - * - hostName (string): A string that represents the name of the host application. It be one of the following values: Outlook, Mac Outlook, OutlookIOS, or OutlookWebApp. + * - hostName (string): A string that represents the name of the host application. + * It be one of the following values: Outlook, Mac Outlook, OutlookIOS, or OutlookWebApp. * - * - hostVersion (string): A string that represents the version of either the host application or the Exchange Server. If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the host application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. + * - hostVersion (string): A string that represents the version of either the host application or the Exchange Server. + * If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the + * host application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. * - * - OWAView (MailboxEnums.OWAView or string): An enum (or string literal) that represents the current view of Outlook Web App. If the host application is not Outlook Web App, then accessing this property results in undefined. Outlook Web App has three views (OneColumn - displayed when the screen is narrow, TwoColumns - displayed when the screen is wider, and ThreeColumns - displayed when the screen is wide) that correspond to the width of the screen and the window, and the number of columns that can be displayed. + * - OWAView (MailboxEnums.OWAView or string): An enum (or string literal) that represents the current view of Outlook Web App. + * If the host application is not Outlook Web App, then accessing this property results in undefined. + * Outlook Web App has three views (OneColumn - displayed when the screen is narrow, TwoColumns - displayed when the screen is wider, + * and ThreeColumns - displayed when the screen is wide) that correspond to the width of the screen and the window, and the number of columns + * that can be displayed. * * More information is under {@link Office.Diagnostics}. * @@ -13304,7 +14466,8 @@ declare namespace Office { * * Your app must have the ReadItem permission specified in its manifest to call the ewsUrl member in read mode. * - * In compose mode you must call the saveAsync method before you can use the ewsUrl member. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method before you can use the ewsUrl member. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.0] * @@ -13330,7 +14493,8 @@ declare namespace Office { * * Your app must have the ReadItem permission specified in its manifest to call the restUrl member in read mode. * - * In compose mode you must call the saveAsync method before you can use the restUrl member. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method before you can use the restUrl member. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.5] * @@ -13352,7 +14516,9 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.ItemChanged, which is invoked when the user selects a new item. This event is used by add-ins that implement a pinnable taskpane, and allows the add-in to refresh the taskpane UI based on the currently selected item. + * Currently the only supported event type is Office.EventType.ItemChanged, which is invoked when the user selects a new item. + * This event is used by add-ins that implement a pinnable taskpane, and allows the add-in to refresh the taskpane UI based on the currently + * selected item. * * [Api set: Mailbox 1.5] * @@ -13363,15 +14529,18 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * - * Item IDs retrieved via a REST API (such as the Outlook Mail API or the Microsoft Graph) use a different format than the format used by Exchange Web Services (EWS). The convertToEwsId method converts a REST-formatted ID into the proper format for EWS. + * Item IDs retrieved via a REST API (such as the Outlook Mail API or the Microsoft Graph) use a different format than the format used by + * Exchange Web Services (EWS). The convertToEwsId method converts a REST-formatted ID into the proper format for EWS. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13390,9 +14559,15 @@ declare namespace Office { /** * Gets a dictionary containing time information in local client time. * - * The dates and times used by a mail app for Outlook or Outlook Web App can use different time zones. Outlook uses the client computer time zone; Outlook Web App uses the time zone set on the Exchange Admin Center (EAC). You should handle date and time values so that the values you display on the user interface are always consistent with the time zone that the user expects. + * The dates and times used by a mail app for Outlook or Outlook Web App can use different time zones. + * Outlook uses the client computer time zone; Outlook Web App uses the time zone set on the Exchange Admin Center (EAC). + * You should handle date and time values so that the values you display on the user interface are always consistent with the time zone that + * the user expects. * - * If the mail app is running in Outlook, the convertToLocalClientTime method will return a dictionary object with the values set to the client computer time zone. If the mail app is running in Outlook Web App, the convertToLocalClientTime method will return a dictionary object with the values set to the time zone specified in the EAC. + * If the mail app is running in Outlook, the convertToLocalClientTime method will return a dictionary object with the values set to the + * client computer time zone. + * If the mail app is running in Outlook Web App, the convertToLocalClientTime method will return a dictionary object with the values set to + * the time zone specified in the EAC. * * [Api set: Mailbox 1.0] * @@ -13418,7 +14593,9 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the {@link https://msdn.microsoft.com/office/office365/APi/mail-rest-operations | Outlook Mail API} or the {@link http://graph.microsoft.io/ | Microsoft Graph}. The convertToRestId method converts an EWS-formatted ID into the proper format for REST. + * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the + * {@link https://msdn.microsoft.com/office/office365/APi/mail-rest-operations | Outlook Mail API} or the {@link http://graph.microsoft.io/ | Microsoft Graph}. + * The convertToRestId method converts an EWS-formatted ID into the proper format for REST. * * @param itemId An item ID formatted for Exchange Web Services (EWS) * @param restVersion A value indicating the version of the Outlook REST API that the converted ID will be used with. @@ -13427,7 +14604,8 @@ declare namespace Office { /** * Gets a Date object from a dictionary containing time information. * - * The convertToUtcClientTime method converts a dictionary containing a local date and time to a Date object with the correct values for the local date and time. + * The convertToUtcClientTime method converts a dictionary containing a local date and time to a Date object with the correct values for the + * local date and time. * * [Api set: Mailbox 1.0] * @@ -13444,13 +14622,17 @@ declare namespace Office { /** * Displays an existing calendar appointment. * - * The displayAppointmentForm method opens an existing calendar appointment in a new window on the desktop or in a dialog box on mobile devices. + * The displayAppointmentForm method opens an existing calendar appointment in a new window on the desktop or in a dialog box on + * mobile devices. * - * In Outlook for Mac, you can use this method to display a single appointment that is not part of a recurring series, or the master appointment of a recurring series, but you cannot display an instance of the series. This is because in Outlook for Mac, you cannot access the properties (including the item ID) of instances of a recurring series. + * In Outlook for Mac, you can use this method to display a single appointment that is not part of a recurring series, or the + * master appointment of a recurring series, but you cannot display an instance of the series. + * This is because in Outlook for Mac, you cannot access the properties (including the item ID) of instances of a recurring series. * * In Outlook Web App, this method opens the specified form only if the body of the form is less than or equal to 32KB number of characters. * - * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and no error message will be returned. + * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and + * no error message will be returned. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13472,9 +14654,11 @@ declare namespace Office { * * In Outlook Web App, this method opens the specified form only if the body of the form is less than or equal to 32 KB number of characters. * - * If the specified item identifier does not identify an existing message, no message will be displayed on the client computer, and no error message will be returned. + * If the specified item identifier does not identify an existing message, no message will be displayed on the client computer, and + * no error message will be returned. * - * Do not use the displayMessageForm with an itemId that represents an appointment. Use the displayAppointmentForm method to display an existing appointment, and displayNewAppointmentForm to display a form to create a new appointment. + * Do not use the displayMessageForm with an itemId that represents an appointment. Use the displayAppointmentForm method to display + * an existing appointment, and displayNewAppointmentForm to display a form to create a new appointment. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13492,11 +14676,16 @@ declare namespace Office { /** * Displays a form for creating a new calendar appointment. * - * The displayNewAppointmentForm method opens a form that enables the user to create a new appointment or meeting. If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. + * The displayNewAppointmentForm method opens a form that enables the user to create a new appointment or meeting. + * If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. * - * In Outlook Web App and OWA for Devices, this method always displays a form with an attendees field. If you do not specify any attendees as input arguments, the method displays a form with a Save button. If you have specified attendees, the form would include the attendees and a Send button. + * In Outlook Web App and OWA for Devices, this method always displays a form with an attendees field. + * If you do not specify any attendees as input arguments, the method displays a form with a Save button. + * If you have specified attendees, the form would include the attendees and a Send button. * - * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the requiredAttendees, optionalAttendees, or resources parameter, this method displays a meeting form with a Send button. If you don't specify any recipients, this method displays an appointment form with a Save & Close button. + * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the requiredAttendees, optionalAttendees, or + * resources parameter, this method displays a meeting form with a Send button. + * If you don't specify any recipients, this method displays an appointment form with a Save & Close button. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * @@ -13516,7 +14705,8 @@ declare namespace Office { /** * Displays a form for creating a new message. * - * The displayNewMessageForm method opens a form that enables the user to create a new message. If parameters are specified, the message form fields are automatically populated with the contents of the parameters. + * The displayNewMessageForm method opens a form that enables the user to create a new message. If parameters are specified, the message form + * fields are automatically populated with the contents of the parameters. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * @@ -13530,11 +14720,14 @@ declare namespace Office { * * @param parameters A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * - * toRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the To line. The array is limited to a maximum of 100 entries. + * toRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object + * for each of the recipients on the To line. The array is limited to a maximum of 100 entries. * - * ccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the Cc line. The array is limited to a maximum of 100 entries. + * ccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object + * for each of the recipients on the Cc line. The array is limited to a maximum of 100 entries. * - * bccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the Bcc line. The array is limited to a maximum of 100 entries. + * bccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object + * for each of the recipients on the Bcc line. The array is limited to a maximum of 100 entries. * * subject: A string containing the subject of the message. The string is limited to a maximum of 255 characters. * @@ -13548,25 +14741,33 @@ declare namespace Office { * * attachments.url: Only used if type is set to file. The URI of the location for the file. * - * attachments.isInline: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + * attachments.isInline: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the + * message body, and should not be displayed in the attachment list. * - * attachments.itemId: Only used if type is set to item. The EWS item id of the existing e-mail you want to attach to the new message. This is a string up to 100 characters. + * attachments.itemId: Only used if type is set to item. The EWS item id of the existing e-mail you want to attach to the new message. + * This is a string up to 100 characters. */ displayNewMessageForm(parameters: any): void; /** * Gets a string that contains a token used to call REST APIs or Exchange Web Services. * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. The lifetime of the callback token is 5 minutes. + * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. + * The lifetime of the callback token is 5 minutes. * * *REST Tokens* * - * When a REST token is requested (options.isRest = true), the resulting token will not work to authenticate Exchange Web Services calls. The token will be limited in scope to read-only access to the current item and its attachments, unless the add-in has specified the ReadWriteMailbox permission in its manifest. If the ReadWriteMailbox permission is specified, the resulting token will grant read/write access to mail, calendar, and contacts, including the ability to send mail. + * When a REST token is requested (options.isRest = true), the resulting token will not work to authenticate Exchange Web Services calls. + * The token will be limited in scope to read-only access to the current item and its attachments, unless the add-in has specified the + * ReadWriteMailbox permission in its manifest. + * If the ReadWriteMailbox permission is specified, the resulting token will grant read/write access to mail, calendar, and contacts, + * including the ability to send mail. * * The add-in should use the restUrl property to determine the correct URL to use when making REST API calls. * * *EWS Tokens* * - * When an EWS token is requested (options.isRest = false), the resulting token will not work to authenticate REST API calls. The token will be limited in scope to accessing the current item. + * When an EWS token is requested (options.isRest = false), the resulting token will not work to authenticate REST API calls. + * The token will be limited in scope to accessing the current item. * * The add-in should use the ewsUrl property to determine the correct URL to use when making EWS calls. * @@ -13589,19 +14790,24 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. */ getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. The lifetime of the callback token is 5 minutes. + * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. + * The lifetime of the callback token is 5 minutes. * - * You can pass the token and an attachment identifier or item identifier to a third-party system. The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. + * You can pass the token and an attachment identifier or item identifier to a third-party system. + * The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or + * GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. * * Your app must have the ReadItem permission specified in its manifest to call the getCallbackTokenAsync method in read mode. * - * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.5] * @@ -13611,19 +14817,24 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The token is provided as a string in the asyncResult.value property. */ getCallbackTokenAsync(callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. The lifetime of the callback token is 5 minutes. + * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. + * The lifetime of the callback token is 5 minutes. * - * You can pass the token and an attachment identifier or item identifier to a third-party system. The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. + * You can pass the token and an attachment identifier or item identifier to a third-party system. + * The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or + * GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. * * Your app must have the ReadItem permission specified in its manifest to call the getCallbackTokenAsync method in read mode. * - * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.3] * @@ -13633,7 +14844,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; @@ -13650,9 +14862,11 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * - * The getUserIdentityTokenAsync method returns a token that you can use to identify and {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. + * The getUserIdentityTokenAsync method returns a token that you can use to identify and + * {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * @param userContext Optional. Any state data that is passed to the asynchronous method.| */ getUserIdentityTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; @@ -13667,21 +14881,32 @@ declare namespace Office { * * The XML request must specify UTF-8 encoding. * - * Your add-in must have the ReadWriteMailbox permission to use the makeEwsRequestAsync method. For information about using the ReadWriteMailbox permission and the EWS operations that you can call with the makeEwsRequestAsync method, see Specify permissions for mail add-in access to the user's mailbox. + * Your add-in must have the ReadWriteMailbox permission to use the makeEwsRequestAsync method. + * For information about using the ReadWriteMailbox permission and the EWS operations that you can call with the makeEwsRequestAsync method, + * see {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Specify permissions for mail add-in access to the user's mailbox}. * - * The XML result of the EWS call is provided as a string in the asyncResult.value property. If the result exceeds 1 MB in size, an error message is returned instead. + * The XML result of the EWS call is provided as a string in the asyncResult.value property. + * If the result exceeds 1 MB in size, an error message is returned instead. * - * Note: This method is not supported in the following scenarios. - In Outlook for iOS or Outlook for Android - When the add-in is loaded in a Gmail mailbox + * Note: This method is not supported in the following scenarios: + * + * - In Outlook for iOS or Outlook for Android. + * + * - When the add-in is loaded in a Gmail mailbox. * - * Note: The server administrator must set OAuthAuthentication to true on the Client Access Server EWS directory to enable the makeEwsRequestAsync method to make EWS requests. + * Note: The server administrator must set OAuthAuthentication to true on the Client Access Server EWS directory to enable the + * makeEwsRequestAsync method to make EWS requests. * * *Version differences* * - * When you use the makeEwsRequestAsync method in mail apps running in Outlook versions earlier than version 15.0.4535.1004, you should set the encoding value to ISO-8859-1. + * When you use the makeEwsRequestAsync method in mail apps running in Outlook versions earlier than version 15.0.4535.1004, you should set + * the encoding value to ISO-8859-1. * * `` * - * You do not need to set the encoding value when your mail app is running in Outlook on the web. You can determine whether your mail app is running in Outlook or Outlook on the web by using the mailbox.diagnostics.hostName property. You can determine what version of Outlook is running by using the mailbox.diagnostics.hostVersion property. + * You do not need to set the encoding value when your mail app is running in Outlook on the web. + * You can determine whether your mail app is running in Outlook or Outlook on the web by using the mailbox.diagnostics.hostName property. + * You can determine what version of Outlook is running by using the mailbox.diagnostics.hostVersion property. * * [Api set: Mailbox 1.0] * @@ -13692,7 +14917,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param data The EWS request. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ makeEwsRequestAsync(data: any, callback: (result: AsyncResult) => void, userContext?: any): void; @@ -13701,9 +14927,12 @@ declare namespace Office { /** * Represents a suggested meeting found in an item. Read mode only. * - * The list of meetings suggested in an email message is returned in the meetingSuggestions property of the Entities object that is returned when the getEntities or getEntitiesByType method is called on the active item. + * The list of meetings suggested in an email message is returned in the meetingSuggestions property of the Entities object that is returned when + * the getEntities or getEntitiesByType method is called on the active item. * - * The start and end values are string representations of a Date object that contains the date and time at which the suggested meeting is to begin and end. The values are in the default time zone specified for the current user. + * The start and end values are string representations of a Date object that contains the date and time at which the suggested meeting is to + * begin and end. + * The values are in the default time zone specified for the current user. * * [Api set: Mailbox 1.0] * @@ -13754,19 +14983,27 @@ declare namespace Office { */ key?: string; /** - * Specifies the ItemNotificationMessageType of message. If type is ProgressIndicator or ErrorMessage, an icon is automatically supplied and the message is not persistent. Therefore the icon and persistent properties are not valid for these types of messages. Including them will result in an ArgumentException. If type is ProgressIndicator, the developer should remove or replace the progress indicator when the action is complete. + * Specifies the ItemNotificationMessageType of message. If type is ProgressIndicator or ErrorMessage, an icon is automatically supplied and + * the message is not persistent. Therefore the icon and persistent properties are not valid for these types of messages. + * Including them will result in an ArgumentException. + * If type is ProgressIndicator, the developer should remove or replace the progress indicator when the action is complete. */ type: Office.MailboxEnums.ItemNotificationMessageType; /** - * A reference to an icon that is defined in the manifest in the Resources section. It appears in the infobar area. It is only applicable if the type is InformationalMessage. Specifying this parameter for an unsupported type results in an exception. + * A reference to an icon that is defined in the manifest in the Resources section. It appears in the infobar area. + * It is only applicable if the type is InformationalMessage. Specifying this parameter for an unsupported type results in an exception. */ icon?: string; /** - * The text of the notification message. Maximum length is 150 characters. If the developer passes in a longer string, an ArgumentOutOfRange exception is thrown. + * The text of the notification message. Maximum length is 150 characters. + * If the developer passes in a longer string, an ArgumentOutOfRange exception is thrown. */ message: string; /** - * Only applicable when type is InformationalMessage. If true, the message remains until removed by this add-in or dismissed by the user. If false, it is removed when the user navigates to a different item. For error notifications, the message persists until the user sees it once. Specifying this parameter for an unsupported type throws an exception. + * Only applicable when type is InformationalMessage. If true, the message remains until removed by this add-in or dismissed by the user. + * If false, it is removed when the user navigates to a different item. + * For error notifications, the message persists until the user sees it once. + * Specifying this parameter for an unsupported type throws an exception. */ persistent?: Boolean; } @@ -13786,11 +15023,14 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. + * @param key A developer-specified key used to reference this notification message. + * Developers can use it to modify this message later. It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.3] * @@ -13814,8 +15054,10 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. + * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. + * It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. * * [Api set: Mailbox 1.3] * @@ -13830,8 +15072,10 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. + * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. + * It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @@ -13848,9 +15092,12 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. + * It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.3] * @@ -13876,7 +15123,8 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @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}. */ getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -13889,7 +15137,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getAllAsync(callback: (result: AsyncResult) => void): void; /** @@ -13913,7 +15162,8 @@ declare namespace Office { * @param key The key for the notification message to remove. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -13955,7 +15205,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to remove. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ removeAsync(key: string, callback: (result: AsyncResult) => void): void; /** @@ -13979,10 +15230,12 @@ declare namespace Office { * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -13998,7 +15251,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void; /** @@ -14014,7 +15268,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ @@ -14032,15 +15287,18 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; } /** * Represents a phone number identified in an item. Read mode only. * - * An array of PhoneNumber objects containing the phone numbers found in an email message is returned in the phoneNumbers property of the Entities object that is returned when you call the getEntities method on the selected item. + * An array of PhoneNumber objects containing the phone numbers found in an email message is returned in the phoneNumbers property of the + * Entities object that is returned when you call the getEntities method on the selected item. * * [Api set: Mailbox 1.0] * @@ -14103,7 +15361,8 @@ declare namespace Office { * @param recipients The recipients to add to the recipients list. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. */ addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -14175,7 +15434,8 @@ declare namespace Office { * ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries. * * @param recipients The recipients to add to the recipients list. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. */ addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; /** @@ -14196,7 +15456,8 @@ 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 AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** @@ -14211,7 +15472,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getAsync(callback: (result: AsyncResult) => void): void; /** @@ -14247,7 +15509,10 @@ declare namespace Office { * @param recipients The recipients to add to the recipients list. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred while adding the data. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred + * while adding the data. */ setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -14325,14 +15590,19 @@ declare namespace Office { * ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries. * * @param recipients The recipients to add to the recipients list. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred while adding the data. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred + * while adding the data. */ setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; } /** - * The recurrence object provides methods to get and set the recurrence pattern of appointments but only get the recurrence pattern of meeting requests. It will have a dictionary with the following keys: seriesTime, recurrenceType, recurrenceProperties, and recurrenceTimeZone (optional). + * The recurrence object provides methods to get and set the recurrence pattern of appointments but only get the recurrence pattern of + * meeting requests. + * It will have a dictionary with the following keys: seriesTime, recurrenceType, recurrenceProperties, and recurrenceTimeZone (optional). * * [Api set: Mailbox Preview] * @@ -14424,7 +15694,9 @@ declare namespace Office { recurrenceType: Office.MailboxEnums.RecurrenceType; /** - * The {@link Office.SeriesTime} object enables you to manage the start and end dates of the recurring appointment series and the usual start and end times of instances. **This object is not in UTC time.** Instead, it is set in the time zone specified by the recurrenceTimeZone value or defaulted to the item's time zone. + * The {@link Office.SeriesTime} object enables you to manage the start and end dates of the recurring appointment series and the usual start + * and end times of instances. **This object is not in UTC time.** + * Instead, it is set in the time zone specified by the recurrenceTimeZone value or defaulted to the item's time zone. * * [Api set: Mailbox Preview] * @@ -14455,7 +15727,8 @@ 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 AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -14472,7 +15745,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ getAsync(callback?: (result: AsyncResult) => void): void; @@ -14498,7 +15772,8 @@ declare namespace Office { * @param recurrencePattern A recurrence object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; @@ -14518,7 +15793,8 @@ declare namespace Office { * ErrorsInvalidEndTime - The appointment end time is before its start time. * * @param recurrencePattern A recurrence object. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void; } @@ -14562,7 +15838,8 @@ declare namespace Office { */ month: Office.MailboxEnums.Month; /** - * Represents your chosen first day of the week otherwise the default is the value in the current user's settings. Valid values are: 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', and 'Sun'. + * Represents your chosen first day of the week otherwise the default is the value in the current user's settings. + * Valid values are: 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', and 'Sun'. */ firstDayOfWeek: Office.MailboxEnums.Days; } @@ -14584,7 +15861,8 @@ declare namespace Office { */ url?: string; /** - * Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + * Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be + * displayed in the attachment list. */ inLine?: boolean; /** @@ -14606,20 +15884,27 @@ declare namespace Office { */ attachments?: ReplyFormAttachment[]; /** - * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ callback?: (result: AsyncResult) => void; } /** - * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. That is, they are available only to the add-in that created them, and only from the user's mail box in which they are saved. + * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. + * That is, they are available only to the add-in that created them, and only from the user's mail box in which they are saved. * - * While the Outlook Add-in API limits access to these settings to only the add-in that created them, these settings should not be considered secure storage. They can be accessed by Exchange Web Services or Extended MAPI. They should not be used to store sensitive information such as user credentials or security tokens. + * While the Outlook Add-in API limits access to these settings to only the add-in that created them, these settings should not be considered + * secure storage. They can be accessed by Exchange Web Services or Extended MAPI. + * They should not be used to store sensitive information such as user credentials or security tokens. * * The name of a setting is a String, while the value can be a String, Number, Boolean, null, Object, or Array. * * The RoamingSettings object is accessible via the roamingSettings property in the Office.context namespace. * - * Important: The RoamingSettings object is initialized from the persisted storage only when the add-in is first loaded. For task panes, this means that it is only initialized when the task pane first opens. If the task pane navigates to another page or reloads the current page, the in-memory object is reset to its initial values, even if your add-in has persisted changes. The persisted changes will not be available until the task pane is closed and reopened. + * Important: The RoamingSettings object is initialized from the persisted storage only when the add-in is first loaded. + * For task panes, this means that it is only initialized when the task pane first opens. + * If the task pane navigates to another page or reloads the current page, the in-memory object is reset to its initial values, even if + * your add-in has persisted changes. The persisted changes will not be available until the task pane is closed and reopened. * * [Api set: Mailbox 1.0] * @@ -14659,7 +15944,9 @@ declare namespace Office { /** * Saves the settings. * - * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the set and get methods to work with the in-memory copy of the settings property bag. When you want to persist the settings so that they are available the next time the add-in is used, use the saveAsync method. + * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use + * the set and get methods to work with the in-memory copy of the settings property bag. + * When you want to persist the settings so that they are available the next time the add-in is used, use the saveAsync method. * * [Api set: Mailbox 1.0] * @@ -14668,13 +15955,15 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional? When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ saveAsync(callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * - * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name. The value is stored in the document as the serialized JSON representation of its data type. + * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name. + * The value is stored in the document as the serialized JSON representation of its data type. * * A maximum of 2MB is available for the settings of each add-in, and each individual setting is limited to 32KB. * @@ -14694,7 +15983,8 @@ declare namespace Office { } /** - * The SeriesTime object provides methods to get and set the dates and times of appointments in a recurring series and get the dates and times of meeting requests in a recurring series. + * The SeriesTime object provides methods to get and set the dates and times of appointments in a recurring series and get the dates and times of + * meeting requests in a recurring series. * * [Api set: Mailbox Preview] * @@ -14731,7 +16021,9 @@ declare namespace Office { getEndDate(): string; /** - * Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm" + * Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or + * add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: + * "THH:mm:ss:mmm" * * [Api set: Mailbox Preview] * @@ -14755,7 +16047,8 @@ declare namespace Office { getStartDate(): string; /** - * Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm" + * Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the + * recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm" * * [Api set: Mailbox Preview] * @@ -14794,7 +16087,8 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `setEndDate(date: string): void;` (Where date is the end date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). + * `setEndDate(date: string): void;` (Where date is the end date of the recurring appointment series represented in the + * {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). * * @param year The year value of the end date. * @param month The month value of the end date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month. @@ -14855,7 +16149,8 @@ declare namespace Office { setStartDate(date:string): void; /** - * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default). + * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set + * (the item's time zone is used by default). * * [Api set: Mailbox Preview] * @@ -14876,7 +16171,8 @@ declare namespace Office { setStartTime(hours: number, minutes: number): void; /** - * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default). + * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set + * (the item's time zone is used by default). * * [Api set: Mailbox Preview] * @@ -14921,7 +16217,8 @@ 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 AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** @@ -14941,7 +16238,8 @@ declare namespace Office { /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -14963,13 +16261,15 @@ declare namespace Office { * @param subject The subject of the appointment or message. The string is limited to 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. */ setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -14986,7 +16286,8 @@ declare namespace Office { /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -15005,7 +16306,8 @@ declare namespace Office { /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -15017,7 +16319,8 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters. * * @param subject The subject of the appointment or message. The string is limited to 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. */ setAsync(data: string, callback: (result: AsyncResult) => void): void; @@ -15025,7 +16328,8 @@ declare namespace Office { /** * Represents a suggested task identified in an item. Read mode only. * - * The list of tasks suggested in an email message is returned in the taskSuggestions property of the [Entities]Entities object that is returned when the getEntities or getEntitiesByType method is called on the active item. + * The list of tasks suggested in an email message is returned in the taskSuggestions property of the {@link Office.Entities | Entities} object + * that is returned when the getEntities or getEntitiesByType method is called on the active item. * * [Api set: Mailbox 1.0] * @@ -15058,7 +16362,8 @@ declare namespace Office { /** * Gets the start or end time of an appointment. * - * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). You can convert the UTC time to the local client time by using the convertToLocalClientTime method. + * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). + * You can convert the UTC time to the local client time by using the convertToLocalClientTime method. * * [Api set: Mailbox 1.1] * @@ -15079,7 +16384,8 @@ declare namespace Office { /** * Gets the start or end time of an appointment. * - * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). You can convert the UTC time to the local client time by using the convertToLocalClientTime method. + * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). + * You can convert the UTC time to the local client time by using the convertToLocalClientTime method. * * [Api set: Mailbox 1.1] * @@ -15094,7 +16400,8 @@ declare namespace Office { /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15118,13 +16425,16 @@ declare namespace Office { * @param dateTime A date-time object in Coordinated Universal Time (UTC). * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the date and time fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the date and time fails, the asyncResult.error property will contain an error code. */ setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15143,7 +16453,8 @@ declare namespace Office { /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15164,7 +16475,8 @@ declare namespace Office { /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15178,7 +16490,9 @@ declare namespace Office { * ErrorsInvalidEndTime - The appointment end time is before the appointment start time. * * @param dateTime A date-time object in Coordinated Universal Time (UTC). - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the date and time fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the date and time fails, the asyncResult.error property will contain an error code. */ setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; @@ -15286,23 +16600,27 @@ declare namespace Office { declare namespace OfficeExtension { /** An abstract proxy object that represents an object in an Office document. - * You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the proxy object state with the document by calling `context.sync()`. + * You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the + * proxy object state with the document by calling `context.sync()`. */ class ClientObject { /** The request context associated with the object */ context: ClientRequestContext; - /** Returns a boolean value for whether the corresponding object is a null object. You must call `context.sync()` before reading the isNullObject property. */ + /** Returns a boolean value for whether the corresponding object is a null object. You must call `context.sync()` before reading the + * isNullObject property. */ isNullObject: boolean; } } declare namespace OfficeExtension { /** - * Specifies which properties of an object should be loaded. This load happens when the sync() method is executed. This synchronizes the states between Office objects and corresponding JavaScript proxy objects. + * Specifies which properties of an object should be loaded. This load happens when the sync() method is executed. + * This synchronizes the states between Office objects and corresponding JavaScript proxy objects. * * @remarks * - * For Word, the preferred method for specifying the properties and paging information is by using a string literal. The first two examples show the preferred way to request the text and font size properties for paragraphs in a paragraph collection: + * For Word, the preferred method for specifying the properties and paging information is by using a string literal. + * The first two examples show the preferred way to request the text and font size properties for paragraphs in a paragraph collection: * * `context.load(paragraphs, 'text, font/size');` * @@ -15314,7 +16632,8 @@ declare namespace OfficeExtension { * * `paragraphs.load({select: 'text, font/size', expand: 'font', top: 50, skip: 0});` * - * Note that if we don't specify the specific properties on the font object in the select statement, the expand statement by itself would indicate that all of the font properties are loaded. + * Note that if we don't specify the specific properties on the font object in the select statement, the expand statement by itself would + * indicate that all of the font properties are loaded. */ interface LoadOption { /** @@ -15330,7 +16649,8 @@ declare namespace OfficeExtension { */ top?: number; /** - * Only usable on collection types. Specifies the number of items in the collection that are to be skipped and not included in the result. If top is specified, the result set will start after skipping the specified number of items. + * Only usable on collection types. Specifies the number of items in the collection that are to be skipped and not included in the result. + * If top is specified, the result set will start after skipping the specified number of items. */ skip?: number; } @@ -15354,7 +16674,9 @@ declare namespace OfficeExtension { session?: RequestUrlAndHeaderInfo | T; /** - * A previously-created context, or API object, or array of objects. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by `context.sync()`. + * A previously-created context, or API object, or array of objects. + * The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up + * by `context.sync()`. */ previousObjects?: ClientObject | ClientObject[] | ClientRequestContext; } @@ -15369,7 +16691,8 @@ declare namespace OfficeExtension { pendingStatements: string[]; } - /** An abstract RequestContext object that facilitates requests to the host Office application. The `Excel.run` and `Word.run` methods provide a request context. */ + /** An abstract RequestContext object that facilitates requests to the host Office application. + * The `Excel.run` and `Word.run` methods provide a request context. */ class ClientRequestContext { constructor(url?: string); @@ -15382,7 +16705,8 @@ declare namespace OfficeExtension { /** Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param object The object whose properties are loaded. - * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an {@link OfficeExtension.LoadOption} object. + * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an + * {@link OfficeExtension.LoadOption} object. */ load(object: ClientObject, option?: string | string[] | LoadOption): void; @@ -15392,15 +16716,20 @@ declare namespace OfficeExtension { * You must call `context.sync()` before reading the properties. * * @param object The object to be loaded. - * @param options The key-value pairing of load options for the types, such as `{ "Workbook": "worksheets,tables", "Worksheet": "tables", "Tables": "name" }` + * @param options The key-value pairing of load options for the types, such as + * `{ "Workbook": "worksheets,tables", "Worksheet": "tables", "Tables": "name" }` * @param maxDepth The maximum recursive depth. */ loadRecursive(object: ClientObject, options: { [typeName: string]: string | string[] | LoadOption }, maxDepth?: number): void; - /** Adds a trace message to the queue. If the promise returned by `context.sync()` is rejected due to an error, this adds a ".traceMessages" array to the OfficeExtension.Error object, containing all trace messages that were executed. These messages can help you monitor the program execution sequence and detect the cause of the error. */ + /** Adds a trace message to the queue. If the promise returned by `context.sync()` is rejected due to an error, this adds a ".traceMessages" + * array to the OfficeExtension.Error object, containing all trace messages that were executed. + * These messages can help you monitor the program execution sequence and detect the cause of the error. */ trace(message: string): void; - /** Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context and retrieving properties of loaded Office objects for use in your code. This method returns a promise, which is resolved when the synchronization is complete. */ + /** Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context + * and retrieving properties of loaded Office objects for use in your code. + * This method returns a promise, which is resolved when the synchronization is complete. */ sync(passThroughValue?: T): Promise; /** Debug information */ @@ -15436,10 +16765,13 @@ declare namespace OfficeExtension { /** * Determines whether to log additional error information upon failure. * - * When this property is set to true, the error object will include a "debugInfo.fullStatements" property that lists all statements in the batch request, including all statements that precede and follow the point of failure. + * When this property is set to true, the error object will include a "debugInfo.fullStatements" property that lists all statements in the + * batch request, including all statements that precede and follow the point of failure. * - * Setting this property to true will negatively impact performance and will log all statements in the batch request, including any statements that may contain potentially-sensitive data. - * It is recommended that you only set this property to true during debugging and that you never log the value of error.debugInfo.fullStatements to an external database or analytics service. + * Setting this property to true will negatively impact performance and will log all statements in the batch request, including any statements + * that may contain potentially-sensitive data. + * It is recommended that you only set this property to true during debugging and that you never log the value of + * error.debugInfo.fullStatements to an external database or analytics service. */ extendedErrorLogging: boolean; }; @@ -15458,13 +16790,15 @@ declare namespace OfficeExtension { /** * The statement that caused the error, if available. * - * This statement will never contain any potentially-sensitive data and may not match the code exactly as written, but will be a close approximation. + * This statement will never contain any potentially-sensitive data and may not match the code exactly as written, + * but will be a close approximation. */ statements?: string; /** * The statements that closely precede and follow the statement that caused the error, if available. * - * These statements will never contain any potentially-sensitive data and may not match the code exactly as written, but will be a close approximation. + * These statements will never contain any potentially-sensitive data and may not match the code exactly as written, + * but will be a close approximation. */ surroundingStatements?: string[]; /** @@ -15485,7 +16819,9 @@ declare namespace OfficeExtension { stack: string; /** Error code string, such as "InvalidArgument". */ code: string; - /** Trace messages (if any) that were added via a `context.trace()` invocation before calling `context.sync()`. If there was an error, this contains all trace messages that were executed before the error occurred. These messages can help you monitor the program execution sequence and detect the case of the error. */ + /** Trace messages (if any) that were added via a `context.trace()` invocation before calling `context.sync()`. + * If there was an error, this contains all trace messages that were executed before the error occurred. + * These messages can help you monitor the program execution sequence and detect the case of the error. */ traceMessages: Array; /** Debug info (useful for detailed logging of the error, i.e., via `JSON.stringify(...)`). */ debugInfo: DebugInfo; @@ -15512,7 +16848,11 @@ declare namespace OfficeExtension { } declare namespace OfficeExtension { - /** A Promise object that represents a deferred interaction with the host Office application. The publicly-consumable {@link Office.OfficeExtension.Promise} is available starting in ExcelApi 1.2 and WordApi 1.2. Promises can be chained via ".then", and errors can be caught via ".catch". Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. When a browser-provided native Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. */ + /** A Promise object that represents a deferred interaction with the host Office application. + * The publicly-consumable {@link Office.OfficeExtension.Promise} is available starting in ExcelApi 1.2 and WordApi 1.2. + * Promises can be chained via ".then", and errors can be caught via ".catch". + * Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. + * When a browser-provided native Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. */ const Promise: Office.IPromiseConstructor; type IPromise = Promise; } @@ -15521,24 +16861,34 @@ declare namespace OfficeExtension { /** Collection of tracked objects, contained within a request context. See "context.trackedObjects" for more information. */ class TrackedObjects { /** - * Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. + * Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. + * If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, + * and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object + * to the tracked object collection when the object was first created. * * This method also has the following signature: * * `add(objects: ClientObject[]): void;` Where objects is an array of objects to be tracked. */ add(object: ClientObject): void; - /** Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. */ + /** Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. + * If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, + * and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object + * to the tracked object collection when the object was first created. */ add(objects: ClientObject[]): void; /** - * Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call `context.sync()` before the memory release takes effect. + * Release the memory associated with an object that was previously added to this collection. + * Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. + * You will need to call `context.sync()` before the memory release takes effect. * * This method also has the following signature: * * `remove(objects: ClientObject[]): void;` Where objects is an array of objects to be removed. */ remove(object: ClientObject): void; - /** Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call `context.sync()` before the memory release takes effect. */ + /** Release the memory associated with an object that was previously added to this collection. + * Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. + * You will need to call `context.sync()` before the memory release takes effect. */ remove(objects: ClientObject[]): void; } } From 5a66920d260d6c9ad3cc77643bf18693d79756b6 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 17 Aug 2018 14:03:44 -0700 Subject: [PATCH 283/346] update based on feedback --- types/office-js/index.d.ts | 54 +++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 9d81b35902..520fa2e313 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -16599,15 +16599,18 @@ declare namespace Office { //////////////////////////////////////////////////////////////// declare namespace OfficeExtension { - /** An abstract proxy object that represents an object in an Office document. + /** + * An abstract proxy object that represents an object in an Office document. * You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the * proxy object state with the document by calling `context.sync()`. */ class ClientObject { /** The request context associated with the object */ context: ClientRequestContext; - /** Returns a boolean value for whether the corresponding object is a null object. You must call `context.sync()` before reading the - * isNullObject property. */ + /** + * Returns a boolean value for whether the corresponding object is a null object. You must call `context.sync()` before reading the + * isNullObject property. + */ isNullObject: boolean; } } @@ -16691,8 +16694,10 @@ declare namespace OfficeExtension { pendingStatements: string[]; } - /** An abstract RequestContext object that facilitates requests to the host Office application. - * The `Excel.run` and `Word.run` methods provide a request context. */ + /** + * An abstract RequestContext object that facilitates requests to the host Office application. + * The `Excel.run` and `Word.run` methods provide a request context. + */ class ClientRequestContext { constructor(url?: string); @@ -16702,7 +16707,8 @@ declare namespace OfficeExtension { /** Request headers */ requestHeaders: { [name: string]: string }; - /** Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param object The object whose properties are loaded. * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an @@ -16722,14 +16728,18 @@ declare namespace OfficeExtension { */ loadRecursive(object: ClientObject, options: { [typeName: string]: string | string[] | LoadOption }, maxDepth?: number): void; - /** Adds a trace message to the queue. If the promise returned by `context.sync()` is rejected due to an error, this adds a ".traceMessages" + /** + * Adds a trace message to the queue. If the promise returned by `context.sync()` is rejected due to an error, this adds a ".traceMessages" * array to the OfficeExtension.Error object, containing all trace messages that were executed. - * These messages can help you monitor the program execution sequence and detect the cause of the error. */ + * These messages can help you monitor the program execution sequence and detect the cause of the error. + */ trace(message: string): void; - /** Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context + /** + * Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context * and retrieving properties of loaded Office objects for use in your code. - * This method returns a promise, which is resolved when the synchronization is complete. */ + * This method returns a promise, which is resolved when the synchronization is complete. + */ sync(passThroughValue?: T): Promise; /** Debug information */ @@ -16819,9 +16829,11 @@ declare namespace OfficeExtension { stack: string; /** Error code string, such as "InvalidArgument". */ code: string; - /** Trace messages (if any) that were added via a `context.trace()` invocation before calling `context.sync()`. + /** + * Trace messages (if any) that were added via a `context.trace()` invocation before calling `context.sync()`. * If there was an error, this contains all trace messages that were executed before the error occurred. - * These messages can help you monitor the program execution sequence and detect the case of the error. */ + * These messages can help you monitor the program execution sequence and detect the case of the error. + */ traceMessages: Array; /** Debug info (useful for detailed logging of the error, i.e., via `JSON.stringify(...)`). */ debugInfo: DebugInfo; @@ -16848,11 +16860,13 @@ declare namespace OfficeExtension { } declare namespace OfficeExtension { - /** A Promise object that represents a deferred interaction with the host Office application. + /** + * A Promise object that represents a deferred interaction with the host Office application. * The publicly-consumable {@link Office.OfficeExtension.Promise} is available starting in ExcelApi 1.2 and WordApi 1.2. * Promises can be chained via ".then", and errors can be caught via ".catch". * Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. - * When a browser-provided native Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. */ + * When a browser-provided native Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. + */ const Promise: Office.IPromiseConstructor; type IPromise = Promise; } @@ -16871,10 +16885,12 @@ declare namespace OfficeExtension { * `add(objects: ClientObject[]): void;` Where objects is an array of objects to be tracked. */ add(object: ClientObject): void; - /** Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. + /** + * Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. * If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, * and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object - * to the tracked object collection when the object was first created. */ + * to the tracked object collection when the object was first created. + */ add(objects: ClientObject[]): void; /** * Release the memory associated with an object that was previously added to this collection. @@ -16886,9 +16902,11 @@ declare namespace OfficeExtension { * `remove(objects: ClientObject[]): void;` Where objects is an array of objects to be removed. */ remove(object: ClientObject): void; - /** Release the memory associated with an object that was previously added to this collection. + /** + * Release the memory associated with an object that was previously added to this collection. * Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. - * You will need to call `context.sync()` before the memory release takes effect. */ + * You will need to call `context.sync()` before the memory release takes effect. + */ remove(objects: ClientObject[]): void; } } From 1631657962d068279cef9338d566d842a7d0243d Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 17 Aug 2018 14:34:44 -0700 Subject: [PATCH 284/346] update based on feedback --- types/office-js/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index bde7558531..c840c1b7ea 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -8714,7 +8714,8 @@ declare namespace Office { } /** - * Provides a method to get the organizer value of an appointment in an Outlook add-in. + * Represents the appointment organizer, even if an alias or a delegate was used to create the appointment. + * This object provides a method to get the organizer value of an appointment in an Outlook add-in. * * [Api set: Mailbox Preview] * @@ -8861,9 +8862,9 @@ declare namespace Office { */ optionalAttendees: Recipients; /** - * Gets the email address of the organizer for the specified meeting. - * - * The organizer property returns an Organizer object that provides a method to get the organizer value. + * Gets the organizer for the specified meeting. + * + * The organizer property returns an {@link Office.Organizer | Organizer} object that provides a method to get the organizer value. * * [Api set: Mailbox Preview] * From b62cd17d4d4e328aeaa7485a7845ed65768fd589 Mon Sep 17 00:00:00 2001 From: Francis Gulotta Date: Fri, 17 Aug 2018 16:43:20 -0700 Subject: [PATCH 285/346] snappy: create typedefs --- types/snappy/index.d.ts | 24 ++++++++++++++++++++++++ types/snappy/snappy-tests.ts | 35 +++++++++++++++++++++++++++++++++++ types/snappy/tsconfig.json | 23 +++++++++++++++++++++++ types/snappy/tslint.json | 1 + 4 files changed, 83 insertions(+) create mode 100644 types/snappy/index.d.ts create mode 100644 types/snappy/snappy-tests.ts create mode 100644 types/snappy/tsconfig.json create mode 100644 types/snappy/tslint.json diff --git a/types/snappy/index.d.ts b/types/snappy/index.d.ts new file mode 100644 index 0000000000..c8d4606157 --- /dev/null +++ b/types/snappy/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for snappy 6.0 +// Project: https://github.com/kesla/node-snappy +// Definitions by: Francis Gulotta +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +export interface SnappyDecompressOpts { + asBuffer: boolean; +} + +export type bufferCallback = (err: Error | null, data: Buffer) => void; +export type bufferOrStringCallback = (err: Error | null, data: Buffer|string) => void; +export type booleanCallback = (err: Error | null, data: boolean) => void; + +export function compress(buffer: Buffer|string, callback: bufferCallback): void; +export function compressSync(buffer: Buffer|string): Buffer; + +export function uncompress(buffer: Buffer, callback: bufferCallback): void; +export function uncompress(buffer: Buffer, options: SnappyDecompressOpts, callback: bufferOrStringCallback): void; +export function uncompressSync(buffer: Buffer): Buffer; +export function uncompressSync(buffer: Buffer, options: SnappyDecompressOpts): Buffer|string; + +export function isValidCompressed(buffer: Buffer, callback: booleanCallback): void; +export function isValidCompressedSync(buffer: Buffer): boolean; diff --git a/types/snappy/snappy-tests.ts b/types/snappy/snappy-tests.ts new file mode 100644 index 0000000000..d44d9aee13 --- /dev/null +++ b/types/snappy/snappy-tests.ts @@ -0,0 +1,35 @@ +import * as snappy from 'snappy'; + +snappy.compress('beep boop', (err, compressed) => { + if (err) { + throw err; + } + console.log(compressed.slice(0, 1)); +}); + +const data = snappy.compressSync('beep boop'); +const otherData = snappy.compressSync(Buffer.from('beep boop')); +snappy.uncompress(data, (err, data) => { + if (err) { + throw err; + } + console.log(data.toString('UTF8')); +}); +snappy.uncompress(otherData, { asBuffer: false }, (err, original) => { + if (err) { + throw err; + } + console.log('the original String', original); +}); + +snappy.uncompressSync(data); +snappy.uncompressSync(data, { asBuffer: false }); +snappy.isValidCompressed(data, (err, valid) => { + if (err) { + throw err; + } + console.log(valid); +}); +if (snappy.isValidCompressedSync(data)) { + console.log('valid!'); +} diff --git a/types/snappy/tsconfig.json b/types/snappy/tsconfig.json new file mode 100644 index 0000000000..d9d466288e --- /dev/null +++ b/types/snappy/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "snappy-tests.ts" + ] +} diff --git a/types/snappy/tslint.json b/types/snappy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/snappy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From e8f1f9c33e9ab1adee85e1c17cf79f695516ae38 Mon Sep 17 00:00:00 2001 From: Ricky Kirkham Date: Fri, 17 Aug 2018 17:19:28 -0700 Subject: [PATCH 286/346] remove openBrowserWindow API from Office.js --- types/office-js/index.d.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index c840c1b7ea..1b6210283d 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1021,15 +1021,6 @@ declare namespace Office { * - Called from a module extension: No effect. */ closeContainer(): void; - /** - * For internal Microsoft use only. Do not call from your code. Opens a browser window and loads the specified URL. - * - * @remarks - *
Requirement setsOpenBrowserWindowAPI 1.1
- * - * @param url The full URL to be opened including protocol (e.g., https), and port number, if any. - */ - openBrowserWindow(url: string): void; } /** From 0d9b247b6ed97a94bb14dbb43535e04b14a8591d Mon Sep 17 00:00:00 2001 From: ChanRay Date: Fri, 17 Aug 2018 19:49:17 +0800 Subject: [PATCH 287/346] [fibjs] add types of fibjs 0.26.0 --- types/fibjs/declare/DgramSocket.d.ts | 2 +- types/fibjs/declare/Digest.d.ts | 16 +---- types/fibjs/declare/EventEmitter.d.ts | 34 ++++----- types/fibjs/declare/EventInfo.d.ts | 2 +- types/fibjs/declare/Handler.d.ts | 2 +- types/fibjs/declare/HandlerEx.d.ts | 2 +- types/fibjs/declare/HeapSnapshot.d.ts | 2 +- types/fibjs/declare/HttpClient.d.ts | 36 ++++++++-- types/fibjs/declare/HttpCollection.d.ts | 4 +- types/fibjs/declare/HttpCookie.d.ts | 4 +- types/fibjs/declare/HttpMessage.d.ts | 4 +- types/fibjs/declare/HttpResponse.d.ts | 4 +- types/fibjs/declare/HttpServer.d.ts | 2 +- types/fibjs/declare/LevelDB.d.ts | 2 +- types/fibjs/declare/LruCache.d.ts | 2 +- types/fibjs/declare/MongoCollection.d.ts | 28 ++++---- types/fibjs/declare/MongoCursor.d.ts | 6 +- types/fibjs/declare/MongoDB.d.ts | 4 +- types/fibjs/declare/PKey.d.ts | 6 +- types/fibjs/declare/Redis.d.ts | 12 ++-- types/fibjs/declare/RedisHash.d.ts | 2 +- types/fibjs/declare/RedisSortedSet.d.ts | 2 +- types/fibjs/declare/Routing.d.ts | 20 +++--- types/fibjs/declare/SandBox.d.ts | 90 ++++++++++++++++++++++-- types/fibjs/declare/Service.d.ts | 2 +- types/fibjs/declare/UrlObject.d.ts | 4 +- types/fibjs/declare/Worker.d.ts | 2 +- types/fibjs/declare/X509Req.d.ts | 2 +- types/fibjs/declare/bson.d.ts | 4 +- types/fibjs/declare/console.d.ts | 2 +- types/fibjs/declare/dgram.d.ts | 4 +- types/fibjs/declare/fs.d.ts | 21 ++++++ types/fibjs/declare/global.d.ts | 2 +- types/fibjs/declare/gui.d.ts | 2 +- types/fibjs/declare/http.d.ts | 40 ++++++++--- types/fibjs/declare/index.d.ts | 68 +++++++++--------- types/fibjs/declare/net.d.ts | 2 +- types/fibjs/declare/os.d.ts | 6 +- types/fibjs/declare/path.d.ts | 13 ++++ types/fibjs/declare/path_posix.d.ts | 13 ++++ types/fibjs/declare/path_win32.d.ts | 13 ++++ types/fibjs/declare/process.d.ts | 14 ++-- types/fibjs/declare/profiler.d.ts | 2 +- types/fibjs/declare/querystring.d.ts | 4 +- types/fibjs/declare/ssl.d.ts | 2 +- types/fibjs/declare/timers.d.ts | 15 +++- types/fibjs/declare/url.d.ts | 2 +- types/fibjs/declare/util.d.ts | 40 +++++++---- types/fibjs/declare/zlib.d.ts | 36 ++++++---- types/fibjs/index.d.ts | 2 +- 50 files changed, 410 insertions(+), 195 deletions(-) diff --git a/types/fibjs/declare/DgramSocket.d.ts b/types/fibjs/declare/DgramSocket.d.ts index 6618ae9c1c..22486d5832 100644 --- a/types/fibjs/declare/DgramSocket.d.ts +++ b/types/fibjs/declare/DgramSocket.d.ts @@ -45,7 +45,7 @@ declare class Class_DgramSocket extends Class_EventEmitter { * * @async */ - bind(opts: Object): void; + bind(opts: object): void; /** * diff --git a/types/fibjs/declare/Digest.d.ts b/types/fibjs/declare/Digest.d.ts index d440f31486..71c62f0386 100644 --- a/types/fibjs/declare/Digest.d.ts +++ b/types/fibjs/declare/Digest.d.ts @@ -52,23 +52,13 @@ declare class Class_Digest extends Class__object { /** * * @brief 计算并返回摘要 - * @param data 二进制数据块,此数据块将在计算前更新进摘要 - * @return 返回摘要的二进制数据 + * @param codec 指定编码格式,允许值为:"buffer", "hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回指定编码的摘要表示 * * * */ - digest(data: Class_Buffer): Class_Buffer; - - /** - * - * @brief 计算并返回摘要 - * @return 返回摘要的二进制数据 - * - * - * - */ - digest(): Class_Buffer; + digest(codec?: string/** = "buffer"*/): any; } /** endof class */ diff --git a/types/fibjs/declare/EventEmitter.d.ts b/types/fibjs/declare/EventEmitter.d.ts index 608b6f2edb..0008b2faa3 100644 --- a/types/fibjs/declare/EventEmitter.d.ts +++ b/types/fibjs/declare/EventEmitter.d.ts @@ -56,7 +56,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - on(ev: string, func: Function): Object; + on(ev: string, func: Function): object; /** * @@ -67,7 +67,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - on(map: Object): Object; + on(map: object): object; /** * @@ -79,7 +79,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - addListener(ev: string, func: Function): Object; + addListener(ev: string, func: Function): object; /** * @@ -90,7 +90,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - addListener(map: Object): Object; + addListener(map: object): object; /** * @@ -102,7 +102,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependListener(ev: string, func: Function): Object; + prependListener(ev: string, func: Function): object; /** * @@ -113,7 +113,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependListener(map: Object): Object; + prependListener(map: object): object; /** * @@ -125,7 +125,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - once(ev: string, func: Function): Object; + once(ev: string, func: Function): object; /** * @@ -136,7 +136,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - once(map: Object): Object; + once(map: object): object; /** * @@ -148,7 +148,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependOnceListener(ev: string, func: Function): Object; + prependOnceListener(ev: string, func: Function): object; /** * @@ -159,7 +159,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependOnceListener(map: Object): Object; + prependOnceListener(map: object): object; /** * @@ -171,7 +171,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - off(ev: string, func: Function): Object; + off(ev: string, func: Function): object; /** * @@ -182,7 +182,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - off(ev: string): Object; + off(ev: string): object; /** * @@ -193,7 +193,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - off(map: Object): Object; + off(map: object): object; /** * @@ -205,7 +205,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeListener(ev: string, func: Function): Object; + removeListener(ev: string, func: Function): object; /** * @@ -216,7 +216,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeListener(ev: string): Object; + removeListener(ev: string): object; /** * @@ -227,7 +227,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeListener(map: Object): Object; + removeListener(map: object): object; /** * @@ -238,7 +238,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): Object; + removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): object; /** * diff --git a/types/fibjs/declare/EventInfo.d.ts b/types/fibjs/declare/EventInfo.d.ts index a7c43a70a7..f60190d315 100644 --- a/types/fibjs/declare/EventInfo.d.ts +++ b/types/fibjs/declare/EventInfo.d.ts @@ -70,7 +70,7 @@ declare class Class_EventInfo extends Class__object { * @type Object */ - target: Object + target: object diff --git a/types/fibjs/declare/Handler.d.ts b/types/fibjs/declare/Handler.d.ts index ae7af823a2..df2ef6463f 100644 --- a/types/fibjs/declare/Handler.d.ts +++ b/types/fibjs/declare/Handler.d.ts @@ -44,7 +44,7 @@ declare class Class_Handler extends Class__object { * * */ - constructor(map: Object); + constructor(map: object); /** * diff --git a/types/fibjs/declare/HandlerEx.d.ts b/types/fibjs/declare/HandlerEx.d.ts index 504ab42c1a..22bca1ce76 100644 --- a/types/fibjs/declare/HandlerEx.d.ts +++ b/types/fibjs/declare/HandlerEx.d.ts @@ -81,7 +81,7 @@ declare class Class_HandlerEx extends Class_Handler { * * */ - onerror(hdlrs: Object): void; + onerror(hdlrs: object): void; } /** endof class */ diff --git a/types/fibjs/declare/HeapSnapshot.d.ts b/types/fibjs/declare/HeapSnapshot.d.ts index c65282165c..0a10a6b68f 100644 --- a/types/fibjs/declare/HeapSnapshot.d.ts +++ b/types/fibjs/declare/HeapSnapshot.d.ts @@ -71,7 +71,7 @@ declare class Class_HeapSnapshot extends Class__object { * * */ - diff(before: Class_HeapSnapshot): Object; + diff(before: Class_HeapSnapshot): object; /** * diff --git a/types/fibjs/declare/HttpClient.d.ts b/types/fibjs/declare/HttpClient.d.ts index 580e90c70c..7c9f6c073f 100644 --- a/types/fibjs/declare/HttpClient.d.ts +++ b/types/fibjs/declare/HttpClient.d.ts @@ -96,6 +96,30 @@ declare class Class_HttpClient extends Class__object { userAgent: string + /** + * class prop + * + * + * @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128 + * + * + * @type Integer + */ + + poolSize: number + + /** + * class prop + * + * + * @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms + * + * + * @type Integer + */ + + poolTimeout: number + /** @@ -139,7 +163,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - request(method: string, url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -161,7 +185,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - get(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -183,7 +207,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - post(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -205,7 +229,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - del(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -227,7 +251,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - put(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -249,7 +273,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - patch(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; } /** endof class */ diff --git a/types/fibjs/declare/HttpCollection.d.ts b/types/fibjs/declare/HttpCollection.d.ts index 5aa34c40bb..1936011e1d 100644 --- a/types/fibjs/declare/HttpCollection.d.ts +++ b/types/fibjs/declare/HttpCollection.d.ts @@ -75,7 +75,7 @@ declare class Class_HttpCollection extends Class__object { * * */ - add(map: Object): void; + add(map: object): void; /** * @@ -96,7 +96,7 @@ declare class Class_HttpCollection extends Class__object { * * */ - set(map: Object): void; + set(map: object): void; /** * diff --git a/types/fibjs/declare/HttpCookie.d.ts b/types/fibjs/declare/HttpCookie.d.ts index 5be7604293..b7c3980150 100644 --- a/types/fibjs/declare/HttpCookie.d.ts +++ b/types/fibjs/declare/HttpCookie.d.ts @@ -118,7 +118,7 @@ declare class Class_HttpCookie extends Class__object { * * */ - constructor(opts?: Object/** = v8::Object::New(isolate)*/); + constructor(opts?: object/** = v8::Object::New(isolate)*/); /** * @@ -130,7 +130,7 @@ declare class Class_HttpCookie extends Class__object { * * */ - constructor(name: string, value: string, opts?: Object/** = v8::Object::New(isolate)*/); + constructor(name: string, value: string, opts?: object/** = v8::Object::New(isolate)*/); /** * diff --git a/types/fibjs/declare/HttpMessage.d.ts b/types/fibjs/declare/HttpMessage.d.ts index 89ef9c96c6..1d64ba5c5f 100644 --- a/types/fibjs/declare/HttpMessage.d.ts +++ b/types/fibjs/declare/HttpMessage.d.ts @@ -151,7 +151,7 @@ declare class Class_HttpMessage extends Class_Message { * * */ - addHeader(map: Object): void; + addHeader(map: object): void; /** * @@ -172,7 +172,7 @@ declare class Class_HttpMessage extends Class_Message { * * */ - setHeader(map: Object): void; + setHeader(map: object): void; /** * diff --git a/types/fibjs/declare/HttpResponse.d.ts b/types/fibjs/declare/HttpResponse.d.ts index 4ecf06866d..7f69b8509a 100644 --- a/types/fibjs/declare/HttpResponse.d.ts +++ b/types/fibjs/declare/HttpResponse.d.ts @@ -80,7 +80,7 @@ declare class Class_HttpResponse extends Class_HttpMessage { * * */ - writeHead(statusCode: number, statusMessage: string, headers?: Object/** = v8::Object::New(isolate)*/): void; + writeHead(statusCode: number, statusMessage: string, headers?: object/** = v8::Object::New(isolate)*/): void; /** * @@ -91,7 +91,7 @@ declare class Class_HttpResponse extends Class_HttpMessage { * * */ - writeHead(statusCode: number, headers?: Object/** = v8::Object::New(isolate)*/): void; + writeHead(statusCode: number, headers?: object/** = v8::Object::New(isolate)*/): void; /** * diff --git a/types/fibjs/declare/HttpServer.d.ts b/types/fibjs/declare/HttpServer.d.ts index 157c951ea8..75ba24c290 100644 --- a/types/fibjs/declare/HttpServer.d.ts +++ b/types/fibjs/declare/HttpServer.d.ts @@ -143,7 +143,7 @@ declare class Class_HttpServer extends Class_TcpServer { * * */ - onerror(hdlrs: Object): void; + onerror(hdlrs: object): void; /** * diff --git a/types/fibjs/declare/LevelDB.d.ts b/types/fibjs/declare/LevelDB.d.ts index feb6ce2b6b..c9721bf337 100644 --- a/types/fibjs/declare/LevelDB.d.ts +++ b/types/fibjs/declare/LevelDB.d.ts @@ -78,7 +78,7 @@ declare class Class_LevelDB extends Class__object { * * */ - mset(map: Object): void; + mset(map: object): void; /** * diff --git a/types/fibjs/declare/LruCache.d.ts b/types/fibjs/declare/LruCache.d.ts index 884bb65d26..f68ac413cd 100644 --- a/types/fibjs/declare/LruCache.d.ts +++ b/types/fibjs/declare/LruCache.d.ts @@ -134,7 +134,7 @@ declare class Class_LruCache extends Class_EventEmitter { * * */ - set(map: Object): void; + set(map: object): void; /** * diff --git a/types/fibjs/declare/MongoCollection.d.ts b/types/fibjs/declare/MongoCollection.d.ts index 4b1f07478b..e721feabcd 100644 --- a/types/fibjs/declare/MongoCollection.d.ts +++ b/types/fibjs/declare/MongoCollection.d.ts @@ -36,7 +36,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - find(query?: Object/** = v8::Object::New(isolate)*/, projection?: Object/** = v8::Object::New(isolate)*/): Class_MongoCursor; + find(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): Class_MongoCursor; /** * @@ -48,7 +48,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - findOne(query?: Object/** = v8::Object::New(isolate)*/, projection?: Object/** = v8::Object::New(isolate)*/): Object; + findOne(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): object; /** * @@ -59,7 +59,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - findAndModify(query: Object): Object; + findAndModify(query: object): object; /** * @@ -79,7 +79,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - insert(document: Object): void; + insert(document: object): void; /** * @@ -89,7 +89,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - save(document: Object): void; + save(document: object): void; /** * @@ -102,7 +102,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - update(query: Object, document: Object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void; + update(query: object, document: object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void; /** * @@ -114,7 +114,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - update(query: Object, document: Object, options: Object): void; + update(query: object, document: object, options: object): void; /** * @@ -124,7 +124,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - remove(query: Object): void; + remove(query: object): void; /** * @@ -135,7 +135,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - runCommand(cmd: Object): Object; + runCommand(cmd: object): object; /** * @@ -147,7 +147,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - runCommand(cmd: string, arg?: Object/** = v8::Object::New(isolate)*/): Object; + runCommand(cmd: string, arg?: object/** = v8::Object::New(isolate)*/): object; /** * @@ -166,7 +166,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - ensureIndex(keys: Object, options?: Object/** = v8::Object::New(isolate)*/): void; + ensureIndex(keys: object, options?: object/** = v8::Object::New(isolate)*/): void; /** * @@ -176,7 +176,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - reIndex(): Object; + reIndex(): object; /** * @@ -187,7 +187,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - dropIndex(name: string): Object; + dropIndex(name: string): object; /** * @@ -197,7 +197,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - dropIndexes(): Object; + dropIndexes(): object; /** * diff --git a/types/fibjs/declare/MongoCursor.d.ts b/types/fibjs/declare/MongoCursor.d.ts index d9e26b833f..2dc99b5e96 100644 --- a/types/fibjs/declare/MongoCursor.d.ts +++ b/types/fibjs/declare/MongoCursor.d.ts @@ -57,7 +57,7 @@ declare class Class_MongoCursor extends Class__object { * * */ - sort(opts: Object): Class_MongoCursor; + sort(opts: object): Class_MongoCursor; /** * @@ -77,7 +77,7 @@ declare class Class_MongoCursor extends Class__object { * * */ - next(): Object; + next(): object; /** * @@ -140,7 +140,7 @@ declare class Class_MongoCursor extends Class__object { * * */ - hint(opts: Object): Class_MongoCursor; + hint(opts: object): Class_MongoCursor; } /** endof class */ diff --git a/types/fibjs/declare/MongoDB.d.ts b/types/fibjs/declare/MongoDB.d.ts index c0bf5432bd..11bcf1456d 100644 --- a/types/fibjs/declare/MongoDB.d.ts +++ b/types/fibjs/declare/MongoDB.d.ts @@ -46,7 +46,7 @@ declare class Class_MongoDB extends Class__object { * * */ - runCommand(cmd: Object): Object; + runCommand(cmd: object): object; /** * @@ -58,7 +58,7 @@ declare class Class_MongoDB extends Class__object { * * */ - runCommand(cmd: string, arg: any): Object; + runCommand(cmd: string, arg: any): object; /** * diff --git a/types/fibjs/declare/PKey.d.ts b/types/fibjs/declare/PKey.d.ts index 0c3f939e3e..297cfb2a13 100644 --- a/types/fibjs/declare/PKey.d.ts +++ b/types/fibjs/declare/PKey.d.ts @@ -144,7 +144,7 @@ declare class Class_PKey extends Class__object { * * */ - constructor(jsonKey: Object); + constructor(jsonKey: object); /** * @@ -258,7 +258,7 @@ declare class Class_PKey extends Class__object { * * */ - importKey(jsonKey: Object): void; + importKey(jsonKey: object): void; /** * @@ -299,7 +299,7 @@ declare class Class_PKey extends Class__object { * * */ - exportJson(): Object; + exportJson(): object; /** * diff --git a/types/fibjs/declare/Redis.d.ts b/types/fibjs/declare/Redis.d.ts index 4c5201d62c..384e0e4d80 100644 --- a/types/fibjs/declare/Redis.d.ts +++ b/types/fibjs/declare/Redis.d.ts @@ -90,7 +90,7 @@ declare class Class_Redis extends Class__object { * * */ - mset(kvs: Object): void; + mset(kvs: object): void; /** * @@ -108,7 +108,7 @@ declare class Class_Redis extends Class__object { * * */ - msetNX(kvs: Object): void; + msetNX(kvs: object): void; /** * @@ -383,7 +383,7 @@ declare class Class_Redis extends Class__object { * * */ - sub(map: Object): void; + sub(map: object): void; /** * @@ -424,7 +424,7 @@ declare class Class_Redis extends Class__object { * * */ - unsub(map: Object): void; + unsub(map: object): void; /** * @@ -445,7 +445,7 @@ declare class Class_Redis extends Class__object { * * */ - psub(map: Object): void; + psub(map: object): void; /** * @@ -486,7 +486,7 @@ declare class Class_Redis extends Class__object { * * */ - unpsub(map: Object): void; + unpsub(map: object): void; /** * diff --git a/types/fibjs/declare/RedisHash.d.ts b/types/fibjs/declare/RedisHash.d.ts index 0c8c9ea362..0c16eef47d 100644 --- a/types/fibjs/declare/RedisHash.d.ts +++ b/types/fibjs/declare/RedisHash.d.ts @@ -53,7 +53,7 @@ declare class Class_RedisHash extends Class__object { * * */ - mset(kvs: Object): void; + mset(kvs: object): void; /** * diff --git a/types/fibjs/declare/RedisSortedSet.d.ts b/types/fibjs/declare/RedisSortedSet.d.ts index ed2bcfaf5c..1769fb0a79 100644 --- a/types/fibjs/declare/RedisSortedSet.d.ts +++ b/types/fibjs/declare/RedisSortedSet.d.ts @@ -34,7 +34,7 @@ declare class Class_RedisSortedSet extends Class__object { * * */ - add(sms: Object): number; + add(sms: object): number; /** * diff --git a/types/fibjs/declare/Routing.d.ts b/types/fibjs/declare/Routing.d.ts index c06bc4e887..aef820feae 100644 --- a/types/fibjs/declare/Routing.d.ts +++ b/types/fibjs/declare/Routing.d.ts @@ -34,7 +34,7 @@ declare class Class_Routing extends Class_Handler { * * */ - constructor(map?: Object/** = v8::Object::New(isolate)*/); + constructor(map?: object/** = v8::Object::New(isolate)*/); /** * @@ -45,7 +45,7 @@ declare class Class_Routing extends Class_Handler { * * */ - constructor(method: string, map: Object); + constructor(method: string, map: object); /** * @@ -67,7 +67,7 @@ declare class Class_Routing extends Class_Handler { * * */ - append(map: Object): Class_Routing; + append(map: object): Class_Routing; /** * @@ -103,7 +103,7 @@ declare class Class_Routing extends Class_Handler { * * */ - all(map: Object): Class_Routing; + all(map: object): Class_Routing; /** * @@ -126,7 +126,7 @@ declare class Class_Routing extends Class_Handler { * * */ - get(map: Object): Class_Routing; + get(map: object): Class_Routing; /** * @@ -149,7 +149,7 @@ declare class Class_Routing extends Class_Handler { * * */ - post(map: Object): Class_Routing; + post(map: object): Class_Routing; /** * @@ -172,7 +172,7 @@ declare class Class_Routing extends Class_Handler { * * */ - del(map: Object): Class_Routing; + del(map: object): Class_Routing; /** * @@ -195,7 +195,7 @@ declare class Class_Routing extends Class_Handler { * * */ - put(map: Object): Class_Routing; + put(map: object): Class_Routing; /** * @@ -218,7 +218,7 @@ declare class Class_Routing extends Class_Handler { * * */ - patch(map: Object): Class_Routing; + patch(map: object): Class_Routing; /** * @@ -241,7 +241,7 @@ declare class Class_Routing extends Class_Handler { * * */ - find(map: Object): Class_Routing; + find(map: object): Class_Routing; /** * diff --git a/types/fibjs/declare/SandBox.d.ts b/types/fibjs/declare/SandBox.d.ts index 31f9dc53ce..fc3152b232 100644 --- a/types/fibjs/declare/SandBox.d.ts +++ b/types/fibjs/declare/SandBox.d.ts @@ -34,7 +34,20 @@ declare class Class_SandBox extends Class__object { * @type Object */ - global: Object + global: object + + /** + * class prop + * + * + * @brief 查询沙箱中现存的所有模块的字典对象 + * + * + * @readonly + * @type Object + */ + + modules: object @@ -46,7 +59,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object); + constructor(mods: object); /** * @@ -57,7 +70,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object, require: Function); + constructor(mods: object, require: Function); /** * @@ -68,7 +81,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object, global: Object); + constructor(mods: object, global: object); /** * @@ -80,7 +93,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object, require: Function, global: Object); + constructor(mods: object, require: Function, global: object); /** * @@ -101,7 +114,7 @@ declare class Class_SandBox extends Class__object { * * */ - add(mods: Object): void; + add(mods: object): void; /** * @@ -125,6 +138,17 @@ declare class Class_SandBox extends Class__object { */ remove(id: string): void; + /** + * + * @brief 从沙箱中检测基础模块是否存在 + * @param id 指定要检测的模块名称,此路径与当前运行脚本无关,必须为绝对路径或者模块名 + * @return 是否存在 + * + * + * + */ + has(id: string): boolean; + /** * * @brief 复制当前沙箱,新沙箱包含当前沙箱的模块,以及相同的名称和 require 函数 @@ -135,6 +159,22 @@ declare class Class_SandBox extends Class__object { */ clone(): Class_SandBox; + /** + * + * @brief 冻结当前沙箱,冻结后的沙箱,对 global 所做的修改将被忽略 + * + * + */ + freeze(): void; + + /** + * + * @brief 重新加载沙箱内的模块,此操作只会重新初始化模块,复位模块内的变量,不更新模块代码 + * + * + */ + refresh(): void; + /** * * @brief 运行一个脚本 @@ -170,6 +210,44 @@ declare class Class_SandBox extends Class__object { */ require(id: string, base: string): any; + /** + * + * @brief 对指定的 extname 添加 compiler, extname 不可为系统内置扩展名 (包括 {'.js', '.json', '.jsc', '.wasm'}), compiler 需返回有效的 javascript 脚本. + * + * ```JavaScript + * var vm = require('vm'); + * var sbox = new vm.SandBox({ + * }); + * + * // 编译 typescript 脚本为 js 并加载 + * sbox.setModuleCompiler('.ts', tsCompiler); + * var mod_ts = sbox.require('./a.ts'); + * + * // 编译 coffee 脚本为 js 并加载 + * sbox.setModuleCompiler('.coffee', cafeCompiler); + * var mod_coffee = sbox.require('./a.coffee'); + * + * // 编译 jsx 脚本为 js 并加载 + * sbox.setModuleCompiler('.jsx', reactCompiler); + * var mod_react = sbox.require('./a.jsx'); + * + * // 编译 yml 脚本为自定义的内容(如 API 集合) 并加载 + * sbox.setModuleCompiler('.yml', yaml2Rest) + * sbox.setModuleCompiler('.yaml', yaml2Rest) + * + * // 编译 markdown 为自定义的内容(如 html 字符串或 XmlDocument 对象) 并加载 + * sbox.setModuleCompiler('.md', mdCompiler) + * sbox.setModuleCompiler('.markdown', mdCompiler) + * ``` + * + * @param extname 指定的 extname, 必须以 '.' 开头, 且为非系统内置扩展名 + * @param compiler 编译回调函数, 所有带 extname 的文件仅会 require 一次. 该回调函数格式为 `compiler(buf, requireInfo)`, buf 为读取到的文件 Buffer, requireInfo 结构为 `{filename: string}`. + * + * + * + */ + setModuleCompiler(extname: string, compiler: Function): void; + } /** endof class */ /** endof `module Or Internal Object` */ diff --git a/types/fibjs/declare/Service.d.ts b/types/fibjs/declare/Service.d.ts index 6ca8feab53..7816e2d8bc 100644 --- a/types/fibjs/declare/Service.d.ts +++ b/types/fibjs/declare/Service.d.ts @@ -84,7 +84,7 @@ declare class Class_Service extends Class_EventEmitter { * * */ - constructor(name: string, worker: Function, event?: Object/** = v8::Object::New(isolate)*/); + constructor(name: string, worker: Function, event?: object/** = v8::Object::New(isolate)*/); /** * diff --git a/types/fibjs/declare/UrlObject.d.ts b/types/fibjs/declare/UrlObject.d.ts index 578d3b5079..5baa5b2d7d 100644 --- a/types/fibjs/declare/UrlObject.d.ts +++ b/types/fibjs/declare/UrlObject.d.ts @@ -216,7 +216,7 @@ declare class Class_UrlObject extends Class__object { * * */ - constructor(args: Object); + constructor(args: object); /** * @@ -250,7 +250,7 @@ declare class Class_UrlObject extends Class__object { * * */ - format(args: Object): void; + format(args: object): void; /** * diff --git a/types/fibjs/declare/Worker.d.ts b/types/fibjs/declare/Worker.d.ts index 1bbc793b85..c427f6f41c 100644 --- a/types/fibjs/declare/Worker.d.ts +++ b/types/fibjs/declare/Worker.d.ts @@ -47,7 +47,7 @@ declare class Class_Worker extends Class_EventEmitter { * * */ - constructor(path: string, opts?: Object/** = v8::Object::New(isolate)*/); + constructor(path: string, opts?: object/** = v8::Object::New(isolate)*/); /** * diff --git a/types/fibjs/declare/X509Req.d.ts b/types/fibjs/declare/X509Req.d.ts index 6317e9afa1..502c078402 100644 --- a/types/fibjs/declare/X509Req.d.ts +++ b/types/fibjs/declare/X509Req.d.ts @@ -146,7 +146,7 @@ declare class Class_X509Req extends Class__object { * * @async */ - sign(issuer: string, key: Class_PKey, opts?: Object/** = v8::Object::New(isolate)*/): Class_X509Cert; + sign(issuer: string, key: Class_PKey, opts?: object/** = v8::Object::New(isolate)*/): Class_X509Cert; } /** endof class */ diff --git a/types/fibjs/declare/bson.d.ts b/types/fibjs/declare/bson.d.ts index 920a1ace79..f9eeab19cb 100644 --- a/types/fibjs/declare/bson.d.ts +++ b/types/fibjs/declare/bson.d.ts @@ -217,7 +217,7 @@ declare module "bson" { * * */ - export function encode(data: Object): Class_Buffer; + export function encode(data: object): Class_Buffer; /** * @@ -228,7 +228,7 @@ declare module "bson" { * * */ - export function decode(data: Class_Buffer): Object; + export function decode(data: Class_Buffer): object; } /** end of `module bson` */ export = bson diff --git a/types/fibjs/declare/console.d.ts b/types/fibjs/declare/console.d.ts index 7a657ecd93..43f8603c2e 100644 --- a/types/fibjs/declare/console.d.ts +++ b/types/fibjs/declare/console.d.ts @@ -391,7 +391,7 @@ declare module "console" { * * */ - export function add(cfg: Object): void; + export function add(cfg: object): void; /** * diff --git a/types/fibjs/declare/dgram.d.ts b/types/fibjs/declare/dgram.d.ts index e925eac7af..0d3ccd20a9 100644 --- a/types/fibjs/declare/dgram.d.ts +++ b/types/fibjs/declare/dgram.d.ts @@ -238,7 +238,7 @@ declare module "dgram" { * * */ - export function createSocket(opts: Object): Class_DgramSocket; + export function createSocket(opts: object): Class_DgramSocket; /** * @@ -260,7 +260,7 @@ declare module "dgram" { * * */ - export function createSocket(opts: Object, callback: Function): Class_DgramSocket; + export function createSocket(opts: object, callback: Function): Class_DgramSocket; /** * diff --git a/types/fibjs/declare/fs.d.ts b/types/fibjs/declare/fs.d.ts index ec22c54c3d..b0971e3ee5 100644 --- a/types/fibjs/declare/fs.d.ts +++ b/types/fibjs/declare/fs.d.ts @@ -647,6 +647,27 @@ declare module "fs" { */ export function appendFile(fname: string, data: Class_Buffer): void; + /** + * + * @brief 设置 zip 虚拟文件映射 + * @param fname 指定映射路径 + * @param data 指定映射的 zip 文件数据 + * + * + * + */ + export function setZipFS(fname: string, data: Class_Buffer): void; + + /** + * + * @brief 清除 zip 虚拟文件映射 + * @param fname 指定映射路径,缺省清除全部缓存 + * + * + * + */ + export function clearZipFS(fname?: string/** = ""*/): void; + } /** end of `module fs` */ export = fs } diff --git a/types/fibjs/declare/global.d.ts b/types/fibjs/declare/global.d.ts index 3c58e8289c..19d539d932 100644 --- a/types/fibjs/declare/global.d.ts +++ b/types/fibjs/declare/global.d.ts @@ -379,7 +379,7 @@ declare module "global" { * * */ - export function setTimeout(callback: Function, timeout: number, ...args: any[]): Class_Timer; + export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer; /** * diff --git a/types/fibjs/declare/gui.d.ts b/types/fibjs/declare/gui.d.ts index e2522b8331..60768a9d93 100644 --- a/types/fibjs/declare/gui.d.ts +++ b/types/fibjs/declare/gui.d.ts @@ -293,7 +293,7 @@ declare module "gui" { * * */ - export function open(url: string, opt?: Object/** = v8::Object::New(isolate)*/): Class_WebView; + export function open(url: string, opt?: object/** = v8::Object::New(isolate)*/): Class_WebView; } /** end of `module gui` */ export = gui diff --git a/types/fibjs/declare/http.d.ts b/types/fibjs/declare/http.d.ts index 2712b08370..000f4a6b79 100644 --- a/types/fibjs/declare/http.d.ts +++ b/types/fibjs/declare/http.d.ts @@ -196,7 +196,7 @@ /** module Or Internal Object */ /** - * @brief 超文本传输协议模块,用以支持 http 协议处理 + * @brief 超文本传输协议模块,用以支持 http 协议处理,模块别名:https * @detail */ declare module "http" { @@ -205,6 +205,14 @@ declare module "http" { module http { + /** + * + * @brief 返回标准的 HTTP 响应状态码的集合,以及各自的简短描述。 + * + * + */ + export const STATUS_CODES: any[]; + /** * * @brief 返回http客户端的 HttpCookie 对象列表 @@ -253,6 +261,22 @@ declare module "http" { */ export const userAgent: string; + /** + * + * @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128 + * + * + */ + export const poolSize: number; + + /** + * + * @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms + * + * + */ + export const poolTimeout: number; + /** * @@ -333,7 +357,7 @@ declare module "http" { * * */ - export function fileHandler(root: string, mimes?: Object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler; + export function fileHandler(root: string, mimes?: object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler; /** * @@ -368,7 +392,7 @@ declare module "http" { * * @async */ - export function request(method: string, url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -390,7 +414,7 @@ declare module "http" { * * @async */ - export function get(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -412,7 +436,7 @@ declare module "http" { * * @async */ - export function post(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -434,7 +458,7 @@ declare module "http" { * * @async */ - export function del(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -456,7 +480,7 @@ declare module "http" { * * @async */ - export function put(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -478,7 +502,7 @@ declare module "http" { * * @async */ - export function patch(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; } /** end of `module http` */ export = http diff --git a/types/fibjs/declare/index.d.ts b/types/fibjs/declare/index.d.ts index 53be0766e3..df0e02e683 100644 --- a/types/fibjs/declare/index.d.ts +++ b/types/fibjs/declare/index.d.ts @@ -14,54 +14,54 @@ -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// /// -/// -/// -/// -/// -/// -/// -/// /// -/// -/// -/// -/// -/// /// -/// /// -/// /// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// /// +/// +/// +/// +/// +/// +/// /// -/// -/// -/// +/// +/// /// /// /// -/// /// -/// -/// -/// +/// import _Global from 'global'; import _Process from 'process'; diff --git a/types/fibjs/declare/net.d.ts b/types/fibjs/declare/net.d.ts index 831b958124..8c2bf58055 100644 --- a/types/fibjs/declare/net.d.ts +++ b/types/fibjs/declare/net.d.ts @@ -284,7 +284,7 @@ declare module "net" { * * */ - export function info(): Object; + export function info(): object; /** * diff --git a/types/fibjs/declare/os.d.ts b/types/fibjs/declare/os.d.ts index d98d2b58d5..977fc4c6ce 100644 --- a/types/fibjs/declare/os.d.ts +++ b/types/fibjs/declare/os.d.ts @@ -380,7 +380,7 @@ declare module "os" { * * */ - export function userInfo(options?: Object/** = v8::Object::New(isolate)*/): Object; + export function userInfo(options?: object/** = v8::Object::New(isolate)*/): object; /** * @@ -390,7 +390,7 @@ declare module "os" { * * */ - export function networkInterfaces(): Object; + export function networkInterfaces(): object; /** * @@ -470,7 +470,7 @@ declare module "os" { * * */ - export function memoryUsage(): Object; + export function memoryUsage(): object; } /** end of `module os` */ export = os diff --git a/types/fibjs/declare/path.d.ts b/types/fibjs/declare/path.d.ts index 2764664778..9b6ae9cfec 100644 --- a/types/fibjs/declare/path.d.ts +++ b/types/fibjs/declare/path.d.ts @@ -341,6 +341,19 @@ declare module "path" { */ export function resolve(...ps: any[]): string; + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + /** * * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 diff --git a/types/fibjs/declare/path_posix.d.ts b/types/fibjs/declare/path_posix.d.ts index e28fbfee0a..bfeea21068 100644 --- a/types/fibjs/declare/path_posix.d.ts +++ b/types/fibjs/declare/path_posix.d.ts @@ -341,6 +341,19 @@ declare module "path_posix" { */ export function resolve(...ps: any[]): string; + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + /** * * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 diff --git a/types/fibjs/declare/path_win32.d.ts b/types/fibjs/declare/path_win32.d.ts index 80f236ba50..25ce64db09 100644 --- a/types/fibjs/declare/path_win32.d.ts +++ b/types/fibjs/declare/path_win32.d.ts @@ -341,6 +341,19 @@ declare module "path_win32" { */ export function resolve(...ps: any[]): string; + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + /** * * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 diff --git a/types/fibjs/declare/process.d.ts b/types/fibjs/declare/process.d.ts index 669eff12d2..1e6e1c8739 100644 --- a/types/fibjs/declare/process.d.ts +++ b/types/fibjs/declare/process.d.ts @@ -416,7 +416,7 @@ declare module "process" { * * */ - export function memoryUsage(): Object; + export function memoryUsage(): object; /** * @@ -448,7 +448,7 @@ declare module "process" { * * */ - export function open(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function open(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -468,7 +468,7 @@ declare module "process" { * * */ - export function open(command: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function open(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -489,7 +489,7 @@ declare module "process" { * * */ - export function start(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function start(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -509,7 +509,7 @@ declare module "process" { * * */ - export function start(command: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function start(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -530,7 +530,7 @@ declare module "process" { * * */ - export function run(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): number; + export function run(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): number; /** * @@ -550,7 +550,7 @@ declare module "process" { * * */ - export function run(command: string, opts?: Object/** = v8::Object::New(isolate)*/): number; + export function run(command: string, opts?: object/** = v8::Object::New(isolate)*/): number; } /** end of `module process` */ export = process diff --git a/types/fibjs/declare/profiler.d.ts b/types/fibjs/declare/profiler.d.ts index 36a89b2644..5d3459ddbb 100644 --- a/types/fibjs/declare/profiler.d.ts +++ b/types/fibjs/declare/profiler.d.ts @@ -416,7 +416,7 @@ declare module "profiler" { * * */ - export function diff(test: Function): Object; + export function diff(test: Function): object; /** * diff --git a/types/fibjs/declare/querystring.d.ts b/types/fibjs/declare/querystring.d.ts index 9010d119e5..bd939a0621 100644 --- a/types/fibjs/declare/querystring.d.ts +++ b/types/fibjs/declare/querystring.d.ts @@ -242,7 +242,7 @@ declare module "querystring" { * * */ - export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: Object/** = v8::Object::New(isolate)*/): Class_HttpCollection; + export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): Class_HttpCollection; /** * @@ -256,7 +256,7 @@ declare module "querystring" { * * */ - export function stringify(obj: Object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: Object/** = v8::Object::New(isolate)*/): string; + export function stringify(obj: object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): string; } /** end of `module querystring` */ export = querystring diff --git a/types/fibjs/declare/ssl.d.ts b/types/fibjs/declare/ssl.d.ts index 2799f59be3..e331eeb691 100644 --- a/types/fibjs/declare/ssl.d.ts +++ b/types/fibjs/declare/ssl.d.ts @@ -196,7 +196,7 @@ /** module Or Internal Object */ /** - * @brief ssl/tls 模块 + * @brief ssl/tls 模块,模块别名:tls * @detail */ declare module "ssl" { diff --git a/types/fibjs/declare/timers.d.ts b/types/fibjs/declare/timers.d.ts index 7469a7ea68..8de6e72812 100644 --- a/types/fibjs/declare/timers.d.ts +++ b/types/fibjs/declare/timers.d.ts @@ -219,7 +219,7 @@ declare module "timers" { * * */ - export function setTimeout(callback: Function, timeout: number, ...args: any[]): Class_Timer; + export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer; /** * @@ -313,6 +313,19 @@ declare module "timers" { */ export function clearImmediate(t: any): void; + /** + * + * @brief 调用给定的函数,并在超时时间到期时中断函数运行 + * @param func 指定要运行的函数 + * @param timeout 指定超时时间 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回 func 的运行结果 + * + * + * + */ + export function call(func: Function, timeout: number, ...args: any[]): any; + } /** end of `module timers` */ export = timers } diff --git a/types/fibjs/declare/url.d.ts b/types/fibjs/declare/url.d.ts index 7728d433a2..545b516cd2 100644 --- a/types/fibjs/declare/url.d.ts +++ b/types/fibjs/declare/url.d.ts @@ -217,7 +217,7 @@ declare module "url" { * * */ - export function format(args: Object): string; + export function format(args: object): string; /** * diff --git a/types/fibjs/declare/util.d.ts b/types/fibjs/declare/util.d.ts index 6998b4aab1..1b38c49399 100644 --- a/types/fibjs/declare/util.d.ts +++ b/types/fibjs/declare/util.d.ts @@ -274,7 +274,7 @@ declare module "util" { * * */ - export function inspect(obj: Object, options?: Object/** = v8::Object::New(isolate)*/): string; + export function inspect(obj: object, options?: object/** = v8::Object::New(isolate)*/): string; /** * @@ -637,6 +637,17 @@ declare module "util" { */ export function clone(v: any): any; + /** + * + * @brief 深度冻结一个对象,被冻结后的对象及其包含的对象都将不允许修改 + * + * @param v 指定要冻结的对象 + * + * + * + */ + export function deepFreeze(v: any): void; + /** * * @brief 将一个或者多个对象的键值扩展到指定对象 @@ -674,7 +685,7 @@ declare module "util" { * * */ - export function pick(v: any, ...objs: any[]): Object; + export function pick(v: any, ...objs: any[]): object; /** * @@ -687,7 +698,7 @@ declare module "util" { * * */ - export function omit(v: any, ...keys: any[]): Object; + export function omit(v: any, ...keys: any[]): object; /** * @@ -937,22 +948,25 @@ declare module "util" { * * ```JavaScript * { - * "fibjs": "0.1.0", - * "svn": 1753, - * "build": "Dec 10 2013 21:44:17", + * "fibjs": "0.25.0", + * "clang": "9.1", + * "date": "Jun 12 2018 07:22:40", * "vender": { - * "ev": "4.11", - * "exif": "0.6.21", - * "gd": "2.1.0-alpha", + * "ev": "4.24", + * "expat": "2.2.5", + * "gd": "2.2.4", * "jpeg": "8.3", - * "log4cpp": "1.0", + * "leveldb": "1.17", * "mongo": "0.7", * "pcre": "8.21", * "png": "1.5.4", - * "sqlite": "3.8.1", + * "mbedtls": "2.6.1", + * "snappy": "1.1.2", + * "sqlite": "3.23.0", * "tiff": "3.9.5", * "uuid": "1.6.2", - * "v8": "3.23.17 (candidate)", + * "v8": "6.7.288.20", + * "v8-snapshot": true, * "zlib": "1.2.7", * "zmq": "3.1" * } @@ -963,7 +977,7 @@ declare module "util" { * * */ - export function buildInfo(): Object; + export function buildInfo(): object; } /** end of `module util` */ export = util diff --git a/types/fibjs/declare/zlib.d.ts b/types/fibjs/declare/zlib.d.ts index 049d70f365..693dcf81bf 100644 --- a/types/fibjs/declare/zlib.d.ts +++ b/types/fibjs/declare/zlib.d.ts @@ -264,11 +264,12 @@ declare module "zlib" { * * @brief 创建一个 gunzip 流对象 * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回封装过的流对象 * * */ - export function createGunzip(to: Class_Stream): Class_Stream; + export function createGunzip(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; /** * @@ -284,21 +285,23 @@ declare module "zlib" { * * @brief 创建一个 inflate 流对象 * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回封装过的流对象 * * */ - export function createInflate(to: Class_Stream): Class_Stream; + export function createInflate(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; /** * * @brief 创建一个 inflateRaw 流对象 * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回封装过的流对象 * * */ - export function createInflateRaw(to: Class_Stream): Class_Stream; + export function createInflateRaw(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; /** * @@ -340,34 +343,37 @@ declare module "zlib" { * * @brief 解压缩 deflate 算法压缩的数据(zlib格式) * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回解压缩后的二进制数据 * * * @async */ - export function inflate(data: Class_Buffer): Class_Buffer; + export function inflate(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; /** * * @brief 解压缩 deflate 算法压缩的数据到流对象中(zlib格式) * @param data 给定要解压缩的数据 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateTo(data: Class_Buffer, stm: Class_Stream): void; + export function inflateTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * * @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(zlib格式) * @param src 给定要解压缩的数据所在的流 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateTo(src: Class_Stream, stm: Class_Stream): void; + export function inflateTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * @@ -406,34 +412,37 @@ declare module "zlib" { * * @brief 解压缩 gzip 算法压缩的数据 * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回解压缩后的二进制数据 * * * @async */ - export function gunzip(data: Class_Buffer): Class_Buffer; + export function gunzip(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; /** * * @brief 解压缩 gzip 算法压缩的数据到流对象中 * @param data 给定要解压缩的数据 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function gunzipTo(data: Class_Buffer, stm: Class_Stream): void; + export function gunzipTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * * @brief 解压缩源流中 gzip 算法压缩的数据到流对象中 * @param src 给定要解压缩的数据所在的流 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function gunzipTo(src: Class_Stream, stm: Class_Stream): void; + export function gunzipTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * @@ -475,34 +484,37 @@ declare module "zlib" { * * @brief 解压缩 deflate 算法压缩的数据(inflateRaw) * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回解压缩后的二进制数据 * * * @async */ - export function inflateRaw(data: Class_Buffer): Class_Buffer; + export function inflateRaw(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; /** * * @brief 解压缩 deflate 算法压缩的数据到流对象中(inflateRaw) * @param data 给定要解压缩的数据 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateRawTo(data: Class_Buffer, stm: Class_Stream): void; + export function inflateRawTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * * @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(inflateRaw) * @param src 给定要解压缩的数据所在的流 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateRawTo(src: Class_Stream, stm: Class_Stream): void; + export function inflateRawTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; } /** end of `module zlib` */ export = zlib diff --git a/types/fibjs/index.d.ts b/types/fibjs/index.d.ts index 0b4ef29975..02201fd904 100644 --- a/types/fibjs/index.d.ts +++ b/types/fibjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fibjs 0.25 +// Type definitions for fibjs 0.26 // Project: https://github.com/fibjs/fibjs // Definitions by: richardo2016 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From e9b0deaf8ae8fb6d03203f0fc4172363812fe06e Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Sat, 18 Aug 2018 14:46:35 +0800 Subject: [PATCH 288/346] apply prettier to format weixin-app --- types/weixin-app/index.d.ts | 6634 +++++++++++++------------- types/weixin-app/weixin-app-tests.ts | 515 +- 2 files changed, 3694 insertions(+), 3455 deletions(-) diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 100a00bc48..c216cfa636 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -6,3042 +6,3198 @@ // TypeScript Version: 2.3 declare namespace wx { - // #region 基本参数 - interface DataResponse { - /** 回调函数返回的内容 */ - data: object | string | ArrayBuffer; - /** 开发者服务器返回的 HTTP 状态码 */ - statusCode: number; - /** 开发者服务器返回的 HTTP Response Header */ - header: object; - } - interface ErrMsgResponse { - /** 成功:ok,错误:详细信息 */ - errMsg: 'ok' | string; - } - interface TempFileResponse { - /** 文件的临时路径 */ - tempFilePath: string; - } - interface BaseOptions { - /** 接口调用成功的回调函数 */ - success?(res: any): void; - /** 接口调用失败的回调函数 */ - fail?(res: any): void; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?(res: any): void; - } - // #endregion - // #region 网络API列表 - // 发起请求 - interface RequestHeader { - [key: string]: string; - } - interface RequestOptions extends BaseOptions { - /** 开发者服务器接口地址 */ - url: string; - /** 请求的参数 */ - data?: string | object | ArrayBuffer; - /** 设置请求的 header , header 中不能设置 Referer */ - header?: RequestHeader; - /** 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT */ - method?: "GET" | "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT"; - /** 如果设为json,会尝试对返回的数据做一次 JSON.parse */ - dataType?: string; - /** - * 设置响应的数据类型。合法值:text、arraybuffer - * @version 1.7.0 - */ - responseType?: string; - /** 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'} */ - success?(res: DataResponse): void; - } - /** - * wx.request发起的是https请求。一个微信小程序,同时只能有5个网络请求连接。 - */ - function request(options: RequestOptions): RequestTask; - - /** - * 返回一个 requestTask 对象,通过 requestTask,可中断请求任务。 - */ - interface RequestTask { - abort(): void; - } - - interface UploadTask { - /** - * 监听上传进度变化 - * @version 1.4.0 - */ - onProgressUpdate(callback?: (res: { - /** 上传进度百分比 */ - progress: number; - /** 已经上传的数据长度,单位 Bytes */ - totalBytesSent: number; - /** 预期需要上传的数据总长度,单位 Bytes */ - totalBytesExpectedToSend: number; - }) => void): void; - /** - * 中断下载任务 - * @version 1.4.0 - */ - abort(): void; - } - // 上传下载 - interface UploadFileOptions extends BaseOptions { - /** 开发者服务器 url */ - url: string; - /** 要上传文件资源的路径 */ - filePath: string; - /** 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 */ - name: string; - /** HTTP 请求 Header , header 中不能设置 Referer */ - header?: RequestHeader; - /** HTTP 请求中其他额外的 form data */ - formData?: any; - } - /** - * 将本地资源上传到开发者服务器。 - * 如页面通过 wx.chooseImage 等接口获取到一个本地资源的临时文件路径后, - * 可通过此接口将本地资源上传到指定服务器。 - * 客户端发起一个 HTTPS POST 请求, - * 其中 Content-Type 为 multipart/form-data 。 - */ - function uploadFile(options: UploadFileOptions): UploadTask; - interface DownloadTask { - /** - * 监听下载进度变化 - * @version 1.4.0 - */ - onProgressUpdate(callback?: (res: { - /** 下载进度百分比 */ - progress: number; - /** 已经下载的数据长度,单位 Bytes */ - totalBytesWritten: number; - /** 预期需要下载的数据总长度,单位 Bytes */ - totalBytesExpectedToWrite: number; - }) => void): void; - /** - * 中断下载任务 - * @version 1.4.0 - */ - abort(): void; - } - interface DownloadFileOptions extends BaseOptions { - /** 下载资源的 url */ - url: string; - /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ - type?: string; - /** HTTP 请求 Header */ - header?: RequestHeader; - /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ - success?(res: TempFileResponse): void; - } - /** - * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, - * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 - */ - function downloadFile(options: DownloadFileOptions): DownloadTask; - // WebSocket - interface ConnectSocketOptions extends BaseOptions { - /** 开发者服务器接口地址,必须是 HTTPS 协议,且域名必须是后台配置的合法域名 */ - url: string; - /** 请求的数据 */ - data?: any; - /** HTTP Header , header 中不能设置 Referer */ - header?: RequestHeader; - /** 默认是GET,有效值为: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT */ - method?: string; - /** - * 子协议数组 - * @version 1.4.0 - */ - protocols?: string[]; - } - /** - * 创建一个 WebSocket 连接; - * 一个微信小程序同时只能有一个 WebSocket 连接, - * 如果当前已存在一个 WebSocket 连接, - * 会自动关闭该连接,并重新创建一个 WebSocket 连接。 - */ - function connectSocket(options: ConnectSocketOptions): void; - /** 监听WebSocket连接打开事件。 */ - function onSocketOpen(callback: () => void): void; - /** 监听WebSocket错误。 */ - function onSocketError(callback: (error: any) => void): void; - interface SendSocketMessageOptions extends BaseOptions { - /** 需要发送的内容 */ - data: string; - } - /** - * 通过 WebSocket 连接发送数据,需要先 wx.connectSocket, - * 并在 wx.onSocketOpen 回调之后才能发送。 - */ - function sendSocketMessage(options: SendSocketMessageOptions): void; - /** - * 监听WebSocket接受到服务器的消息事件。 - */ - function onSocketMessage(callback: (res: DataResponse) => void): void; - /** - * 关闭WebSocket连接。 - */ - function closeSocket(): void; - /** 监听WebSocket关闭。 */ - function onSocketClose(callback: () => void): void; - // #endregion - // #region 媒体API列表 - // 媒体-----图片 - type ImageSizeType = 'original' | 'compressed'; - type ImageSourceType = 'album' | 'camera'; - type VideoSourceType = 'album' | 'camera'; - type CameraDevice = 'front' | 'back'; - interface TempFile { - /** 本地文件路径 */ - path: string; - /** 本地文件大小,单位:B */ - size: number; - } - interface TempFilesData { - /** 文件的临时路径 */ - tempFilePaths: string; - /** - * 图片的本地文件列表,每一项是一个 File 对象 - * @version 1.2.0 - */ - tempFiles: TempFile[]; - } - interface ChooseImageOptions extends BaseOptions { - /** 最多可以选择的图片张数,默认9 */ - count?: number; - /** original 原图,compressed 压缩图,默认二者都有 */ - sizeType?: ImageSizeType[]; - /** album 从相册选图,camera 使用相机,默认二者都有 */ - sourceType?: ImageSourceType[]; - /** 成功则返回图片的本地文件路径列表 tempFilePaths */ - success(res: TempFilesData): void; - } - /** - * 从本地相册选择图片或使用相机拍照。 - */ - function chooseImage(options: ChooseImageOptions): void; - interface PreviewImageOptions extends BaseOptions { - /** 当前显示图片的链接,不填则默认为 urls 的第一张 */ - current?: string; - /** 需要预览的图片链接列表 */ - urls: string[]; - } - /** - * 预览图片。 - */ - function previewImage(options: PreviewImageOptions): void; - interface GetImageInfoOptions extends BaseOptions { - /** - * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 - */ - src: string; - } - /** - * 获取图片信息 - */ - function getImageInfo(options: GetImageInfoOptions): void; - interface SaveImageToPhotosAlbumOptions extends BaseOptions { - /** - * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 - */ - filePath: string; - success(res: { - errMsg: string - }): void; - } - /** - * 保存图片到系统相册。 - * 需要用户授权 scope.writePhotosAlbum - * @version 1.2.0 - */ - function saveImageToPhotosAlbum(options: SaveImageToPhotosAlbumOptions): void; - // 媒体-----录音 - interface StartRecordOptions extends BaseOptions { - /** 录音成功后调用,返回录音文件的临时文件路径,res = {tempFilePath: '录音文件的临时路径'} */ - success?(res: TempFileResponse): void; - } - /** - * 开始录音。当主动调用wx.stopRecord, - * 或者录音超过1分钟时自动结束录音,返回录音文件的临时文件路径。 - * 注:文件的临时路径,在小程序本次启动期间可以正常使用, - * 如需持久保存,需在主动调用wx.saveFile,在小程序下次启动时才能访问得到。 - * @deprecated 1.6.0 - */ - function startRecord(options: StartRecordOptions): void; - interface StopRecordOptions extends BaseOptions { - success?(): void; - } - /** - * 主动调用停止录音。 - */ - function stopRecord(options?: StopRecordOptions): void; - type EncodeBitRate = 8000 | 11025 | 12000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000; - interface RecorderManagerStartOptions { - /** - * 指定录音的时长,单位 ms - * 如果传入了合法的 duration - * 在到达指定的 duration 后会自动停止录音,最大值 600000(10 分钟),默认值 60000(1 分钟) - */ - duration?: number; - /** - * 采样率,有效值 8000/16000/44100 - */ - sampleRate?: number; - /** - * 否 录音通道数,有效值 1/2 - */ - numberOfChannels?: number; - /** - * 编码码率 - * 采样率和码率有一定要求,具体有效值如下: - * 采样率 编码码率 - * + 8000 16000 ~ 48000 - * + 11025 16000 ~ 48000 - * + 12000 24000 ~ 64000 - * + 16000 24000 ~ 96000 - * + 22050 32000 ~ 128000 - * + 24000 32000 ~ 128000 - * + 32000 48000 ~ 192000 - * + 44100 64000 ~ 320000 - * + 48000 64000 ~ 320000 - */ - encodeBitRate: number; - /** 音频格式,有效值 aac/mp3 */ - format: string; - /** - * 指定帧大小,单位 KB - * 传入 frameSize 后,每录制指定帧大小的内容后 - * 会回调录制的文件内容,不指定则不会回调。暂仅支持 mp3 格式。 - */ - frameSize: number; - } - interface OnRecorderManagerStopOptions { - tempFilePath: string; - } - interface OnFrameRecordedOptions { - /** 录音分片结果数据 */ - frameBuffer: ArrayBuffer; - /** 当前帧是否正常录音结束前的最后一帧 */ - isLastFrame: boolean; - } - interface RecorderManager { - /** 开始录音 */ - start(options?: RecorderManagerStartOptions): void; - /** 暂停录音 */ - pause(): void; - /** 继续录音 */ - resume(): void; - /** 停止录音 */ - stop(): void; - /** 录音开始事件 */ - onStart(callback?: () => void): void; - /** 录音暂停事件 */ - onPause(callback?: () => void): void; - /** 录音恢复事件 */ - onResume(callback?: () => void): void; - /** 录音停止事件,会回调文件地址 */ - onStop(callback?: (options: OnRecorderManagerStopOptions) => void): void; - /** 已录制完指定帧大小的文件,会回调录音分片结果数据。如果设置了 frameSize ,则会回调此事件 */ - onFrameRecorded(callback?: (options: OnFrameRecordedOptions) => void): void; - /** 录音错误事件, 会回调错误信息 */ - onError(callback?: (err: ErrMsgResponse) => void): void; - } - /** - * 获取全局唯一的录音管理器 recorderManager - * @version 1.6.0 - */ - function getRecorderManager(): RecorderManager; - // 媒体-----音频播放控制 - interface PlayVoiceOptions extends BaseOptions { - /** 需要播放的语音文件的文件路径 */ - filePath: string; - } - /** - * 开始播放语音,同时只允许一个语音文件正在播放, - * 如果前一个语音文件还没播放完,将中断前一个语音播放。 - * @deprecated 1.6.0 - */ - function playVoice(options: PlayVoiceOptions): void; - /** - * 暂停正在播放的语音。 - * 再次调用wx.playVoice播放同一个文件时,会从暂停处开始播放。 - * 如果想从头开始播放,需要先调用 wx.stopVoice。 - * @deprecated 1.6.0 - */ - function pauseVoice(): void; - /** - * 结束播放语音。 - * @deprecated 1.6.0 - */ - function stopVoice(): void; - // 媒体-----音乐播放控制 - interface BackgroundAudioPlayerState { - /** 选定音频的长度(单位:s),只有在当前有音乐播放时返回 */ - duration: number; - /** 选定音频的播放位置(单位:s),只有在当前有音乐播放时返回 */ - currentPosition: number; - /** 播放状态(2:没有音乐在播放,1:播放中,0:暂停中) */ - status: number; - /** 音频的下载进度(整数,80 代表 80%),只有在当前有音乐播放时返回 */ - downloadPercent: number; - /** 歌曲数据链接,只有在当前有音乐播放时返回 */ - dataUrl: string; - } - interface GetBackgroundAudioPlayerStateOptions extends BaseOptions { - /** 接口调用成功的回调函数 */ - success?(state: BackgroundAudioPlayerState): void; - /** 接口调用失败的回调函数 */ - fail?(): void; - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?(): void; - } - /** - * 获取音乐播放状态。 - * @deprecated 1.2.0 - */ - function getBackgroundAudioPlayerState(options: GetBackgroundAudioPlayerStateOptions): void; - interface PlayBackgroundAudioOptions extends BaseOptions { - /** 音乐链接 */ - dataUrl: string; - /** 音乐标题 */ - title?: string; - /** 封面URL */ - coverImgUrl?: string; - } - /** - * 播放音乐,同时只能有一首音乐正在播放。 - * @deprecated 1.2.0 - */ - function playBackgroundAudio(options: PlayBackgroundAudioOptions): void; - /** - * 暂停播放音乐。 - * @deprecated 1.2.0 - */ - function pauseBackgroundAudio(options?: PlayBackgroundAudioOptions): void; - interface SeekBackgroundAudioOptions extends BaseOptions { - /** 音乐位置,单位:秒 */ - position: number; - } - /** - * 控制音乐播放进度。 - * @deprecated 1.2.0 - */ - function seekBackgroundAudio(options: SeekBackgroundAudioOptions): void; - /** - * 停止播放音乐。 - * @deprecated 1.2.0 - */ - function stopBackgroundAudio(options?: PlayBackgroundAudioOptions): void; - /** - * 监听音乐播放。 - * @deprecated 1.2.0 - */ - function onBackgroundAudioPlay(callback: () => void): void; - /** - * 监听音乐暂停。 - * @deprecated 1.2.0 - */ - function onBackgroundAudioPause(callback: () => void): void; - /** - * 监听音乐停止。 - * @deprecated 1.2.0 - */ - function onBackgroundAudioStop(callback: () => void): void; - interface BackgroundAudioManager { - /** 当前音频的长度(单位:s),只有在当前有合法的 src 时返回 */ - readonly duration: number; - /** 当前音频的播放位置(单位:s),只有在当前有合法的 src 时返回 */ - readonly currentTime: number; - /** 当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播放 */ - readonly paused: boolean; - /** 音频的数据源,默认为空字符串,当设置了新的 src 时,会自动开始播放 ,目前支持的格式有 m4a, aac, mp3, wav */ - src: string; - /** 音频开始播放的位置(单位:s) */ - startTime: number; - /** 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲。 是 */ - buffered: number; - /** 音频标题,用于做原生音频播放器音频标题。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 */ - title: string; - /** 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ - epname: string; - /** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ - singer: string; - /** 封面图url,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 */ - coverImgUrl: string; - /** 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ - webUrl: string; - /** 播放 */ - play(): void; - /** 暂停 */ - pause(): void; - /** 停止 */ - stop(): void; - /** 跳转到指定位置,单位 s */ - seek(position: number): void; - /** 背景音频进入可以播放状态,但不保证后面可以流畅播放 */ - onCanplay(callback?: () => void): void; - /** 背景音频播放事件 */ - onPlay(callback?: () => void): void; - /** 背景音频暂停事件 */ - onPause(callback?: () => void): void; - /** 背景音频停止事件 */ - onStop(callback?: () => void): void; - /** 背景音频自然播放结束事件 */ - onEnded(callback?: () => void): void; - /** 背景音频播放进度更新事件 */ - onTimeUpdate(callback?: () => void): void; - /** 用户在系统音乐播放面板点击上一曲事件(iOS only) */ - onPrev(callback?: () => void): void; - /** 用户在系统音乐播放面板点击下一曲事件(iOS only) */ - onNext(callback?: () => void): void; - /** 背景音频播放错误事件 */ - onError(callback?: () => void): void; - /** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 */ - onWaiting(callback?: () => void): void; - } - /** - * 获取全局唯一的背景音频管理器 backgroundAudioManager。 - * @version 1.2.0 - */ - function getBackgroundAudioManager(): BackgroundAudioManager; - // 媒体-----音频组件控制 - /** - * audioContext 通过 audioId 跟一个