diff --git a/notNeededPackages.json b/notNeededPackages.json index e0e880c3e6..e1a2f2e6cd 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1278,6 +1278,12 @@ "sourceRepoURL": "https://github.com/zalmoxisus/redux-devtools-extension", "asOfVersion": "2.13.2" }, + { + "libraryName": "redux-little-router", + "typingsPackageName": "redux-little-router", + "sourceRepoURL": "https://github.com/FormidableLabs/redux-little-router", + "asOfVersion": "15.1.0" + }, { "libraryName": "redux-persist", "typingsPackageName": "redux-persist", diff --git a/react-table-filter/index.d.ts b/react-table-filter/index.d.ts deleted file mode 100644 index 8f9c50a26f..0000000000 --- a/react-table-filter/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for react-table-filter 1.0.0 -// Project: https://github.com/cheekujha/react-table-filter -// Definitions by: Gnanavel N -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import * as React from 'react'; - -export interface TabfilterProps { - rows: string | Array | { [name: string]: boolean; }; - onFilterUpdate: (filteredArray: Array, currentFilters: any[]) => any[] | void; - rowClass?: string; - initialFilters?: string | Array | { [name: string]: boolean; }; -} - -export declare class TableFilter extends React.Component {} \ No newline at end of file diff --git a/types/abstract-leveldown/abstract-leveldown-tests.ts b/types/abstract-leveldown/abstract-leveldown-tests.ts index c5edadf069..070065f425 100644 --- a/types/abstract-leveldown/abstract-leveldown-tests.ts +++ b/types/abstract-leveldown/abstract-leveldown-tests.ts @@ -11,3 +11,7 @@ const test = (levelDown: AbstractLevelDOWN) => { test(new AbstractLevelDOWN('here')); // $ExpectType void test(AbstractLevelDOWN('there')); +// $ExpectType void +test(new AbstractLevelDOWN('here')); +// $ExpectType void +test(AbstractLevelDOWN('there')); diff --git a/types/abstract-leveldown/index.d.ts b/types/abstract-leveldown/index.d.ts index 2caf073432..ad8fab5d74 100644 --- a/types/abstract-leveldown/index.d.ts +++ b/types/abstract-leveldown/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Meirion Hughes // Daniel Byrne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 export interface AbstractOptions { readonly [k: string]: any; @@ -21,7 +22,7 @@ export interface AbstractGetOptions extends AbstractOptions { asBuffer?: boolean; } -export interface AbstractLevelDOWN extends AbstractOptions { +export interface AbstractLevelDOWN extends AbstractOptions { open(cb: ErrorCallback): void; open(options: AbstractOpenOptions, cb: ErrorCallback): void; @@ -38,17 +39,23 @@ export interface AbstractLevelDOWN extends AbstractOptions { batch(): AbstractChainedBatch; batch(array: ReadonlyArray>, cb: ErrorCallback): AbstractChainedBatch; - batch(array: ReadonlyArray>, options: AbstractOptions, cb: ErrorCallback): AbstractChainedBatch; + batch( + array: ReadonlyArray>, + options: AbstractOptions, + cb: ErrorCallback, + ): AbstractChainedBatch; iterator(options?: AbstractIteratorOptions): AbstractIterator; } export interface AbstractLevelDOWNConstructor { - new (location: string): AbstractLevelDOWN; - (location: string): AbstractLevelDOWN; + // tslint:disable-next-line no-unnecessary-generics + new (location: string): AbstractLevelDOWN; + // tslint:disable-next-line no-unnecessary-generics + (location: string): AbstractLevelDOWN; } -export interface AbstractIteratorOptions extends AbstractOptions { +export interface AbstractIteratorOptions extends AbstractOptions { gt?: K; gte?: K; lt?: K; @@ -61,20 +68,20 @@ export interface AbstractIteratorOptions extends AbstractOptions { valueAsBuffer?: boolean; } -export type AbstractBatch = PutBatch | DelBatch; +export type AbstractBatch = PutBatch | DelBatch; -export interface PutBatch { +export interface PutBatch { readonly type: 'put'; readonly key: K; readonly value: V; } -export interface DelBatch { +export interface DelBatch { readonly type: 'del'; readonly key: K; } -export interface AbstractChainedBatch extends AbstractChainedBatchConstructor, AbstractOptions { +export interface AbstractChainedBatch extends AbstractOptions { put: (key: K, value: V) => this; del: (key: K) => this; clear: () => this; @@ -83,19 +90,23 @@ export interface AbstractChainedBatch extends AbstractChainedBatchConstruc } export interface AbstractChainedBatchConstructor { - new(db: any): AbstractChainedBatch; - (db: any): AbstractChainedBatch; + // tslint:disable-next-line no-unnecessary-generics + new (db: any): AbstractChainedBatch; + // tslint:disable-next-line no-unnecessary-generics + (db: any): AbstractChainedBatch; } -export interface AbstractIterator extends AbstractChainedBatchConstructor { +export interface AbstractIterator extends AbstractOptions { db: AbstractLevelDOWN; next(cb: ErrorKeyValueCallback): this; end(cb: ErrorCallback): void; } export interface AbstractIteratorConstructor { - new(db: any): AbstractIterator; - (db: any): AbstractIterator; + // tslint:disable-next-line no-unnecessary-generics + new (db: any): AbstractIterator; + // tslint:disable-next-line no-unnecessary-generics + (db: any): AbstractIterator; } export const AbstractLevelDOWN: AbstractLevelDOWNConstructor; diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 94575006ab..5fa225eafd 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -400,10 +400,10 @@ cognitoUserPoolEvent.request.session![0].challengeName === "DEVICE_SRP_AUTH"; cognitoUserPoolEvent.request.session![0].challengeName === "DEVICE_PASSWORD_VERIFIER"; cognitoUserPoolEvent.request.session![0].challengeName === "ADMIN_NO_SRP_AUTH"; bool = cognitoUserPoolEvent.request.session![0].challengeResult; -strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetaData; +strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetadata; strOrUndefined = cognitoUserPoolEvent.request.challengeName; str = cognitoUserPoolEvent.request.privateChallengeParameters!["answer"]; -str = cognitoUserPoolEvent.request.challengeAnswer!["answer"]; +str = cognitoUserPoolEvent.request.challengeAnswer!; boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect; strOrUndefined = cognitoUserPoolEvent.response.smsMessage; strOrUndefined = cognitoUserPoolEvent.response.emailMessage; @@ -413,7 +413,7 @@ boolOrUndefined = cognitoUserPoolEvent.response.issueTokens; boolOrUndefined = cognitoUserPoolEvent.response.failAuthentication; str = cognitoUserPoolEvent.response.publicChallengeParameters!["captchaUrl"]; str = cognitoUserPoolEvent.response.privateChallengeParameters!["answer"]; -strOrUndefined = cognitoUserPoolEvent.response.challengeMetaData; +strOrUndefined = cognitoUserPoolEvent.response.challengeMetadata; boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect; // CloudFormation Custom Resource @@ -581,7 +581,7 @@ const CodePipelineEvent: AWSLambda.CodePipelineEvent = { CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' }; /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ -const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { +const CloudFrontRequestWithCustomOriginEvent: AWSLambda.CloudFrontRequestEvent = { Records: [ { cf: { @@ -630,7 +630,44 @@ const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { "TLSv1", "TLSv1.1" ] - }, + } + } + } + } + } + ] +}; + +const CloudFrontRequestWithS3OriginEvent: AWSLambda.CloudFrontRequestEvent = { + Records: [ + { + cf: { + config: { + distributionDomainName: "d123.cloudfront.net", + distributionId: "EDFDVBD6EXAMPLE", + eventType: "viewer-request", + requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" + }, + request: { + clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334", + method: "GET", + uri: "/picture.jpg", + querystring: "size=large", + headers: { + host: [ + { + key: "Host", + value: "d111111abcdef8.cloudfront.net" + } + ], + "user-agent": [ + { + key: "User-Agent", + value: "curl/7.51.0" + } + ] + }, + origin: { s3: { authMethod: "origin-access-identity", customHeaders: { @@ -812,6 +849,56 @@ apiGtwProxyHandler = proxyHandler; const codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; const cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { + event = CloudFrontRequestWithCustomOriginEvent; + // $ExpectType CloudFrontRequestEvent + event; + let request = event.Records[0].cf.request; + + let s3Origin: AWSLambda.CloudFrontS3Origin = { + authMethod: 'none', + customHeaders: {}, + domainName: 'example.com', + path: '/', + region: 'us-east-1' + }; + + if (request.origin && request.origin.custom) { + request.origin.custom.domainName; + request.origin.custom.domainName = "example2.com"; + + // $ExpectError + s3Origin = request.origin.s3; + + // $ExpectError + request.origin.s3.path = '/'; + } + + let customOrigin: AWSLambda.CloudFrontCustomOrigin = { + customHeaders: {}, + domainName: 'example.com', + keepaliveTimeout: 60, + path: '/', + port: 80, + protocol: 'http', + readTimeout: 30, + sslProtocols: [] + }; + + event = CloudFrontRequestWithS3OriginEvent; + // $ExpectType CloudFrontRequestEvent + event; + request = event.Records[0].cf.request; + if (request.origin && request.origin.s3) { + request.origin.s3.path; + request.origin.s3.path = "/new_path"; + + // $ExpectError + customOrigin = request.origin.custom; + + // $ExpectError + request.origin.custom.path = '/'; + } + cb(); cb(null); cb(new Error('')); diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 35d0b1d7a6..cce721e68c 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -21,6 +21,7 @@ // Jeremy Nagel // Louis Larry // Daniel Papukchiev +// Oliver Hookins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -250,11 +251,11 @@ export interface CognitoUserPoolTriggerEvent { session?: Array<{ challengeName: "CUSTOM_CHALLENGE" | "PASSWORD_VERIFIER" | "SMS_MFA" | "DEVICE_SRP_AUTH" | "DEVICE_PASSWORD_VERIFIER" | "ADMIN_NO_SRP_AUTH"; challengeResult: boolean; - challengeMetaData?: string; + challengeMetadata?: string; }>; challengeName?: string; privateChallengeParameters?: { [key: string]: string }; - challengeAnswer?: { [key: string]: string }; + challengeAnswer?: string; }; response: { autoConfirmUser?: boolean; @@ -266,7 +267,7 @@ export interface CognitoUserPoolTriggerEvent { failAuthentication?: boolean; publicChallengeParameters?: { [key: string]: string }; privateChallengeParameters?: { [key: string]: string }; - challengeMetaData?: string; + challengeMetadata?: string; answerCorrect?: boolean; }; } @@ -561,6 +562,9 @@ export interface CodePipelineEvent { /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html + * Bear in mind that the "example" event structure in the page above includes + * both an S3 and a Custom origin, which is not strictly allowed. Only one + * of these per event may be present. */ export interface CloudFrontHeaders { [name: string]: Array<{ @@ -569,6 +573,29 @@ export interface CloudFrontHeaders { }>; } +export type CloudFrontOrigin = + | { s3: CloudFrontS3Origin, custom?: never } + | { custom: CloudFrontCustomOrigin, s3?: never }; + +export interface CloudFrontCustomOrigin { + customHeaders: CloudFrontHeaders; + domainName: string; + keepaliveTimeout: number; + path: string; + port: number; + protocol: 'http' | 'https'; + readTimeout: number; + sslProtocols: string[]; +} + +export interface CloudFrontS3Origin { + authMethod: 'origin-access-identity' | 'none'; + customHeaders: CloudFrontHeaders; + domainName: string; + path: string; + region: string; +} + export interface CloudFrontResponse { status: string; statusDescription: string; @@ -581,6 +608,7 @@ export interface CloudFrontRequest { uri: string; querystring: string; headers: CloudFrontHeaders; + origin?: CloudFrontOrigin; } export interface CloudFrontEvent { diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 9576ba7289..cc24c6573b 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -1,4 +1,3 @@ -import bigi = require('bigi'); import bitcoin = require('bitcoinjs-lib'); // For testing only @@ -8,19 +7,18 @@ function rng() { // Generate a random bitcoin address const keyPair1 = bitcoin.ECPair.makeRandom({rng}); -const address = keyPair1.getAddress(); +const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair1.publicKey }); keyPair1.toWIF(); // Generate an address from a SHA256 hash const hash = bitcoin.crypto.sha256(Buffer.from('correct horse battery staple', 'utf8')); -const d = bigi.fromBuffer(hash); -const keyPair2 = new bitcoin.ECPair(d); +const keyPair2 = bitcoin.ECPair.fromPrivateKey(hash); // Generate a random keypair for alternative networks -const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.litecoin, rng}); +const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.testnet, rng}); keyPair3.toWIF(); -keyPair3.getAddress(); -const network = keyPair3.getNetwork(); +bitcoin.payments.p2pkh({ pubkey: keyPair3.publicKey }); +const network = keyPair3.network; // Test TransactionBuilder and Transaction const txb = new bitcoin.TransactionBuilder(); @@ -41,22 +39,3 @@ bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version); bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix); bitcoin.address.toOutputScript(address); bitcoin.address.toOutputScript(address, network); - -const redeemScript = bitcoin.script.multisig.output.encode( - 2, - [ - new Buffer('12345678901234567890123456789012'), - new Buffer('12345678901234567890123456789012'), - new Buffer('12345678901234567890123456789012'), - ] -); -bitcoin.script.scriptHash.input.encode( - bitcoin.script.multisig.input.encodeStack( - [ - new Buffer('12345678901234567890123456789012'), - new Buffer('12345678901234567890123456789012'), - ], - redeemScript, - ), - redeemScript, -); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 2d0603b87c..4fb1bb16a7 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bitcoinjs-lib 3.4 +// Type definitions for bitcoinjs-lib 4.0 // Project: https://github.com/bitcoinjs/bitcoinjs-lib // Definitions by: Mohamed Hegazy // Daniel @@ -12,8 +12,6 @@ /// -import BigInteger = require('bigi'); - export interface Out { script: Buffer; value: number; @@ -68,29 +66,23 @@ export class Block { } export class ECPair { - constructor(d: BigInteger, Q?: null, options?: { compressed?: boolean, network?: Network }); - - constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type - - d: BigInteger; - readonly compressed: boolean; + readonly privateKey: Buffer; + + readonly publicKey: Buffer; + readonly network: Network; - getAddress(): string; - - getNetwork(): Network; - - getPublicKeyBuffer(): Buffer; - - sign(hash: Buffer): ECSignature; + sign(hash: Buffer): Buffer; toWIF(): string; - verify(hash: Buffer, signature: ECSignature): boolean; + verify(hash: Buffer, signature: Buffer): boolean; - static fromPublicKeyBuffer(buffer: Buffer, network: Network): ECPair; + static fromPrivateKey(buffer: Buffer, options?: { compressed?: boolean, network?: Network }): ECPair; + + static fromPublicKey(buffer: Buffer, options?: { compressed?: boolean, network?: Network }): ECPair; static fromWIF(string: string, network?: Network): ECPair; @@ -99,66 +91,6 @@ export class ECPair { export type Rng = (size: number) => Buffer; -export class ECSignature { - constructor(r: BigInteger, s: BigInteger); - - toCompact(i: number, compressed: boolean): Buffer; - - toDER(): Buffer; - - toScriptSignature(hashType: number): Buffer; - - static fromDER(buffer: Buffer): ECSignature; - - static parseCompact(buffer: Buffer): { compressed: boolean, i: number, signature: ECSignature }; - - static parseScriptSignature(buffer: Buffer): { signature: ECSignature, hashType: number }; -} - -export class HDNode { - constructor(keyPair: ECPair, chainCode: Buffer); - - keyPair: ECPair; - - derive(index: number): HDNode; - - deriveHardened(index: number): HDNode; - - derivePath(path: string): HDNode; - - getAddress(): string; - - getFingerprint(): Buffer; - - getIdentifier(): Buffer; - - getNetwork(): Network; - - getPublicKeyBuffer(): Buffer; - - isNeutered(): boolean; - - neutered(): HDNode; - - sign(hash: Buffer): ECSignature; - - toBase58(): string; - - verify(hash: Buffer, signature: ECSignature): boolean; - - static HIGHEST_BIT: number; - - static LENGTH: number; - - static fromBase58(string: string, networks?: Network[] | Network): HDNode; - - static fromSeedBuffer(seed: Buffer, network?: Network): HDNode; - - static fromSeedHex(hex: string, network?: Network): HDNode; - - static MASTER_SECRET: Buffer; -} - export class Transaction { version: number; locktime: number; @@ -236,9 +168,6 @@ export interface Input { } export class TransactionBuilder { - tx: Transaction; - inputs: Input[]; - constructor(network?: Network, maximumFeeRate?: number); addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number; @@ -261,7 +190,6 @@ export class TransactionBuilder { export const networks: { bitcoin: Network; - litecoin: Network; testnet: Network; }; @@ -391,7 +319,7 @@ export namespace address { /** @since 3.2.0 */ function fromBech32(address: string): { data: Buffer, prefix: string, version: number }; - function fromOutputScript(outputScript: Buffer, network?: Network): string; + function fromOutputScript(output: Buffer, network?: Network): string; function toBase58Check(hash: Buffer, version: number): string; @@ -401,26 +329,6 @@ export namespace address { function toOutputScript(address: string, network?: Network): Buffer; } -export namespace bufferutils { - function pushDataSize(i: number): number; - - function readPushDataInt(buffer: Buffer, offset: number): { opcode: number, number: number, size: number }; - - function readUInt64LE(buffer: Buffer, offset: number): number; - - function readVarInt(buffer: Buffer, offset: number): { number: number, size: number }; - - function varIntBuffer(number: number, buffer: Buffer, offset: number): Buffer; - - function varIntSize(number: number): number; - - function writePushDataInt(buffer: Buffer, number: number, offset: number): number; - - function writeUInt64LE(buffer: Buffer, value: number, offset: number): number; - - function writeVarInt(buffer: Buffer, number: number, offset: number): number; -} - export namespace crypto { function hash160(buffer: Buffer): Buffer; @@ -449,7 +357,7 @@ export namespace script { function isCanonicalPubKey(buffer: Buffer): boolean; - function isCanonicalSignature(buffer: Buffer): boolean; + function isCanonicalScriptSignature(buffer: Buffer): boolean; function isDefinedHashType(hashType: any): boolean; @@ -465,66 +373,48 @@ export namespace script { function encode(number: number): Buffer; } + namespace signature { + function decode(buffer: Buffer): { signature: Buffer, hashType: number }; + + function encode(signature: Buffer, hashType: number): Buffer; + } + const multisig: { input: { check(script: Buffer, allowIncomplete: boolean): boolean; - decode(buffer: Buffer): Array; - decodeStack(stack: Buffer[], allowIncomplete: boolean): Array; - encode(signatures: Buffer[], scriptPubKey: Buffer): Buffer; - encodeStack(signatures: Buffer[], scriptPubKey: Buffer): Buffer[]; }; output: { check(script: Buffer, allowIncomplete: boolean): boolean; - decode(buffer: Buffer, allowIncomplete: boolean): { m: number; pubKeys: Array }; - encode(m: number, pubKeys: Array): Buffer; }; }; const pubKey: { input: { check(script: Buffer): boolean; - decode(buffer: Buffer): Array; - decodeStack(stack: Buffer[]): Array; - encode(signature: Buffer): Buffer; - encodeStack(signature: Buffer): Buffer[]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer | number; - encode(pubKey: Buffer): Buffer; }; }; const pubKeyHash: { input: { check(script: Buffer): boolean; - decode(buffer: Buffer): { signature: Buffer; pubKey: Buffer }; - decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; - encode(signature: Buffer, pubKey: Buffer): Buffer; - encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(pubKeyHash: Buffer): Buffer; }; }; const scriptHash: { input: { check(script: Buffer, allowIncomplete: boolean): boolean; - decode(buffer: Buffer): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - encode(redeemScriptSig: Array, redeemScript: Buffer): Buffer; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(scriptHash: Buffer): Buffer; }; }; @@ -539,36 +429,56 @@ export namespace script { const witnessPubKeyHash: { input: { check(script: Buffer): boolean; - decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; - encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(pubKeyHash: Buffer): Buffer; }; }; const witnessScriptHash: { input: { check(script: Buffer, allowIncomplete: boolean): boolean; - decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(scriptHash: Buffer): Buffer; }; }; const nullData: { output: { check(script: Buffer): boolean; - decode(buffer: Buffer): Buffer; - encode(data: Buffer): Buffer; }; }; } + +export namespace payments { + function p2data(a: { network?: Network, output?: Buffer, data?: Buffer[] }, opts?: { validate?: boolean }): + { output: Buffer, data: Buffer[] }; + + function p2ms(a: { network?: Network, m?: number, n?: number, output?: Buffer, pubkeys?: Buffer[], signatures?: Buffer[], input?: Buffer }, opts?: { validate?: boolean }): + { output: Buffer, m: number, n: number, pubkeys: Buffer[], signatures: Buffer[], input: Buffer, witness: Buffer[] }; + + function p2pk(a: { input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer }, opts?: { validate?: boolean }): + { output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] }; + + function p2pkh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer }, opts?: { validate?: boolean }): + { address: string, hash: Buffer, output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] }; + + function p2sh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, witness?: Buffer[], redeem?: Redeem }, opts?: { validate?: boolean }): + { address: string, hash: Buffer, output: Buffer, redeem: Redeem, input: Buffer, witness: Buffer[] }; + + function p2wpkh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer, witness?: Buffer[] }, + opts?: { validate?: boolean }): { address: string, hash: Buffer, output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] }; + + function p2wsh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, witness?: Buffer[], redeem?: Redeem }, opts?: { validate?: boolean }): + { address: string, hash: Buffer, output: Buffer, redeem: Redeem, input: Buffer, witness: Buffer[] }; + + class Redeem { + input?: Buffer; + network?: Network; + output?: Buffer; + witness?: Buffer[]; + } +} diff --git a/types/bloom-filter/bloom-filter-tests.ts b/types/bloom-filter/bloom-filter-tests.ts new file mode 100644 index 0000000000..0b836a0f84 --- /dev/null +++ b/types/bloom-filter/bloom-filter-tests.ts @@ -0,0 +1,28 @@ +import BloomFilter = require('bloom-filter'); + +const numElements = 3; +const falsePositiveRate = 0.01; +const filter = BloomFilter.create(numElements, falsePositiveRate); + +// elements +const a = Buffer.from('99108ad8ed9bb6274d3980bab5a85c048f0950c8', 'hex'); +const c = Buffer.from('b5a2c786d9ef4658287ced5914b37a1b4aa32eee', 'hex'); + +// insert elements +// $ExpectType void +filter.insert(a); + +// $ExpectType boolean +!filter.contains(c); + +// reinstantiate from an object +const serialized = filter.toObject(); +const woahFilter = new BloomFilter(serialized); + +// initialize directly +const newFilter = new BloomFilter({ + vData: Buffer.from('123', 'hex'), // the data of the filter + nHashFuncs: 3, // the number of hash functions to use + nTweak: 2147483649, // the seed used for the hash fuctions + nFlags: 0 // flags used to update the filter when matched +}); diff --git a/types/bloom-filter/index.d.ts b/types/bloom-filter/index.d.ts new file mode 100644 index 0000000000..22841f066b --- /dev/null +++ b/types/bloom-filter/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for bloom-filter 0.2 +// Project: https://github.com/bitpay/bloom-filter +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare class Filter { + constructor(options: Filter.FilterOptions); + static create(elements: number, falsePositiveRate: number, nTweak?: number, nFlags?: number): Filter; + toObject(): Filter.FilterOptions; + hash(nHashNum: number, vDataToHash: Buffer): number; + insert(data: Buffer): void; + contains(data: Buffer): boolean; + clear(): void; + inspect(): string; + BLOOM_UPDATE_NONE: number; + BLOOM_UPDATE_ALL: number; + BLOOM_UPDATE_P2PUBKEY_ONLY: number; + MAX_BLOOM_FILTER_SIZE: number; + MAX_HASH_FUNCS: number; + MIN_HASH_FUNCS: number; + LN2SQUARED: number; + LN2: number; +} + +declare namespace Filter { + interface FilterOptions { + vData: Buffer; + nHashFuncs: number; + nTweak?: number; + nFlags?: number; + } + + function MurmurHash3(seed: number, data: Buffer): number; +} + +export = Filter; diff --git a/types/bloom-filter/tsconfig.json b/types/bloom-filter/tsconfig.json new file mode 100644 index 0000000000..788542822b --- /dev/null +++ b/types/bloom-filter/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bloom-filter-tests.ts" + ] +} diff --git a/react-table-filter/tslint.json b/types/bloom-filter/tslint.json similarity index 100% rename from react-table-filter/tslint.json rename to types/bloom-filter/tslint.json diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index aa6cd54eb7..49027a2bea 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -391,6 +391,8 @@ declare namespace Chart { easing?: string; onProgress?(chart: any): void; onComplete?(chart: any): void; + animateRotate?: boolean; + animateScale?: boolean; } interface ChartElementsOptions { diff --git a/types/create-subscription/create-subscription-tests.tsx b/types/create-subscription/create-subscription-tests.tsx index 891adc5ede..d1b3d3bda0 100644 --- a/types/create-subscription/create-subscription-tests.tsx +++ b/types/create-subscription/create-subscription-tests.tsx @@ -105,15 +105,7 @@ declare const wrongPromise: Promise; ; // $ExpectError -const MismatchSubscription = createSubscription({ - getCurrentValue: (a: number) => null, - subscribe: (a: string, callback) => (() => undefined) -}); +const MismatchSubscription = createSubscription({ getCurrentValue: (a: number) => null, subscribe: (a: string, callback) => (() => undefined) }); // $ExpectError -const NoUnsubscribe = createSubscription({ - getCurrentValue: (a: number) => a, - subscribe: (a: number, callback) => { - // oops, should've returned a callback here - } -}); +const NoUnsubscribe = createSubscription({ getCurrentValue: (a: number) => a, subscribe: (a: number, callback) => { /* oops, should've returned a callback here */ }}); diff --git a/types/elliptic/elliptic-tests.ts b/types/elliptic/elliptic-tests.ts new file mode 100644 index 0000000000..d587be5e8d --- /dev/null +++ b/types/elliptic/elliptic-tests.ts @@ -0,0 +1,47 @@ +import elliptic = require('elliptic'); + +const ec = new elliptic.ec('secp256k1'); + +// Generate keys +const key = ec.genKeyPair(); + +// Sign the message's hash (input must be an array, or a hex-string) +const msgHash = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const signature = key.sign(msgHash); + +// Export DER encoded signature in Array +const derSign = signature.toDER(); + +// Verify signature +console.log(key.verify(msgHash, derSign)); + +// CHECK WITH NO PRIVATE KEY + +const pubPoint = key.getPublic(); +const x = pubPoint.getX(); +const y = pubPoint.getY(); + +// Public Key MUST be either: +// 1) '04' + hex string of x + hex string of y; or +// 2) object with two hex string properties (x and y); or +// 3) object with two buffer properties (x and y) +const pub = pubPoint.encode('hex'); // case 1 +const aPub = { x: x.toString('hex'), y: y.toString('hex') }; // case 2 +const bPub = { x: x.toBuffer(), y: y.toBuffer() }; // case 3 +const cPub = { x: x.toArrayLike(Buffer), y: y.toArrayLike(Buffer) }; // case 3 + +// Import public key +const newKey = ec.keyFromPublic(pub, 'hex'); + +// Signature MUST be either: +// 1) DER-encoded signature as hex-string; or +// 2) DER-encoded signature as buffer; or +// 3) object with two hex-string properties (r and s); or +// 4) object with two buffer properties (r and s) + +// const signature = '3046022100...'; // case 1 +// const signature = new Buffer('...'); // case 2 +// const signature = { r: 'b1fc...', s: '9c42...' }; // case 3 + +// Verify signature +console.log(key.verify(msgHash, signature)); diff --git a/types/elliptic/index.d.ts b/types/elliptic/index.d.ts new file mode 100644 index 0000000000..f819d17497 --- /dev/null +++ b/types/elliptic/index.d.ts @@ -0,0 +1,158 @@ +// Type definitions for elliptic 6.4 +// Project: https://github.com/indutny/elliptic +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import BN = require('bn.js'); + +// incomplete typings +export const utils: any; +export const rand: any; +export const eddsa: any; + +export type BNInput = string | BN | number | Buffer | number[]; + +export const version: number; + +export namespace curve { + class BaseCurve { + constructor(type: string, conf: BaseCurve.BaseCurveOptions) + p: BN; + type: string; + red: any; // ? + zero: any; // ? + one: any; // ? + two: any; // ? + n: BN | undefined | null; + g: any; // ? + redN: any; // ? + decodePoint(bytes: any, enc: string): any; // ? + } + + namespace BaseCurve { + class BasePoint { + constructor(curve: any, type: string); + curve: any; + type: string; + precomputed: PrecomputedValues | null; + encode(enc: string, compact: boolean): BN; + encodeCompressed(enc: string): BN; + validate(): boolean; + precompute(power: number): BasePoint; + dblp(k: any): any; // ? + } + + interface BaseCurveOptions { + p: number | string | number[] | Buffer | BN; + prime?: BN | string; + n?: number | BN | Buffer; + g?: any; // ? + gRed?: any; // ? + } + + interface PrecomputedValues { + doubles: any; // ? + naf: any; // ? + beta: any; // ? + } + } +} + +export namespace curves { + class PresetCurve { + constructor(options: PresetCurve.Options) + type: string; + g: any; // ? + n: BN | undefined | null; + hash: any; // ? + } + + namespace PresetCurve { + interface Options { + type: string; + prime: string | null; + p: string; + a: string; + b: string; + n: string; + hash: any; + gRed: boolean; + g: any; // ? + beta?: string; + lambda?: string; + basis?: any; // ? + } + } +} + +export class ec { + constructor(options: string | curves.PresetCurve) + curve: any; + n: BN | undefined | null; + nh: any; + g: any; + hash: any; + + keyPair(options: ec.KeyPairOptions): ec.KeyPair; + keyFromPrivate(priv: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; + keyFromPublic(pub: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; + genKeyPair(options?: ec.GenKeyPairOptions): ec.KeyPair; + sign(msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions): ec.Signature; + sign(msg: BNInput, key: Buffer | ec.KeyPair, options?: ec.SignOptions): ec.Signature; + verify(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, key: Buffer | ec.KeyPair, enc?: string): boolean; + recoverPubKey(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, j: number, enc?: string): any; + getKeyRecoveryParam(e: Error | undefined, signature: ec.Signature | ec.SignatureOptions, Q: BN, enc?: string): number; +} + +export namespace ec { + interface GenKeyPairOptions { + pers: any; + entropy: any; + persEnc?: string; + entropyEnc?: string; + } + + interface SignOptions { + pers: any; + persEnc?: string; + canonical?: boolean; + k?: BN; + } + + class KeyPair { + static fromPublic(ec: ec, pub: Buffer | KeyPair, enc?: string): KeyPair; + static fromPrivate(ec: ec, priv: Buffer | KeyPair, enc?: string): KeyPair; + constructor(ec: ec, options: KeyPairOptions) + ec: ec; + validate(): { readonly result: boolean, readonly reason: string }; + getPublic(compact: boolean, enc?: string): any; // ? + getPublic(enc?: string): any; // ? + getPrivate(enc?: 'hex'): Buffer | BN | string; + derive(pub: any): any; // ? + sign(msg: BNInput, enc: string, options?: SignOptions): Signature; + sign(msg: BNInput, options?: SignOptions): Signature; + verify(msg: BNInput, signature: Signature | SignatureOptions): boolean; + inspect(): string; + } + + class Signature { + constructor(options: SignatureOptions | Signature, enc?: string) + r: BN; + s: BN; + recoveryParam: number | null; + toDER(enc?: string | null): any; // ? + } + + interface SignatureOptions { + r: number; + s: number; + recoveryParam?: number; + } + + interface KeyPairOptions { + priv?: Buffer; + privEnc?: string; + pub?: Buffer; + pubEnc?: string; + } +} diff --git a/types/elliptic/tsconfig.json b/types/elliptic/tsconfig.json new file mode 100644 index 0000000000..505cd03374 --- /dev/null +++ b/types/elliptic/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", + "elliptic-tests.ts" + ] +} diff --git a/types/elliptic/tslint.json b/types/elliptic/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/elliptic/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ember-resolver/ember-resolver-tests.ts b/types/ember-resolver/ember-resolver-tests.ts index d22a0d31be..6973daeda0 100644 --- a/types/ember-resolver/ember-resolver-tests.ts +++ b/types/ember-resolver/ember-resolver-tests.ts @@ -1,5 +1,5 @@ -import Application from '@ember/application'; import EmberResolver from 'ember-resolver'; +import { Ember } from 'ember'; const MyResolver = EmberResolver.extend({ pluralizedTypes: { @@ -7,6 +7,6 @@ const MyResolver = EmberResolver.extend({ } }); -const App = Application.extend({ +const App = Ember.Application.extend({ Resolver: MyResolver }); diff --git a/types/ember-resolver/index.d.ts b/types/ember-resolver/index.d.ts index 4fe466ae13..f2ede7fe32 100644 --- a/types/ember-resolver/index.d.ts +++ b/types/ember-resolver/index.d.ts @@ -5,11 +5,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -/// - -import Resolver from '@ember/application/resolver'; +import Ember from 'ember'; /** * An Ember `Resolver` implementation used by ember-cli. */ -export default class EmberResolver extends Resolver {} +export default class EmberResolver extends Ember.Resolver {} diff --git a/types/ember-resolver/v4/ember-resolver-tests.ts b/types/ember-resolver/v4/ember-resolver-tests.ts index d22a0d31be..db834b1985 100644 --- a/types/ember-resolver/v4/ember-resolver-tests.ts +++ b/types/ember-resolver/v4/ember-resolver-tests.ts @@ -1,4 +1,4 @@ -import Application from '@ember/application'; +import Ember from 'ember'; import EmberResolver from 'ember-resolver'; const MyResolver = EmberResolver.extend({ @@ -7,6 +7,6 @@ const MyResolver = EmberResolver.extend({ } }); -const App = Application.extend({ +const App = Ember.Application.extend({ Resolver: MyResolver }); diff --git a/types/ember-resolver/v4/index.d.ts b/types/ember-resolver/v4/index.d.ts index 8047dc1bc2..fd5359cff4 100644 --- a/types/ember-resolver/v4/index.d.ts +++ b/types/ember-resolver/v4/index.d.ts @@ -5,11 +5,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -/// - -import Resolver from '@ember/application/resolver'; +import Ember from 'ember'; /** * An Ember `Resolver` implementation used by ember-cli. */ -export default class EmberResolver extends Resolver {} +export default class EmberResolver extends Ember.Resolver {} diff --git a/types/ember/-private-types/mixin.d.ts b/types/ember/-private-types/mixin.d.ts new file mode 100644 index 0000000000..30e81493ca --- /dev/null +++ b/types/ember/-private-types/mixin.d.ts @@ -0,0 +1,5 @@ +import Ember from 'ember'; +/** + * Ember.Object.extend(...) accepts any number of mixins or literals. + */ +declare type MixinOrLiteral = Ember.Mixin | T; diff --git a/types/ember/-private-types/object.d.ts b/types/ember/-private-types/object.d.ts new file mode 100644 index 0000000000..be7be68dee --- /dev/null +++ b/types/ember/-private-types/object.d.ts @@ -0,0 +1,28 @@ +/** + * Used to infer the type of ember classes of type `T`. + * + * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. + * + * The single-arg constructor is required by the typescript compiler. + * The multi-arg constructor is included for better ergonomics. + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ +export type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); + +/** + * Check that any arguments to `create()` match the type's properties. + * + * Accept any additional properties and add merge them into the instance. + */ +export type EmberInstanceArguments = Partial & { + [key: string]: any; +}; + +/** + * Accept any additional properties and add merge them into the prototype. + */ +export interface EmberClassArguments { + [key: string]: any; +} diff --git a/types/ember/-private-types/object/computed.d.ts b/types/ember/-private-types/object/computed.d.ts new file mode 100644 index 0000000000..2c540db04b --- /dev/null +++ b/types/ember/-private-types/object/computed.d.ts @@ -0,0 +1,34 @@ +import ComputedProperty from '@ember/object/computed'; +/** + * Deconstructs computed properties into the types which would be returned by `.get()`. + */ +export type UnwrapComputedPropertyGetter = + T extends ComputedProperty ? U : + T; +export type UnwrapComputedPropertyGetters = { + [P in keyof T]: UnwrapComputedPropertyGetter; +}; + +export type UnwrapComputedPropertySetter = + T extends ComputedProperty ? V : + T; +export type UnwrapComputedPropertySetters = { + [P in keyof T]: UnwrapComputedPropertySetter; +}; + +export type ComputedPropertyGetterFunction = (this: any, key: string) => T; +export type ComputedPropertySetterFunction = (this: any, key: string, newVal: T, oldVal: T) => T; + +export interface ComputedPropertyGetterObj { + get(this: any, key: string): T; +} + +export interface ComputedPropertySetterObj { + set(this: any, key: string, value: T): T; +} +export type ComputedPropertyObj = ComputedPropertyGetterObj | ComputedPropertySetterObj | (ComputedPropertyGetterObj & ComputedPropertySetterObj); + +export type ComputedPropertyGetter = ComputedPropertyGetterFunction | ComputedPropertyGetterObj; +export type ComputedPropertySetter = ComputedPropertySetterFunction | ComputedPropertySetterObj; + +export type ComputedPropertyCallback = ComputedPropertyGetterFunction | ComputedPropertyObj; diff --git a/types/ember/-private-types/utils.d.ts b/types/ember/-private-types/utils.d.ts new file mode 100644 index 0000000000..a9902c7a1d --- /dev/null +++ b/types/ember/-private-types/utils.d.ts @@ -0,0 +1,36 @@ +import { Ember } from "ember"; + +/** + * Map type `T` to a plain object hash with the identity mapping. + * + * Discards any additional object identity like the ability to `new()` up the class. + * The `new()` capability is added back later by merging `EmberClassConstructor` + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ +export type Objectify = Readonly; +export type ExtractPropertyNamesOfType = { + [K in keyof T]: T[K] extends S ? K : never +}[keyof T]; +export type Fix = { [K in keyof T]: T[K] }; + +export type KeysOfType = keyof Pick; + +export interface TypeLookup { + string: string; + number: number; + boolean: boolean; + regexp: RegExp; + function: (...args: any[]) => any; + array: any[]; + error: Error; + filelist: FileList; + class: typeof Ember.Object; + instance: Ember.Object; + date: Date; + null: null; + undefined: undefined; +} diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index cee4ebc780..5b059a0ee4 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -16,6 +16,16 @@ /// declare module 'ember' { + import { + UnwrapComputedPropertySetters, + UnwrapComputedPropertySetter, + UnwrapComputedPropertyGetters, + UnwrapComputedPropertyGetter, + ComputedPropertyCallback + } from 'ember/-private-types/object/computed'; + import { Objectify, Fix, KeysOfType, TypeLookup } from 'ember/-private-types/utils'; + import { EmberClassArguments, EmberClassConstructor, EmberInstanceArguments } from 'ember/-private-types/object'; + // Capitalization is intentional: this makes it much easier to re-export RSVP on // the Ember namespace. import Rsvp from 'rsvp'; @@ -42,51 +52,11 @@ declare module 'ember' { : F extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => any ? [A, B, C, D, E] : never; - /** - * Deconstructs computed properties into the types which would be returned by `.get()`. - */ - type UnwrapComputedPropertyGetter = - T extends Ember.ComputedProperty ? U : - T; - type UnwrapComputedPropertyGetters = { - [P in keyof T]: UnwrapComputedPropertyGetter; - }; - type UnwrapComputedPropertySetter = - T extends Ember.ComputedProperty ? U : - T; - type UnwrapComputedPropertySetters = { - [P in keyof T]: UnwrapComputedPropertySetter; - }; - - /** - * Check that any arguments to `create()` match the type's properties. - * - * Accept any additional properties and add merge them into the instance. - */ - type EmberInstanceArguments = Partial & { - [key: string]: any; - }; - - /** - * Accept any additional properties and add merge them into the prototype. - */ - interface EmberClassArguments { - [key: string]: any; - } - - /** - * Map type `T` to a plain object hash with the identity mapping. - * - * Discards any additional object identity like the ability to `new()` up the class. - * The `new()` capability is added back later by merging `EmberClassConstructor` - * - * Implementation is carefully chosen for the reasons described in - * https://github.com/typed-ember/ember-typings/pull/29 - */ - type Objectify = Readonly; - - type Fix = { [K in keyof T]: T[K] }; + type Mix = B & Pick>; + type Mix3 = Mix, C>; + type Mix4 = Mix3, C, D>; + type Mix5 = Mix4, C, D, E>; /** * Ember.Object.extend(...) accepts any number of mixins or literals. @@ -104,23 +74,6 @@ declare module 'ember' { * Implementation is carefully chosen for the reasons described in * https://github.com/typed-ember/ember-typings/pull/29 */ - type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); - - type ComputedPropertyGetterFunction = (this: any, key: string) => T; - - interface ComputedPropertyGet { - get(this: any, key: string): T; - } - - interface ComputedPropertySet { - set(this: any, key: string, value: T): T; - } - - type ComputedPropertyCallback = - | ComputedPropertyGetterFunction - | ComputedPropertyGet - | ComputedPropertySet - | (ComputedPropertyGet & ComputedPropertySet); interface ActionsHash { [index: string]: (...params: any[]) => any; @@ -143,7 +96,7 @@ declare module 'ember' { type ObserverMethod = | (keyof Target) - | ((this: Target, sender: Sender, key: keyof Sender, value: any, rev: number) => void); + | ((this: Target, sender: Sender, key: string, value: any, rev: number) => void); interface RenderOptions { into?: string; @@ -786,7 +739,7 @@ declare module 'ember' { class ContainerDebugAdapter extends Object { resolver: Resolver; canCatalogEntriesByType(type: string): boolean; - catalogEntriesByType(type: string): any[]; + catalogEntriesByType(type: string): string[]; } /** * Additional methods for the Controller. @@ -1051,32 +1004,54 @@ declare module 'ember' { * The container-debug-adapter which is used * to list all models. */ - containerDebugAdapter: any; + containerDebugAdapter: ContainerDebugAdapter; /** * Ember Data > v1.0.0-beta.18 * requires string model names to be passed * around instead of the actual factories. */ - acceptsModelName: any; + acceptsModelName: boolean; /** * Specifies how records can be filtered. * Records returned will need to have a `filterValues` * property with a key for every name in the returned array. */ - getFilters(): any[]; + getFilters(): DataAdapter.Column[]; /** * Fetch the model types and observe them for changes. */ - watchModelTypes(typesAdded: Function, typesUpdated: Function): Function; + watchModelTypes( + typesAdded: (types: DataAdapter.WrappedType[]) => void, + typesUpdated: (types: DataAdapter.WrappedType[]) => void + ): () => void; /** * Fetch the records of a given type and observe them for changes. */ watchRecords( modelName: string, - recordsAdded: Function, - recordsUpdated: Function, - recordsRemoved: Function - ): Function; + recordsAdded: (records: DataAdapter.WrappedRecord[]) => void, + recordsUpdated: (records: DataAdapter.WrappedRecord[]) => void, + recordsRemoved: (idx: number, count: number) => void + ): () => void; + } + namespace DataAdapter { + interface Column { + name: string; + desc: string; + } + interface WrappedRecord { + columnValues: object; + object: object; + } + interface WrappedType { + type: { + name: string; + count: number; + columns: Column[]; + object: typeof Object; + }; + release: () => void; + } } const Debug: { /** @@ -1085,14 +1060,14 @@ declare module 'ember' { * The following example demonstrates its usage by registering a handler that throws an error if the * message contains the word "should", otherwise defers to the default handler. */ - registerDeprecationHandler(handler: Function): any; + registerDeprecationHandler(handler: (message: string, options: { id: string, until: string }, next: () => void) => void): void; /** * Allows for runtime registration of handler functions that override the default warning behavior. * Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). * The following example demonstrates its usage by registering a handler that does nothing overriding Ember's * default warning behavior. */ - registerWarnHandler(handler: Function): any; + registerWarnHandler(handler: (message: string, options: { id: string }, next: () => void) => void): void; }; /** * The DefaultResolver defines the default lookup rules to resolve @@ -3064,20 +3039,20 @@ declare module 'ember' { /** * Run a function meant for debugging. */ - function runInDebug(func: () => void): any; + function runInDebug(func: () => any): void; /** * Display a warning with the provided message. */ - function warn(message: string, test: boolean, options: { id: string }): any; - function warn(message: string, options: { id: string }): any; + function warn(message: string, test: boolean, options: { id: string }): void; + function warn(message: string, options: { id: string }): void; /** * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options */ - function warn(message: string, test: boolean, options?: { id?: string }): any; + function warn(message: string, test: boolean, options?: { id?: string }): void; /** * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options */ - function warn(message: string, options?: { id?: string }): any; + function warn(message: string, options?: { id?: string }): void; /** * Global helper method to create a new binding. Just pass the root object * along with a `to` and `from` path to create and connect the binding. @@ -3167,7 +3142,7 @@ declare module 'ember' { * Merge the contents of two objects together into the first object. * @deprecated Use Object.assign */ - function merge(original: T, updates: U): T & U; + function merge(original: T, updates: U): Mix; /** * Makes a method available via an additional name. */ @@ -3311,14 +3286,17 @@ declare module 'ember' { /** * Returns a consistent type for the passed object. */ - function typeOf(item?: any): string; + function typeOf(value: T): KeysOfType; + function typeOf(): 'undefined'; + function typeOf(item: any): string; /** * Copy properties from a source object to a target object. * @deprecated Use Object.assign */ - function assign(target: T, source: U): T & U; - function assign(target: T, source1: U, source2: V): T & U & V; - function assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + function assign(target: T, source: U): Mix; + function assign(target: T, source1: U, source2: V): Mix3; + function assign(target: T, source1: U, source2: V, source3: W): Mix4; + /** * Polyfill for Object.create * @deprecated Use Object.create diff --git a/types/ember/test/access-modifier.ts b/types/ember/test/access-modifier.ts index 5e998f72d3..38f5bd4602 100644 --- a/types/ember/test/access-modifier.ts +++ b/types/ember/test/access-modifier.ts @@ -1,3 +1,7 @@ +/** + * Tests to ensure that access modifier keywords are appropriately + * respected and supported + */ import Ember from 'ember'; import { assertType } from './lib/assert'; @@ -8,13 +12,16 @@ class Foo extends Ember.Object { } const f = new Foo(); assertType(f.hello()); +// protected property should not be visible from outside of Foo assertType(f.bar()); // $ExpectError +// private property should not be visible from outside of Foo assertType(f.baz()); // $ExpectError class Foo2 extends Ember.Object.extend({ bar: '' }) { hello() { return 'world'; } + // Cannot override with a mis-matched property type protected bar() { return 'bar'; } // $ExpectError private baz() { return 'baz'; } } diff --git a/types/ember/test/component.ts b/types/ember/test/component.ts index bcc314300d..13ab88cbbd 100755 --- a/types/ember/test/component.ts +++ b/types/ember/test/component.ts @@ -3,6 +3,9 @@ import Component from '@ember/component'; import Object, { computed } from '@ember/object'; import hbs from 'htmlbars-inline-precompile'; import { assertType } from "./lib/assert"; +import ComputedProperty from '@ember/object/computed'; +import { ExtractPropertyNamesOfType } from 'ember/-private-types/utils'; +import { UnwrapComputedPropertySetter } from 'ember/-private-types/object/computed'; Component.extend({ layout: hbs` diff --git a/types/ember/test/core-object.ts b/types/ember/test/core-object.ts new file mode 100644 index 0000000000..984f5eec12 --- /dev/null +++ b/types/ember/test/core-object.ts @@ -0,0 +1,198 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +/** Newable tests */ +const co1 = new Ember.CoreObject(); + +// TODO: Enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// co1.concatenatedProperties; // $ExpectType string[] +co1.isDestroyed; // $ExpectType boolean +co1.isDestroying; // $ExpectType boolean +co1.destroy(); // $ExpectType CoreObject +co1.toString(); // $ExpectType string + +/** .create tests */ +const co2 = Ember.CoreObject.create(); +// TODO: Enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// co2.concatenatedProperties; // $ExpectType string[] +co2.isDestroyed; // $ExpectType boolean +co2.isDestroying; // $ExpectType boolean +co2.destroy(); // $ExpectType CoreObject +co2.toString(); // $ExpectType string + +/** .create tests w/ initial instance data passed in */ +const co3 = Ember.CoreObject.create({ foo: '123', bar: 456 }); + +co3.foo; // $ExpectType string +co3.bar; // $ExpectType number + +/** .extend with a zero-argument .create() */ +const co4 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz(): [string, number] { + return [this.foo, this.bar]; + } +}).create(); + +co4.foo; // $ExpectType string +co4.bar; // $ExpectType number +co4.baz; // $ExpectType () => [string, number] + +/** .extend with inconsistent arguments passed into .create() */ +const class05 = Ember.CoreObject.extend({ + foo: '123' as (string | boolean), + bar: 456, + baz() { + return [this.foo, this.bar]; + } +}); +const c05 = class05.create({ foo: 99 }); // $ExpectError +const c05b = class05.create({ foo: true }); +const c05c = class05.create({ foo: 'abc' }); +assertType(c05b.foo); // $ExpectError +assertType(c05c.foo); // $ExpectError + +/** two .extend arguments with a zero-argument .create() */ +const co6 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz() { + return [this.foo, this.bar]; + }, + func1() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.foo; // $ExpectType string + // this does not include stuff from later extend args + this.bee; // $ExpectError + } +}, { + foo: 99, + bee: 'honey', + func2() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 + this.foo; // $ExpectType string & number + // this includes stuff from earlier extend-args + this.bar; // $ExpectType number + } +}).create(); + +// TODO: enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// assertType(co6.foo); // $ExpectError +assertType(co6.bar); // $ExpectType number +assertType<() => Array>(co6.baz); // $ExpectType () => (string | number)[] + +/** three .extend arguments with a zero-argument .create() */ +const co7 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz() { + return [this.foo, this.bar]; + }, + func1() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.foo; // $ExpectType string + // this does not include stuff from later extend args + this.bee; // $ExpectError + } +}, { + foo: 99, + bee: 'honey', + func2() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 + this.foo; // $ExpectType string & number + // this includes stuff from earlier extend-args + this.bar; // $ExpectType number + } +}, { + foo: '99', + money: 'in the banana stand', + func3() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.money; // $ExpectType string + // this includes stuff from earlier extend-args + this.bee; // $ExpectType string + this.bar; // $ExpectType number + } +}).create(); +// TODO: enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// assertType(co7.foo); // $ExpectError +assertType(co7.bar); // $ExpectType number +assertType(co7.money); // $ExpectType string +assertType<() => Array>(co7.baz); // $ExpectType () => (string | number)[] + +/** four .extend arguments with a zero-argument .create() */ +const co8 = Ember.CoreObject.extend({ + foo: '123', + bar: 456, + baz() { + return [this.foo, this.bar]; + }, + func1() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.foo; // $ExpectType string + // this does not include stuff from later extend args + this.bee; // $ExpectError + } +}, { + foo: 99, + bee: 'honey', + func2() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 + this.foo; // $ExpectType string & number + // this includes stuff from earlier extend-args + this.bar; // $ExpectType number + // this does not include stuff from later extend args + this.money; // $ExpectError + } +}, { + foo: '99', + money: 'in the banana stand', + func3() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.money; // $ExpectType string + // this includes stuff from earlier extend-args + this.bee; // $ExpectType string + this.bar; // $ExpectType number + // this does not include stuff from later extend args + this.neighborhood; // $ExpectError + } +}, { + foo: '99', + neighborhood: 'sudden valley', + func4() { + // this includes stuff from CoreObject + this.init; // $ExpectType () => void + // this includes stuff from this extend-arg + this.neighborhood; // $ExpectType string + // this includes stuff from earlier extend-args + this.bee; // $ExpectType string + this.bar; // $ExpectType number + this.money; // $ExpectType string + } +}).create(); + +// TODO: enable in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 +// assertType(co8.foo); // $ExpectError +assertType(co8.bar); // $ExpectType number +assertType(co8.money); // $ExpectType string +assertType<() => Array>(co8.baz); // $ExpectType () => (string | number)[] diff --git a/types/ember/test/data-adapter.ts b/types/ember/test/data-adapter.ts new file mode 100644 index 0000000000..ea77b27e70 --- /dev/null +++ b/types/ember/test/data-adapter.ts @@ -0,0 +1,53 @@ +import Ember from 'ember'; + +const da = Ember.DataAdapter.create(); + +const filters = da.getFilters(); +filters.includes({ name: 'foo', desc: 'bar'}); // $ExpectType boolean +filters.includes({}); // $ExpectError + +filters[0].name; // $ExpectType string +filters[0].desc; // $ExpectType string + +da.watchModelTypes(// $ExpectType () => void + function added(wrappedTypes) { + wrappedTypes; + wrappedTypes[0].release; // $ExpectType () => void + wrappedTypes[0].type.columns[0].desc; // $ExpectType string + wrappedTypes[0].type.columns[0].name; // $ExpectType string + wrappedTypes[0].type.count; // $ExpectType number + wrappedTypes[0].type.name; // $ExpectType string + }, + function updated(wrappedTypes) { + wrappedTypes; + wrappedTypes[0].release; // $ExpectType () => void + wrappedTypes[0].type.columns[0].desc; // $ExpectType string + wrappedTypes[0].type.columns[0].name; // $ExpectType string + wrappedTypes[0].type.count; // $ExpectType number + wrappedTypes[0].type.name; // $ExpectType string + } +); +da.watchModelTypes(() => void); // $ExpectError + +da.watchRecords('house', // $ExpectType () => void + function added(records) { + records[0].object; // $ExpectType object + records[0].columnValues; // $ExpectType object + }, + function updated(records) { + records[0].object; // $ExpectType object + records[0].columnValues; // $ExpectType object + }, + function removed(idx, count) { + idx; // $ExpectType number + count; // $ExpectType number + } +); +da.watchRecords(() => void); // $ExpectError + +da.acceptsModelName; // $ExpectType boolean +da.containerDebugAdapter; // $ExpectType ContainerDebugAdapter + +const ca: Ember.ContainerDebugAdapter = da.containerDebugAdapter; +ca.canCatalogEntriesByType('controller'); // $ExpectType boolean +ca.catalogEntriesByType('controller'); // $ExpectType string[] diff --git a/types/ember/test/debug.ts b/types/ember/test/debug.ts new file mode 100644 index 0000000000..b3f4bb5f17 --- /dev/null +++ b/types/ember/test/debug.ts @@ -0,0 +1,53 @@ +import Ember from 'ember'; + +const { + runInDebug, + warn, + debug, + assert, + Debug: { registerDeprecationHandler, registerWarnHandler } +} = Ember; + +/** + * @ember/debug tests + */ +runInDebug(); // $ExpectError +let x = runInDebug(() => console.log('Should not show up in prod')); // $ExpectType void + +// Log a warning if we have more than 3 tomsters +const tomsterCount = 2; +warn('Too many tomsters!'); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3, { // $ExpectType void + id: 'ember-debug.too-many-tomsters' +}); + +debug(); // $ExpectError +debug('Too many tomsters!'); // $ExpectType void +debug('Too many tomsters!', 'foo'); // $ExpectError + +// Test for truthiness +const str = 'hello'; +assert('Must pass a string', typeof str === 'string'); // $ExpectType void + +// Fail unconditionally +assert('This code path should never be run'); // $ExpectType void + +// next is not called, so no warnings get the default behavior +registerWarnHandler(); // $ExpectError +registerWarnHandler(() => {}); // $ExpectType void +registerWarnHandler((message, { id }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + next; // $ExpectType () => void +}); + +// next is not called, so no warnings get the default behavior +registerDeprecationHandler(); // $ExpectError +registerDeprecationHandler(() => {}); // $ExpectType void +registerDeprecationHandler((message, { id, until }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + until; // $ExpectType string + next; // $ExpectType () => void +}); diff --git a/types/ember/test/lib/assert.ts b/types/ember/test/lib/assert.ts index d6748cd5bc..262d18bc2c 100755 --- a/types/ember/test/lib/assert.ts +++ b/types/ember/test/lib/assert.ts @@ -2,4 +2,4 @@ // Disable tslint here b/c the generic is used to let us do a type coercion and // validate that coercion works for the type value "passed into" the function. // tslint:disable-next-line:no-unnecessary-generics -export declare function assertType(value: T): void; +export declare function assertType(value: T): T; diff --git a/types/ember/test/private/computed-tests.ts b/types/ember/test/private/computed-tests.ts new file mode 100644 index 0000000000..a4c3e819f6 --- /dev/null +++ b/types/ember/test/private/computed-tests.ts @@ -0,0 +1,82 @@ +import { Ember } from "ember"; +import { computed } from "@ember/object"; +import { UnwrapComputedPropertySetters, UnwrapComputedPropertyGetters, UnwrapComputedPropertySetter, UnwrapComputedPropertyGetter } from "ember/-private-types/object/computed"; +import ComputedProperty from "@ember/object/computed"; +import { assertType } from "../lib/assert"; + +class Example1 extends Ember.Object.extend({ + firstName: '', + lastName: '', + allNames: computed('fullName', function() { + return [this.fullName]; + }), + fullName: computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + }) +}) { + allNames!: ComputedProperty; + fullName!: ComputedProperty; +} + +let unwrappedGetters1: UnwrapComputedPropertyGetters = {} as any; +unwrappedGetters1.firstName; // $ExpectType string +unwrappedGetters1.lastName; // $ExpectType string +unwrappedGetters1.fullName; // $ExpectType string +unwrappedGetters1.allNames; // $ExpectType string[] + +let unwrappedSetters1: UnwrapComputedPropertySetters = {} as any; +unwrappedSetters1.firstName; // $ExpectType string +unwrappedSetters1.lastName; // $ExpectType string +unwrappedSetters1.fullName; // $ExpectType string +unwrappedSetters1.allNames; // $ExpectType string[] + +class Example2 extends Ember.Object.extend({ + allNames: computed('fullName', function() { + return [this.fullName + '']; + }) , + fullName: computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + }) +}) { + firstName = ''; + lastName = ''; + foo() { + this.fullName; // $ExpectType ComputedProperty + this.allNames; // $ExpectType ComputedProperty + this.firstName; // $ExpectType string + this.lastName; // $ExpectType string + + this.get('fullName').split(','); // $ExpectType string[] + this.get('allNames')[0]; // $ExpectType string + this.get('firstName').split(','); // $ExpectType string[] + this.get('lastName').split(','); // $ExpectType string[] + } +} +let ex2 = new Example2(); + +let unwrappedGetters2: UnwrapComputedPropertyGetters = (ex2 as any) as UnwrapComputedPropertyGetters; +assertType(unwrappedGetters2.firstName); // $ExpectType string +assertType(unwrappedGetters2.lastName); // $ExpectType string +assertType(unwrappedGetters2.fullName); // $ExpectType string +assertType(unwrappedGetters2.allNames); // $ExpectType string[] + +let unwrappedSetters2: UnwrapComputedPropertySetters = null as any; +assertType(unwrappedSetters2.firstName); // $ExpectType string +assertType(unwrappedSetters2.lastName); // $ExpectType string +assertType(unwrappedSetters2.fullName); // $ExpectType string +assertType(unwrappedSetters2.allNames); // $ExpectType string[] + +ex2.fullName; // $ExpectType ComputedProperty +ex2.allNames; // $ExpectType ComputedProperty +ex2.firstName; // $ExpectType string + +type UnwStringSet = UnwrapComputedPropertySetter; // $ExpectType string +type UnwStringGet = UnwrapComputedPropertyGetter; // $ExpectType string +type UnwCpStringSet1 = UnwrapComputedPropertySetter>; // $ExpectType string +type UnwCpStringGet1 = UnwrapComputedPropertyGetter>; // $ExpectType string +type UnwCpStringSet2 = UnwrapComputedPropertySetter>; // $ExpectType string +type UnwCpStringGet2 = UnwrapComputedPropertyGetter>; // $ExpectType string +type UnwCpStringSet3 = UnwrapComputedPropertySetter>; // $ExpectType string +type UnwCpStringGet3 = UnwrapComputedPropertyGetter>; // $ExpectType number +type UnwCpStringSet4 = UnwrapComputedPropertySetter>; // $ExpectType number +type UnwCpStringGet4 = UnwrapComputedPropertyGetter>; // $ExpectType string diff --git a/types/ember/test/private/observable-tests.ts b/types/ember/test/private/observable-tests.ts new file mode 100644 index 0000000000..be3d4bd69f --- /dev/null +++ b/types/ember/test/private/observable-tests.ts @@ -0,0 +1,175 @@ +import Observable from "@ember/object/observable"; +import { UnwrapComputedPropertyGetter, UnwrapComputedPropertyGetters, UnwrapComputedPropertySetters, UnwrapComputedPropertySetter } from "ember/-private-types/object/computed"; +// tslint-disable-next-line +import { assertType } from "../lib/assert"; +import { Ember } from "ember"; +import { ExtractPropertyNamesOfType } from "ember/-private-types/utils"; + +class OtherThing { + observerOfDemo(target: DemoObservable, key: 'foo') {} +} + +class DemoObservable implements Observable { + foo: string; + isFoo = true; + bar: [boolean, boolean]; + baz?: number; + constructor() { + this.foo = 'hello'; + this.bar = [false, true]; + this.baz = 9; + this.addObserver('foo', this, 'fooDidChange'); + this.addObserver('foo', this, 'fooDidChangeProtected'); // $ExpectError + this.addObserver('foo', this, this.fooDidChange); + this.addObserver('foo', this, this.fooDidChangeProtected); + const ot = new OtherThing(); + this.addObserver('foo', ot, ot.observerOfDemo); + Ember.addObserver(this, 'foo', this, 'fooDidChange'); + Ember.addObserver(this, 'foo', this, 'fooDidChangeProtected'); // $ExpectError + Ember.addObserver(this, 'foo', this, this.fooDidChange); + Ember.addObserver(this, 'foo', this, this.fooDidChangeProtected); + this.removeObserver('foo', this, 'fooDidChange'); + this.removeObserver('foo', this, 'fooDidChangeProtected'); // $ExpectError + this.removeObserver('foo', this, this.fooDidChange); + this.removeObserver('foo', this, this.fooDidChangeProtected); + Ember.removeObserver(this, 'foo', this, 'fooDidChange'); + Ember.removeObserver(this, 'foo', this, 'fooDidChangeProtected'); // $ExpectError + Ember.removeObserver(this, 'foo', this, this.fooDidChange); + const lambda = () => { + this.fooDidChange(this, 'foo'); + }; + this.addObserver('foo', lambda); + this.addObserver('foo', (sender, key, value, rev) => { + assertType(sender); + assertType<'foo'>(key); + assertType(value); + assertType(rev); + }); + this.removeObserver('foo', lambda); + Ember.addObserver(this, 'foo', lambda); + Ember.removeObserver(this, 'foo', lambda); + } + + fooDidChange(obj: this, propName: 'foo') {} + protected fooDidChangeProtected(obj: this, propName: 'foo') {} + get(key: K): UnwrapComputedPropertyGetter { + throw new Error("Method not implemented."); + } + getProperties(list: K[]): Pick, K>; + getProperties(...list: K[]): Pick, K>; + getProperties(...rest: any[]): any { + throw new Error("Method not implemented."); + } + set(key: K, value: this[K]): this[K] { + throw new Error("Method not implemented."); + } + setProperties(hash: Pick): Pick< UnwrapComputedPropertySetters, K> { + throw new Error("Method not implemented."); + } + notifyPropertyChange(keyName: string): this { + throw new Error("Method not implemented."); + } + addObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): void; + addObserver(key: K, method: keyof this | ((this: this, sender: this, key: K, value: this[K], rev: number) => void)): void; + addObserver(key: any, target: any, method?: any) { + throw new Error("Method not implemented."); + } + removeObserver(key: keyof this, target: Target, method: keyof Target | ((this: Target, sender: this, key: string, value: any, rev: number) => void)): void; + removeObserver(key: keyof this, method: keyof this | ((this: this, sender: this, key: string, value: any, rev: number) => void)): void; + removeObserver(key: any, target: any, method?: any): void { + throw new Error("Method not implemented."); + } + getWithDefault(key: K, defaultValue: UnwrapComputedPropertyGetter): UnwrapComputedPropertyGetter { + throw new Error("Method not implemented."); + } + incrementProperty(keyName: ExtractPropertyNamesOfType, increment?: number): number { + throw new Error("Method not implemented."); + } + decrementProperty(keyName: ExtractPropertyNamesOfType, decrement?: number): number { + throw new Error("Method not implemented."); + } + toggleProperty(keyName: ExtractPropertyNamesOfType): boolean { + throw new Error("Method not implemented."); + } + cacheFor(key: K): UnwrapComputedPropertyGetter | undefined { + throw new Error("Method not implemented."); + } +} +const o = new DemoObservable(); + +/** + * get + */ +assertType(o.get('foo')); // $ExpectType string +assertType<[boolean, boolean]>(o.get('bar')); // $ExpectType [boolean, boolean] +assertType(o.get('baz')); // $ExpectType number | undefined + +/** + * incrementProperty, decrementProperty + */ +assertType(o.incrementProperty('baz')); // $ExpectType number +assertType(o.decrementProperty('baz')); // $ExpectType number +assertType(o.incrementProperty('baz', 3)); // $ExpectType number +assertType(o.decrementProperty('baz', 12)); // $ExpectType number +// non-numeric property case +assertType(o.incrementProperty('bar')); // $ExpectError +assertType(o.decrementProperty('bar')); // $ExpectError +// empty case +assertType(o.incrementProperty()); // $ExpectError +assertType(o.decrementProperty()); // $ExpectError + +/** + * toggleProperty + */ +o.toggleProperty('isFoo'); // $ExpectType boolean +o.toggleProperty(); // $ExpectError + +/** + * getWithDefault + */ +assertType(o.getWithDefault('foo', 'zzz')); // $ExpectType string +assertType<[boolean, boolean]>(o.getWithDefault('bar', [false, false])); // $ExpectType [boolean, boolean] +assertType(o.getWithDefault('baz', 10)); // $ExpectType number | undefined +// improper arguments cases +assertType(o.getWithDefault('baz', '10')); // $ExpectError +assertType(o.getWithDefault('baz')); // $ExpectError +assertType(o.getWithDefault()); // $ExpectError + +/** + * getProperties + */ +// ('foo', 'bar') +assertType<{ foo: string, bar: [boolean, boolean] }>(o.getProperties('foo', 'bar')); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// ['foo', 'bar'] +assertType<{ foo: string, bar: [boolean, boolean] }>(o.getProperties(['foo', 'bar'])); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// empty cases +assertType<{}>(o.getProperties()); // $ExpectType {} +assertType<{}>(o.getProperties([])); // $ExpectType {} +// property that doesn't exist +assertType(o.getProperties('jeanShorts', 'foo')); // $ExpectError +assertType(o.getProperties(['foo', 'jeanShorts'])); // $ExpectError + +/** + * set + */ +assertType(o.set('foo', 'abc')); // $ExpectType string +assertType<[boolean, boolean]>(o.set('bar', [false, false])); // $ExpectType [boolean, boolean] +assertType(o.set('baz', undefined)); // $ExpectType number | undefined +assertType(o.set('baz', 10)); // $ExpectType number | undefined +// property that doesn't exist +assertType(o.set('jeanShorts', 10)); // $ExpectError + +/** + * setProperties + */ +assertType<{ foo: string, bar: [boolean, boolean] }>(o.setProperties({ foo: 'abc', bar: [true, true] })); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// empty case +assertType<{}>(o.setProperties({})); // $ExpectType {} +// property that doesn't exist +assertType(o.setProperties({ jeanShorts: 'under the pants' })); // $ExpectError + +/** + * notifyPropertyChange + */ +assertType(o.notifyPropertyChange('foo')); // $ExpectType DemoObservable +assertType(o.notifyPropertyChange('jeanShorts')); // $ExpectError diff --git a/types/ember/test/techniques/properties-from-this.ts b/types/ember/test/techniques/properties-from-this.ts new file mode 100644 index 0000000000..eef58009c3 --- /dev/null +++ b/types/ember/test/techniques/properties-from-this.ts @@ -0,0 +1,62 @@ +/** + * These tests validate that the method of pulling property types off of this + * continues to work. We use this technique in the critical Observable interface + * that serves to implement a lot of Ember.CoreObject's functionality + */ + +class BoxedProperty { + __getType: Get; + __setType: Set; +} + +type UnboxGetProperty = T extends BoxedProperty ? V : T; +type UnboxSetProperty = T extends BoxedProperty ? V : T; + +class GetAndSet { + get(key: K): UnboxGetProperty { + return this[key] as any; + } + set(key: K, newVal: UnboxSetProperty): UnboxSetProperty { + const rawVal: UnboxSetProperty = this[key] as any; + if (rawVal instanceof BoxedProperty) { + rawVal.__setType = newVal; + } + this[key] = newVal as any; + return newVal; + } +} + +class Foo123 extends GetAndSet { + // tslint:disable-next-line:no-inferrable-types + a: number; + b: [boolean, boolean]; + c: string; + cpA!: BoxedProperty; + constructor() { + super(); + this.a = 1; + this.b = [true, false]; + this.c = 'hello'; + } +} + +let f = new Foo123(); + +f.get('a'); // $ExpectType number +f.set('a'); // $ExpectError +f.set('a', '1'); // $ExpectError +f.set('a', 1); // $ExpectType number + +f.get('b'); // $ExpectType [boolean, boolean] +f.set('b', 1); // $ExpectError +f.set('b', []); // $ExpectError +f.set('b', [true]); // $ExpectError +f.set('b', [false, true]); // $ExpectType [boolean, boolean] +f.set('b', [false, true, false]); // $ExpectError + +f.get('c'); // $ExpectType string +f.set('c', '1'); // $ExpectType string + +f.get('cpA'); // $ExpectType string +f.set('cpA', ['newValue']); // $ExpectError +f.set('cpA', 'newValue'); // $ExpectType string diff --git a/types/ember/test/utils.ts b/types/ember/test/utils.ts index 2a769dc2dc..77b52ca218 100755 --- a/types/ember/test/utils.ts +++ b/types/ember/test/utils.ts @@ -3,8 +3,8 @@ import * as utils from '@ember/utils'; import { assertType } from "./lib/assert"; function testTypeOf() { - utils.typeOf(); // $ExpectType string - utils.typeOf({}); // $ExpectType string + utils.typeOf(); // $ExpectType "undefined" + const str: string = utils.typeOf({}); } function testIsNoneType() { @@ -127,3 +127,50 @@ function testTryInvoke() { // Reversed arg types Ember.tryInvoke(new Foo(), 'add', ['4', 3]); // $ExpectType undefined } + +(function() { + /** typeOf */ + // TODO: more specific return type in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/259 + Ember.typeOf(); // $ExpectType "undefined" + Ember.typeOf(null); // $ExpectType "null" + Ember.typeOf(undefined); // $ExpectType "undefined" + Ember.typeOf('michael'); // $ExpectType "string" + // tslint:disable-next-line:no-construct + Ember.typeOf(new String('michael')); // $ExpectType "string" + Ember.typeOf(101); // $ExpectType "number" + // tslint:disable-next-line:no-construct + Ember.typeOf(new Number(101)); // $ExpectType "number" + Ember.typeOf(true); // $ExpectType "boolean" + // tslint:disable-next-line:no-construct + Ember.typeOf(new Boolean(true)); // $ExpectType "boolean" + Ember.typeOf(() => 4); // $ExpectType "function" + Ember.typeOf([1, 2, 90]); // $ExpectType "array" + Ember.typeOf(/abc/); // $ExpectType "regexp" + Ember.typeOf(new Date()); // $ExpectType "date" + Ember.typeOf(({} as any) as FileList); // $ExpectType "filelist" + Ember.typeOf(Ember.Object.extend()); // $ExpectType "class" + Ember.typeOf(Ember.Object.create()); // $ExpectType "instance" + Ember.typeOf(new Error('teamocil')); // $ExpectType "error" + Ember.typeOf((new Date()) as RegExp | Date); // "regexp" | "date" +})(); + +(function() { /* assign */ + Ember.assign({}, { a: 'b'}); + Ember.assign({}, { a: 'b'}).a; // $ExpectType string + Ember.assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string + Ember.assign({ a: 6 }, {}).a; // $ExpectType number + Ember.assign({ b: 6 }, {}).a; // $ExpectError + Ember.assign({}, { b: 6 }, {}).b; // $ExpectType number + Ember.assign({ a: 'hello' }, { b: 6 }, {}).a; // $ExpectType string + Ember.assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean + Ember.assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError + Ember.assign({ d: ['gobias industries'] }, { a: 'hello' }, { b: 6 }, { a: true }).d; // $ExpectType string[] +}()); + +(function() { /* merge */ + Ember.merge({}, { a: 'b'}); + Ember.merge({}, { a: 'b'}).a; // $ExpectType string + Ember.merge({ a: 6 }, { a: 'b'}).a; // $ExpectType string + Ember.merge({ a: 6 }, {}).a; // $ExpectType number + Ember.merge({ b: 6 }, {}).a; // $ExpectError +}()); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index 74ec227219..a267c26dd5 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -20,7 +20,14 @@ }, "files": [ "index.d.ts", + "-private-types/utils.d.ts", + "-private-types/mixin.d.ts", + "-private-types/object.d.ts", + "-private-types/object/computed.d.ts", "test/lib/assert.ts", + "test/private/computed-tests.ts", + "test/private/observable-tests.ts", + "test/techniques/properties-from-this.ts", "test/access-modifier.ts", "test/application-instance.ts", "test/application.ts", @@ -30,9 +37,11 @@ "test/component.ts", "test/computed.ts", "test/controller.ts", + "test/core-object.ts", "test/create-negative.ts", "test/create.ts", - "test/create.ts", + "test/data-adapter.ts", + "test/debug.ts", "test/detect-instance.ts", "test/detect.ts", "test/ember-tests.ts", @@ -51,8 +60,8 @@ "test/route.ts", "test/router.ts", "test/run.ts", - "test/string.ts", "test/string-ext.ts", + "test/string.ts", "test/test.ts", "test/transition.ts", "test/utils.ts", diff --git a/types/ember__application/deprecations.d.ts b/types/ember__application/deprecations.d.ts new file mode 100644 index 0000000000..608ba5c7f7 --- /dev/null +++ b/types/ember__application/deprecations.d.ts @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export const deprecate: typeof Ember.deprecate; +export const deprecateFunc: typeof Ember.deprecateFunc; diff --git a/types/ember__application/globals-resolver.d.ts b/types/ember__application/globals-resolver.d.ts new file mode 100644 index 0000000000..e51f4681ed --- /dev/null +++ b/types/ember__application/globals-resolver.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class GlobalsResolver extends Ember.DefaultResolver { } diff --git a/types/ember__application/index.d.ts b/types/ember__application/index.d.ts new file mode 100644 index 0000000000..cdef372444 --- /dev/null +++ b/types/ember__application/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for @ember/application 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export default class Application extends Ember.Application { } +export const getOwner: typeof Ember.getOwner; +export const onLoad: typeof Ember.onLoad; +export const runLoadHooks: typeof Ember.runLoadHooks; +export const setOwner: typeof Ember.setOwner; diff --git a/types/ember__application/instance.d.ts b/types/ember__application/instance.d.ts new file mode 100644 index 0000000000..0d01298d52 --- /dev/null +++ b/types/ember__application/instance.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class ApplicationInstance extends Ember.ApplicationInstance { } diff --git a/types/ember__application/resolver.d.ts b/types/ember__application/resolver.d.ts new file mode 100644 index 0000000000..a218fcd3e7 --- /dev/null +++ b/types/ember__application/resolver.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class Resolver extends Ember.Resolver { } diff --git a/types/ember__application/test/application-instance.ts b/types/ember__application/test/application-instance.ts new file mode 100644 index 0000000000..4ee5cb2027 --- /dev/null +++ b/types/ember__application/test/application-instance.ts @@ -0,0 +1,29 @@ +import ApplicationInstance from '@ember/application/instance'; +import hbs from 'htmlbars-inline-precompile'; + +const appInstance = ApplicationInstance.create(); +appInstance.register('some:injection', class Foo {}); + +appInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +appInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +appInstance.register('templates:foo/bar', hbs`

Hello World

`); + +appInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +appInstance.factoryFor('router:main'); +appInstance.lookup('route:basic'); + +appInstance.boot(); + +(async () => { + await appInstance.boot(); +})(); diff --git a/types/ember__application/test/application.ts b/types/ember__application/test/application.ts new file mode 100755 index 0000000000..21d0237b71 --- /dev/null +++ b/types/ember__application/test/application.ts @@ -0,0 +1,41 @@ +import Application from "@ember/application"; +import EmberObject from "@ember/object"; + +const BaseApp = Application.extend({ + modulePrefix: 'my-app' +}); + +BaseApp.initializer({ + name: 'my-initializer', + initialize(app) { + app.register('foo:bar', EmberObject.extend({ foo: 'bar' })); + } +}); + +BaseApp.instanceInitializer({ + name: 'my-instance-initializer', + initialize(app) { + app.lookup('foo:bar').get('foo'); + } +}); + +const App1 = BaseApp.create({ + rootElement: '#app-one', + customEvents: { + paste: 'paste' + } +}); + +const App2 = BaseApp.create({ + rootElement: '#app-two', + customEvents: { + mouseenter: null, + mouseleave: null + } +}); + +const App3 = BaseApp.create(); + +const App3Instance1 = App3.buildInstance(); // $ExpectType ApplicationInstance + +const App3Instance2 = App3.buildInstance({ foo: 'bar' }); // $ExpectType ApplicationInstance diff --git a/types/ember__application/test/deprecations.ts b/types/ember__application/test/deprecations.ts new file mode 100644 index 0000000000..12639ad0b5 --- /dev/null +++ b/types/ember__application/test/deprecations.ts @@ -0,0 +1,14 @@ +import { deprecate, deprecateFunc } from '@ember/application/deprecations'; + +deprecate('this is no longer advised', false, { + id: 'no-longer-advised', + until: 'v4.0' +}); +deprecate('this is no longer advised', false); + +deprecateFunc('this is no longer advised', () => {}); +deprecateFunc( + 'this is no longer advised', + { id: 'no-longer-do-this', until: 'v4.0' }, + () => {} +); diff --git a/types/ember__application/test/globals-resolver.ts b/types/ember__application/test/globals-resolver.ts new file mode 100644 index 0000000000..c0efb5579b --- /dev/null +++ b/types/ember__application/test/globals-resolver.ts @@ -0,0 +1,6 @@ +import GlobalsResolver from "@ember/application/globals-resolver"; + +const gr = GlobalsResolver.create(); + +gr.resolve('App.IndexController'); +gr.resolve(); // $ExpectError diff --git a/types/ember__application/test/resolver.ts b/types/ember__application/test/resolver.ts new file mode 100644 index 0000000000..20413aa5a4 --- /dev/null +++ b/types/ember__application/test/resolver.ts @@ -0,0 +1,3 @@ +import Resolver from "@ember/application/resolver"; + +const res = Resolver.create(); diff --git a/types/ember__application/tsconfig.json b/types/ember__application/tsconfig.json new file mode 100644 index 0000000000..833859d183 --- /dev/null +++ b/types/ember__application/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/application": ["ember__application"], + "@ember/application/*": ["ember__application/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "deprecations.d.ts", + "globals-resolver.d.ts", + "index.d.ts", + "instance.d.ts", + "resolver.d.ts", + "test/application.ts", + "test/deprecations.ts", + "test/resolver.ts", + "test/globals-resolver.ts", + "test/application-instance.ts" + ] +} diff --git a/types/ember__application/tslint.json b/types/ember__application/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__application/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__array/index.d.ts b/types/ember__array/index.d.ts new file mode 100644 index 0000000000..991f7961f2 --- /dev/null +++ b/types/ember__array/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for @ember/array 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +type EmberArray = Ember.Array; +export const EmberArray: typeof Ember.Array; +export default EmberArray; +export const A: typeof Ember.A; +export const isArray: typeof Ember.isArray; diff --git a/types/ember__array/mutable.d.ts b/types/ember__array/mutable.d.ts new file mode 100644 index 0000000000..a477c92f69 --- /dev/null +++ b/types/ember__array/mutable.d.ts @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +type MutableArray = Ember.MutableArray; +export const MutableArray: typeof Ember.MutableArray; +export default MutableArray; diff --git a/types/ember__array/proxy.d.ts b/types/ember__array/proxy.d.ts new file mode 100644 index 0000000000..ced7b5c14c --- /dev/null +++ b/types/ember__array/proxy.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class ArrayProxy extends Ember.ArrayProxy { } diff --git a/types/ember__array/test/array-ext.ts b/types/ember__array/test/array-ext.ts new file mode 100755 index 0000000000..72e9098100 --- /dev/null +++ b/types/ember__array/test/array-ext.ts @@ -0,0 +1,22 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; +import { ArrayPrototypeExtensions } from '@ember/array/types/prototype-extensions'; + +declare global { + interface Array extends ArrayPrototypeExtensions {} +} + +class Person extends EmberObject { + name: string; +} + +const person = Person.create({ name: 'Joe' }); +const array = [person]; + +assertType(array.get('length')); +assertType(array.get('firstObject')); +assertType(array.mapBy('name')); +assertType(array.map(p => p.get('name'))); +assertType(array.sortBy('name')); +assertType(array.uniq()); +assertType(array.uniqBy('name')); diff --git a/types/ember__array/test/array-proxy.ts b/types/ember__array/test/array-proxy.ts new file mode 100644 index 0000000000..f4ca116e14 --- /dev/null +++ b/types/ember__array/test/array-proxy.ts @@ -0,0 +1,27 @@ +import { assertType } from './lib/assert'; +import ArrayProxy from '@ember/array/proxy'; +import { A } from '@ember/array'; + +const pets = ['dog', 'cat', 'fish']; +const proxy = ArrayProxy.create({ content: A(pets) }); + +proxy.get('firstObject'); // 'dog' +proxy.set('content', A(['amoeba', 'paramecium'])); +proxy.get('firstObject'); // 'amoeba' + +const overridden = ArrayProxy.create({ + content: A(pets), + objectAtContent(idx: number): string { + return this.get('content').objectAt(idx)!.toUpperCase(); + } +}); + +overridden.get('firstObject'); // 'DOG' + +class MyNewProxy extends ArrayProxy { + isNew = true; +} + +const x = MyNewProxy.create({ content: A([1, 2, 3]) }) as MyNewProxy; +assertType(x.get('firstObject')); +assertType(x.isNew); diff --git a/types/ember__array/test/array.ts b/types/ember__array/test/array.ts new file mode 100755 index 0000000000..5d578e4319 --- /dev/null +++ b/types/ember__array/test/array.ts @@ -0,0 +1,56 @@ +import { assertType } from './lib/assert'; +import EmberObject from '@ember/object'; +import EmberArray, { A } from '@ember/array'; +import MutableArray from '@ember/array/mutable'; + +type Person = typeof Person.prototype; +const Person = EmberObject.extend({ + name: '', + isHappy: false +}); + +const people = A([ + Person.create({ name: 'Yehuda', isHappy: true }), + Person.create({ name: 'Majd', isHappy: false }), +]); + +assertType(people.get('length')); +assertType(people.get('lastObject')); +assertType(people.get('firstObject')); +assertType(people.isAny('isHappy')); +assertType(people.isAny('isHappy', 'false')); + +const persons1: Person[] = people.filterBy('isHappy'); +const persons2: MutableArray = people.filterBy('isHappy'); +const persons3: Person[] = people.rejectBy('isHappy'); +const persons4: MutableArray = people.rejectBy('isHappy'); +const persons5: Person[] = people.filter((person) => person.get('name') === 'Yehuda'); +const persons6: MutableArray = people.filter((person) => person.get('name') === 'Yehuda'); + +assertType(people.get('[]')); +assertType(people.get('[]').get('firstObject')); // $ExpectType any + +assertType>(people.mapBy('isHappy')); // $ExpectType Array +assertType(people.mapBy('name.length')); + +const last = people.get('lastObject'); // $ExpectType ({ name: string; isHappy: boolean; } & EmberObject & { name: string; isHappy: boolean; }) | undefined +if (last) { + assertType(last.get('name')); +} + +const first = people.get('lastObject'); +if (first) { + assertType(first.get('isHappy')); +} + +const letters: EmberArray = A(['a', 'b', 'c']); +const codes: number[] = letters.map((item, index, enumerable) => { + assertType(item); + assertType(index); + return item.charCodeAt(0); +}); + +const value = '1,2,3'; +const filters = A(value.split(',')); +filters.push('4'); +filters.sort(); diff --git a/types/ember__array/test/lib/assert.ts b/types/ember__array/test/lib/assert.ts new file mode 100755 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__array/test/lib/assert.ts @@ -0,0 +1,5 @@ +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): T; diff --git a/types/ember__array/tsconfig.json b/types/ember__array/tsconfig.json new file mode 100644 index 0000000000..e6c8d509e0 --- /dev/null +++ b/types/ember__array/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/array": ["ember__array"], + "@ember/array/*": ["ember__array/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mutable.d.ts", + "proxy.d.ts", + "types/prototype-extensions.d.ts", + "test/lib/assert.ts", + "test/array.ts", + "test/array-ext.ts", + "test/array-proxy.ts" + ] +} diff --git a/types/ember__array/tslint.json b/types/ember__array/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__array/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__array/types/prototype-extensions.d.ts b/types/ember__array/types/prototype-extensions.d.ts new file mode 100644 index 0000000000..a6197166ef --- /dev/null +++ b/types/ember__array/types/prototype-extensions.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export interface ArrayPrototypeExtensions extends Ember.MutableArray, Ember.Observable, Ember.Copyable {} diff --git a/types/ember__component/checkbox.d.ts b/types/ember__component/checkbox.d.ts new file mode 100644 index 0000000000..a71ee3602e --- /dev/null +++ b/types/ember__component/checkbox.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class Checkbox extends Ember.Checkbox { } diff --git a/types/ember__component/helper.d.ts b/types/ember__component/helper.d.ts new file mode 100644 index 0000000000..e89e6eab84 --- /dev/null +++ b/types/ember__component/helper.d.ts @@ -0,0 +1,17 @@ +import Ember from 'ember'; + +export default class Helper extends Ember.Helper { } +/** + * In many cases, the ceremony of a full `Helper` class is not required. + * The `helper` method create pure-function helpers without instances. For + * example: + * ```app/helpers/format-currency.js + * import { helper } from '@ember/component/helper'; + * export default helper(function(params, hash) { + * let cents = params[0]; + * let currency = hash.currency; + * return `${currency}${cents * 0.01}`; + * }); + * ``` + */ +export function helper(helperFn: (params: any[], hash?: any) => any): any; diff --git a/types/ember__component/index.d.ts b/types/ember__component/index.d.ts new file mode 100644 index 0000000000..147d717e2b --- /dev/null +++ b/types/ember__component/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for @ember/component 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export default class Component extends Ember.Component { } diff --git a/types/ember__component/test/component.ts b/types/ember__component/test/component.ts new file mode 100644 index 0000000000..1d0b164647 --- /dev/null +++ b/types/ember__component/test/component.ts @@ -0,0 +1,123 @@ +import Component from '@ember/component'; +import Object, { computed, get } from '@ember/object'; +import hbs from 'htmlbars-inline-precompile'; +import { assertType } from "./lib/assert"; + +Component.extend({ + layout: hbs` +
+ {{yield}} +
+ `, +}); + +Component.extend({ + layout: 'my-layout', +}); + +const MyComponent = Component.extend(); +assertType(get(MyComponent, 'positionalParams')); + +const component1 = Component.extend({ + actions: { + hello(name: string) { + console.log('Hello', name); + }, + }, +}); + +Component.extend({ + name: '', + hello(name: string) { + this.set('name', name); + }, +}); + +Component.extend({ + tagName: 'em', +}); + +Component.extend({ + classNames: ['my-class', 'my-other-class'], +}); + +Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: computed(function() { + if (!this.get('propertyA')) { + return 'from-b'; + } + }), +}); + +Component.extend({ + classNameBindings: ['hovered'], + hovered: true, +}); + +Component.extend({ + classNameBindings: ['messages.empty'], + messages: Object.create({ + empty: true, + }), +}); + +Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true, +}); + +Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true, +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com', +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com', +}); + +Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle', +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false, +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: computed(() => { + if ('someLogic') { + return true; + } else { + return false; + } + }), +}); + +Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null, +}); + +Component.extend({ + click(event: object) { + // will be called when an instance's + // rendered element is clicked + }, +}); diff --git a/types/ember__component/test/helper.ts b/types/ember__component/test/helper.ts new file mode 100644 index 0000000000..bee6cc1d46 --- /dev/null +++ b/types/ember__component/test/helper.ts @@ -0,0 +1,25 @@ +import { assertType } from './lib/assert'; +import Helper, { helper } from '@ember/component/helper'; + +class Timestamp extends Helper { + timer?: ReturnType; + now = new Date(); + init() { + super.init(); + this.timer = setInterval(() => { + this.set('now', new Date()); + this.recompute(); + }, 100); + } + willDestroy() { + clearInterval(this.timer); + } +} + +const addHelper = helper(function add([a, b]: number[]) { + return a + b; +}); + +const dasherizeHelper = helper(function dasherize([str]: string[], { delim = '-'}) { + return str.split(/[\s\n\_\.]+/g).join(delim); +}); diff --git a/types/ember__component/test/lib/assert.ts b/types/ember__component/test/lib/assert.ts new file mode 100755 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__component/test/lib/assert.ts @@ -0,0 +1,5 @@ +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): T; diff --git a/types/ember__component/text-area.d.ts b/types/ember__component/text-area.d.ts new file mode 100644 index 0000000000..859700a2d8 --- /dev/null +++ b/types/ember__component/text-area.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class TextArea extends Ember.TextArea { } diff --git a/types/ember__component/text-field.d.ts b/types/ember__component/text-field.d.ts new file mode 100644 index 0000000000..873995224b --- /dev/null +++ b/types/ember__component/text-field.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class TextField extends Ember.TextField { } diff --git a/types/ember__component/tsconfig.json b/types/ember__component/tsconfig.json new file mode 100644 index 0000000000..22181f6879 --- /dev/null +++ b/types/ember__component/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/component": ["ember__component"], + "@ember/component/*": ["ember__component/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "checkbox.d.ts", + "text-area.d.ts", + "text-field.d.ts", + "helper.d.ts", + "test/lib/assert.ts", + "test/component.ts", + "test/helper.ts" + ] +} diff --git a/types/ember__component/tslint.json b/types/ember__component/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__component/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__controller/ember__controller-tests.ts b/types/ember__controller/ember__controller-tests.ts new file mode 100644 index 0000000000..02307f447c --- /dev/null +++ b/types/ember__controller/ember__controller-tests.ts @@ -0,0 +1,11 @@ +import Controller from '@ember/controller'; + +Controller.extend ({ + queryParams: ['category'], + category: null, + isExpanded: false, + + toggleBody() { + this.toggleProperty('isExpanded'); + } +}); diff --git a/types/ember__controller/index.d.ts b/types/ember__controller/index.d.ts new file mode 100644 index 0000000000..f7505359b6 --- /dev/null +++ b/types/ember__controller/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for @ember/controller 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export default class Controller extends Ember.Controller { } +export const inject: typeof Ember.inject.controller; + +// A type registry for Ember `Controller`s. Meant to be declaration-merged +// so string lookups resolve to the correct type. +// tslint:disable-next-line no-empty-interface +export interface Registry {} diff --git a/types/ember__controller/tsconfig.json b/types/ember__controller/tsconfig.json new file mode 100644 index 0000000000..de081123ec --- /dev/null +++ b/types/ember__controller/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/controller": ["ember__controller"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__controller-tests.ts" + ] +} diff --git a/types/ember__controller/tslint.json b/types/ember__controller/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__controller/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__debug/container-debug-adapter.d.ts b/types/ember__debug/container-debug-adapter.d.ts new file mode 100644 index 0000000000..4bd24103a4 --- /dev/null +++ b/types/ember__debug/container-debug-adapter.d.ts @@ -0,0 +1,2 @@ +import Ember from 'ember'; +export default class ContainerDebugAdapter extends Ember.ContainerDebugAdapter { } diff --git a/types/ember__debug/data-adapter.d.ts b/types/ember__debug/data-adapter.d.ts new file mode 100644 index 0000000000..bc86573991 --- /dev/null +++ b/types/ember__debug/data-adapter.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class DataAdapter extends Ember.DataAdapter {} diff --git a/types/ember__debug/ember__debug-tests.ts b/types/ember__debug/ember__debug-tests.ts new file mode 100644 index 0000000000..0fbdcbc174 --- /dev/null +++ b/types/ember__debug/ember__debug-tests.ts @@ -0,0 +1,45 @@ +import { runInDebug, warn, debug, assert, registerWarnHandler, registerDeprecationHandler } from "@ember/debug"; + +/** + * @ember/debug tests + */ +runInDebug(); // $ExpectError +runInDebug(() => console.log('Should not show up in prod')); // $ExpectType void + +// Log a warning if we have more than 3 tomsters +const tomsterCount = 2; +warn('Too many tomsters!'); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3); // $ExpectType void +warn('Too many tomsters!', tomsterCount <= 3, { // $ExpectType void + id: 'ember-debug.too-many-tomsters' +}); + +debug(); // $ExpectError +debug('Too many tomsters!'); // $ExpectType void +debug('Too many tomsters!', 'foo'); // $ExpectError + +// Test for truthiness +const str = 'hello'; +assert('Must pass a string', typeof str === 'string'); // $ExpectType void + +// Fail unconditionally +assert('This code path should never be run'); // $ExpectType void + +// next is not called, so no warnings get the default behavior +registerWarnHandler(); // $ExpectError +registerWarnHandler(() => {}); // $ExpectType void +registerWarnHandler((message, { id }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + next; // $ExpectType () => void +}); + +// next is not called, so no warnings get the default behavior +registerDeprecationHandler(); // $ExpectError +registerDeprecationHandler(() => {}); // $ExpectType void +registerDeprecationHandler((message, { id, until }, next) => { // $ExpectType void + message; // $ExpectType string + id; // $ExpectType string + until; // $ExpectType string + next; // $ExpectType () => void +}); diff --git a/types/ember__debug/index.d.ts b/types/ember__debug/index.d.ts new file mode 100644 index 0000000000..8f1352baff --- /dev/null +++ b/types/ember__debug/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for @ember/debug 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; +export const assert: typeof Ember.assert; +export const debug: typeof Ember.debug; +export const inspect: typeof Ember.inspect; +export const registerDeprecationHandler: typeof Ember.Debug.registerDeprecationHandler; +export const registerWarnHandler: typeof Ember.Debug.registerWarnHandler; +export const runInDebug: typeof Ember.runInDebug; +export const warn: typeof Ember.warn; diff --git a/types/ember__debug/tsconfig.json b/types/ember__debug/tsconfig.json new file mode 100644 index 0000000000..c7688e6861 --- /dev/null +++ b/types/ember__debug/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/debug": ["ember__debug"], + "@ember/debug/*": ["ember__debug/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "data-adapter.d.ts", + "container-debug-adapter.d.ts", + "ember__debug-tests.ts" + ] +} diff --git a/types/ember__debug/tslint.json b/types/ember__debug/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__debug/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} diff --git a/types/ember__engine/index.d.ts b/types/ember__engine/index.d.ts new file mode 100644 index 0000000000..1d86a53f39 --- /dev/null +++ b/types/ember__engine/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for @ember/engine 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export default class Engine extends Ember.Engine { } +export const getEngineParent: typeof Ember.getEngineParent; diff --git a/types/ember__engine/instance.d.ts b/types/ember__engine/instance.d.ts new file mode 100644 index 0000000000..36e7948231 --- /dev/null +++ b/types/ember__engine/instance.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class EngineInstance extends Ember.EngineInstance { } diff --git a/types/ember__engine/test/engine-instance.ts b/types/ember__engine/test/engine-instance.ts new file mode 100644 index 0000000000..6358377639 --- /dev/null +++ b/types/ember__engine/test/engine-instance.ts @@ -0,0 +1,26 @@ +import EngineInstance from '@ember/engine/instance'; + +const engineInstance = EngineInstance.create(); +engineInstance.register('some:injection', class Foo {}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +engineInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +engineInstance.factoryFor('router:main'); +engineInstance.lookup('route:basic'); + +engineInstance.boot(); + +(async () => { + await engineInstance.boot(); +})(); diff --git a/types/ember__engine/test/engine.ts b/types/ember__engine/test/engine.ts new file mode 100755 index 0000000000..bc013d1026 --- /dev/null +++ b/types/ember__engine/test/engine.ts @@ -0,0 +1,41 @@ +import Engine from "@ember/engine"; +import EmberObject from "@ember/object"; + +const BaseEngine = Engine.extend({ + modulePrefix: 'my-engine' +}); + +BaseEngine.initializer({ + name: 'my-initializer', + initialize(engine) { + engine.register('foo:bar', EmberObject.extend({ foo: 'bar' })); + } +}); + +BaseEngine.instanceInitializer({ + name: 'my-instance-initializer', + initialize(engine) { + engine.lookup('foo:bar').get('foo'); + } +}); + +const Engine1 = BaseEngine.create({ + rootElement: '#engine-one', + customEvents: { + paste: 'paste' + } +}); + +const Engine2 = BaseEngine.create({ + rootElement: '#engine-two', + customEvents: { + mouseenter: null, + mouseleave: null + } +}); + +const Engine3 = BaseEngine.create(); + +const Engine3Instance1 = Engine3.buildInstance(); + +const Engine3Instance2 = Engine3.buildInstance({ foo: 'bar' }); diff --git a/types/ember__engine/tsconfig.json b/types/ember__engine/tsconfig.json new file mode 100644 index 0000000000..0c76748ca3 --- /dev/null +++ b/types/ember__engine/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/engine": ["ember__engine"], + "@ember/engine/*": ["ember__engine/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "instance.d.ts", + "test/engine.ts", + "test/engine-instance.ts" + ] +} diff --git a/types/ember__engine/tslint.json b/types/ember__engine/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__engine/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__error/ember__error-tests.ts b/types/ember__error/ember__error-tests.ts new file mode 100644 index 0000000000..a5e605cfee --- /dev/null +++ b/types/ember__error/ember__error-tests.ts @@ -0,0 +1,3 @@ +import Error from '@ember/error'; + +new Error('Fuuuuuuuu'); // $ExpectType Error diff --git a/types/ember__error/index.d.ts b/types/ember__error/index.d.ts new file mode 100644 index 0000000000..40a660ae0e --- /dev/null +++ b/types/ember__error/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for @ember/error 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +declare const Error: typeof Ember.Error; +export default Error; diff --git a/types/ember__error/tsconfig.json b/types/ember__error/tsconfig.json new file mode 100644 index 0000000000..92f8f7f0ca --- /dev/null +++ b/types/ember__error/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/error": ["ember__error"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__error-tests.ts" + ] +} diff --git a/types/ember__error/tslint.json b/types/ember__error/tslint.json new file mode 100644 index 0000000000..495d29983d --- /dev/null +++ b/types/ember__error/tslint.json @@ -0,0 +1,5 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + } +} diff --git a/types/ember__polyfills/ember__polyfills-tests.ts b/types/ember__polyfills/ember__polyfills-tests.ts new file mode 100644 index 0000000000..044ed0413c --- /dev/null +++ b/types/ember__polyfills/ember__polyfills-tests.ts @@ -0,0 +1,25 @@ +import { assign, merge } from '@ember/polyfills'; + +(() => { /* assign */ + assign({}, { a: 'b'}); + assign({}, { a: 'b'}).a; // $ExpectType string + assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string + assign({ a: 6 }, {}).a; // $ExpectType number + assign({ b: 6 }, {}).a; // $ExpectError + // TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291 + // assign({}, { b: 6 }, {}).b; // $ExpectType number + assign({ a: 'hello' }, { b: 6 }, {}).a; // $ExpectType string + // TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291 + // assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean + // TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291 + // assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError + assign({ d: ['gobias industries'] }, { a: 'hello' }, { b: 6 }, { a: true }).d; // $ExpectType string[] +})(); + +(() => { /* merge */ + merge({}, { a: 'b'}); + merge({}, { a: 'b'}).a; // $ExpectType string + merge({ a: 6 }, { a: 'b'}).a; // $ExpectType string + merge({ a: 6 }, {}).a; // $ExpectType number + merge({ b: 6 }, {}).a; // $ExpectError +})(); diff --git a/types/ember__polyfills/index.d.ts b/types/ember__polyfills/index.d.ts new file mode 100644 index 0000000000..2a3c9b4a93 --- /dev/null +++ b/types/ember__polyfills/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for @ember/polyfills 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export const assign: typeof Ember.assign; +export const merge: typeof Ember.merge; diff --git a/types/ember__polyfills/tsconfig.json b/types/ember__polyfills/tsconfig.json new file mode 100644 index 0000000000..a2a6bd371b --- /dev/null +++ b/types/ember__polyfills/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/polyfills": ["ember__polyfills"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__polyfills-tests.ts" + ] +} diff --git a/types/ember__polyfills/tslint.json b/types/ember__polyfills/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__polyfills/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__routing/auto-location.d.ts b/types/ember__routing/auto-location.d.ts new file mode 100644 index 0000000000..0c41a582f0 --- /dev/null +++ b/types/ember__routing/auto-location.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class AutoLocation extends Ember.AutoLocation { } diff --git a/types/ember__routing/hash-location.d.ts b/types/ember__routing/hash-location.d.ts new file mode 100644 index 0000000000..d55efdc3d8 --- /dev/null +++ b/types/ember__routing/hash-location.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class HashLocation extends Ember.HashLocation { } diff --git a/types/ember__routing/history-location.d.ts b/types/ember__routing/history-location.d.ts new file mode 100644 index 0000000000..342fe5f266 --- /dev/null +++ b/types/ember__routing/history-location.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class HistoryLocation extends Ember.HistoryLocation { } diff --git a/types/ember__routing/index.d.ts b/types/ember__routing/index.d.ts new file mode 100644 index 0000000000..76953906b1 --- /dev/null +++ b/types/ember__routing/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for @ember/routing 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export { default as Route } from '@ember/routing/route'; +export { default as Router } from '@ember/routing/router'; diff --git a/types/ember__routing/link-component.d.ts b/types/ember__routing/link-component.d.ts new file mode 100644 index 0000000000..5fbec30c21 --- /dev/null +++ b/types/ember__routing/link-component.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class LinkComponent extends Ember.LinkComponent { } diff --git a/types/ember__routing/location.d.ts b/types/ember__routing/location.d.ts new file mode 100644 index 0000000000..507c920f46 --- /dev/null +++ b/types/ember__routing/location.d.ts @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export const Location: typeof Ember.Location; +export default Location; diff --git a/types/ember__routing/none-location.d.ts b/types/ember__routing/none-location.d.ts new file mode 100644 index 0000000000..3c9d41d8ce --- /dev/null +++ b/types/ember__routing/none-location.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class NoneLocation extends Ember.NoneLocation { } diff --git a/types/ember__routing/route.d.ts b/types/ember__routing/route.d.ts new file mode 100644 index 0000000000..67209d2b66 --- /dev/null +++ b/types/ember__routing/route.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class Route extends Ember.Route { } diff --git a/types/ember__routing/router-service.d.ts b/types/ember__routing/router-service.d.ts new file mode 100644 index 0000000000..d243abc316 --- /dev/null +++ b/types/ember__routing/router-service.d.ts @@ -0,0 +1,3 @@ +import { RouterService } from 'ember'; + +export default class extends RouterService { } diff --git a/types/ember__routing/router.d.ts b/types/ember__routing/router.d.ts new file mode 100644 index 0000000000..d29fe2a21d --- /dev/null +++ b/types/ember__routing/router.d.ts @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default class EmberRouter extends Ember.Router { } diff --git a/types/ember__routing/test/lib/assert.ts b/types/ember__routing/test/lib/assert.ts new file mode 100755 index 0000000000..262d18bc2c --- /dev/null +++ b/types/ember__routing/test/lib/assert.ts @@ -0,0 +1,5 @@ +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): T; diff --git a/types/ember__routing/test/route.ts b/types/ember__routing/test/route.ts new file mode 100755 index 0000000000..df96f585bf --- /dev/null +++ b/types/ember__routing/test/route.ts @@ -0,0 +1,112 @@ +import Route from '@ember/routing/route'; +import Array from '@ember/array'; +import Ember from 'ember'; // currently needed for Transition +import EmberObject from '@ember/object'; +import Controller from '@ember/controller'; + +class Post extends EmberObject {} + +interface Posts extends Array {} + +Route.extend({ + beforeModel(transition: Ember.Transition) { + this.transitionTo('someOtherRoute'); + }, +}); + +Route.extend({ + afterModel(posts: Posts, transition: Ember.Transition) { + if (posts.length === 1) { + this.transitionTo('post.show', posts.firstObject); + } + }, +}); + +Route.extend({ + actions: { + showModal(evt: { modalName: string }) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application', + }); + }, + hideModal(evt: { modalName: string }) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application', + }); + }, + }, +}); + +Ember.Route.extend({ + model() { + return this.modelFor('post'); + }, +}); + +Route.extend({ + queryParams: { + memberQp: { refreshModel: true }, + }, +}); + +Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName', + }); + }, +}); + +Route.extend({ + renderTemplate(controller: Ember.Controller, model: {}) { + this.render('posts', { + view: 'someView', // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.into` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model, // the model to set on `options.controller`. + }); + }, +}); + +Route.extend({ + resetController(controller: Ember.Controller, isExiting: boolean, transition: boolean) { + if (isExiting) { + // controller.set('page', 1); + } + }, +}); + +class ApplicationController extends Controller {} +declare module '@ember/controller' { + interface Registry { + application: ApplicationController; + } +} + +Route.extend({ + setupController(controller: Controller, model: {}) { + this._super(controller, model); + this.controllerFor('application').set('model', model); + }, +}); + +class RouteUsingClass extends Route.extend({ + randomProperty: 'the .extend + extends bit type-checks properly', +}) { + beforeModel(this: RouteUsingClass) { + return 'beforeModel can return anything, not just promises'; + } + intermediateTransitionWithoutModel() { + this.intermediateTransitionTo('some-route'); + } + intermediateTransitionWithModel() { + this.intermediateTransitionTo('some.other.route', { }); + } + intermediateTransitionWithMultiModel() { + this.intermediateTransitionTo('some.other.route', 1, 2, { }); + } +} diff --git a/types/ember__routing/test/router.ts b/types/ember__routing/test/router.ts new file mode 100755 index 0000000000..760e9ed5bc --- /dev/null +++ b/types/ember__routing/test/router.ts @@ -0,0 +1,54 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const AppRouter = Ember.Router.extend({ +}); + +AppRouter.map(function() { + this.route('index', { path: '/' }); + this.route('about'); + this.route('favorites', { path: '/favs' }); + this.route('posts', function() { + this.route('index', { path: '/' }); + this.route('new'); + this.route('post', { path: '/post/:post_id', resetNamespace: true }); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + this.route('photo', { path: '/photo/:id' }, function() { + this.route('comment', { path: '/comment/:id' }); + }); + this.route('not-found', { path: '/*path' }); + this.mount('my-engine'); + this.mount('my-engine', { as: 'some-other-engine', path: '/some-other-engine'}); +}); + +const RouterServiceConsumer = Ember.Service.extend({ + router: Ember.inject.service('router'), + currentRouteName() { + const x: string = Ember.get(this, 'router').currentRouteName; + }, + currentURL() { + const x: string = Ember.get(this, 'router').currentURL; + }, + transitionWithoutModel() { + Ember.get(this, 'router') + .transitionTo('some-route'); + }, + transitionWithModel() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('some.other.route', model); + }, + transitionWithMultiModel() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('some.other.route', model, model); + }, + transitionWithModelAndOptions() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('index', model, { queryParams: { search: 'ember' }}); + } +}); diff --git a/types/ember__routing/tsconfig.json b/types/ember__routing/tsconfig.json new file mode 100644 index 0000000000..4bd4d95832 --- /dev/null +++ b/types/ember__routing/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/routing": ["ember__routing"], + "@ember/routing/*": ["ember__routing/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "auto-location.d.ts", + "hash-location.d.ts", + "history-location.d.ts", + "index.d.ts", + "link-component.d.ts", + "location.d.ts", + "none-location.d.ts", + "route.d.ts", + "router-service.d.ts", + "router.d.ts", + "test/lib/assert.ts", + "test/route.ts", + "test/router.ts" + ] +} diff --git a/types/ember__routing/tslint.json b/types/ember__routing/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__routing/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__runloop/ember__runloop-tests.ts b/types/ember__runloop/ember__runloop-tests.ts new file mode 100644 index 0000000000..132d687bbd --- /dev/null +++ b/types/ember__runloop/ember__runloop-tests.ts @@ -0,0 +1,203 @@ +import Ember from 'ember'; +import RSVP from 'rsvp'; +import { run } from '@ember/runloop'; + +Ember.run.queues; // $ExpectType EmberRunQueues[] +const queues: string[] = Ember.run.queues; + +function testRun() { + run(() => { // $ExpectType number + // code to be executed within a RunLoop + return 123; + }); + + function destroyApp(application: Ember.Application) { + Ember.run(application, 'destroy'); + run(application, function() { + this.destroy(); + }); + } +} + +function testBind() { + Ember.Component.extend({ + init() { + const bound = Ember.run.bind(this, this.setupEditor); + bound(); + }, + + editor: null as string | null, + + setupEditor(editor: string) { + this.set('editor', editor); + } + }); +} + +function testCancel() { + const myContext = {}; + + const runNext = run.next(myContext, () => { + // will not be executed + }); + + run.cancel(runNext); + + const runLater = run.later(myContext, () => { + // will not be executed + }, 500); + + run.cancel(runLater); + + const runScheduleOnce = run.scheduleOnce('afterRender', myContext, () => { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + const runOnce = run.once(myContext, () => { + // will not be executed + }); + + run.cancel(runOnce); + + const throttle = run.throttle(myContext, () => { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + const debounce = run.debounce(myContext, () => { + // will not be executed + }, 1); + + run.cancel(debounce); + + const debounceImmediate = run.debounce(myContext, () => { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be canceled + run.cancel(debounceImmediate); +} + +function testDebounce() { + function runIt() { + } + + const myContext = { name: 'debounce' }; + + run.debounce(runIt, 150); + run.debounce(myContext, runIt, 150); + run.debounce(myContext, runIt, 150, true); + + Ember.Component.extend({ + searchValue: 'test', + fetchResults(value: string) {}, + + actions: { + handleTyping() { + // the fetchResults function is passed into the component from its parent + Ember.run.debounce(this, this.get('fetchResults'), this.get('searchValue'), 250); + } + } + }); +} + +function testBegin() { + run.begin(); + // code to be executed within a RunLoop + run.end(); +} + +function testJoin() { + run.join(() => { + // creates a new run-loop + }); + + run(() => { + // creates a new run-loop + run.join(() => { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. + }); + }); + + new RSVP.Promise((resolve) => { + Ember.run.later(() => { + resolve({ msg: 'Hold Your Horses' }); + }, 3000); + }); +} + +function testLater() { + const myContext = {}; + run.later(myContext, () => { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); +} + +function testNext() { + const myContext = {}; + run.next(myContext, () => { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); +} + +function testOnce() { + Ember.Component.extend({ + init() { + Ember.run.once(this, 'processFullName'); + }, + + processFullName() { + } + }); +} + +function testSchedule() { + Ember.Component.extend({ + init() { + run.schedule('sync', this, () => { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, () => { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + } + }); + + Ember.run.schedule('actions', () => { + // Do more things + }); +} + +function testScheduleOnce() { + function sayHi() { + console.log('hi'); + } + + const myContext = {}; + run(() => { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + run.scheduleOnce('actions', myContext, () => { + console.log('Closure'); + }); +} + +function testThrottle() { + function runIt() { + } + + const myContext = { name: 'throttle' }; + + run.throttle(runIt, 150); + run.throttle(myContext, runIt, 150); +} diff --git a/types/ember__runloop/index.d.ts b/types/ember__runloop/index.d.ts new file mode 100644 index 0000000000..acc8c3ad8a --- /dev/null +++ b/types/ember__runloop/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for @ember/runloop 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export const begin: typeof Ember.run.begin; +export const bind: typeof Ember.run.bind; +export const cancel: typeof Ember.run.cancel; +export const debounce: typeof Ember.run.debounce; +export const end: typeof Ember.run.end; +export const join: typeof Ember.run.join; +export const later: typeof Ember.run.later; +export const next: typeof Ember.run.next; +export const once: typeof Ember.run.once; +export const run: typeof Ember.run; +export const schedule: typeof Ember.run.schedule; +export const scheduleOnce: typeof Ember.run.scheduleOnce; +export const throttle: typeof Ember.run.throttle; diff --git a/types/ember__runloop/tsconfig.json b/types/ember__runloop/tsconfig.json new file mode 100644 index 0000000000..ef1e325ff4 --- /dev/null +++ b/types/ember__runloop/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/runloop": ["ember__runloop"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__runloop-tests.ts" + ] +} diff --git a/types/ember__runloop/tslint.json b/types/ember__runloop/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__runloop/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} diff --git a/types/ember__service/ember__service-tests.ts b/types/ember__service/ember__service-tests.ts new file mode 100644 index 0000000000..ee2e39823c --- /dev/null +++ b/types/ember__service/ember__service-tests.ts @@ -0,0 +1,38 @@ +import Service, { inject } from "@ember/service"; +import EmberObject from "@ember/object"; + +class FirstSvc extends Service { + foo = 'bar'; + first() { return ''; } +} +const SecondSvc = Service.extend({ + foo: 'bar', + second() { return ''; } +}); + +class ThirdSvc extends Service.extend({ + foo: 'bar', + third() { return ''; } +}) { } + +declare module '@ember/service' { + interface Registry { + first: FirstSvc; + second: InstanceType; + third: ThirdSvc; + } +} + +const ServiceTriplet = EmberObject.extend({ + sFirst: inject('first'), + sSecond: inject('second'), + sThird: inject('third'), + unknownService: inject() +}); + +const obj = ServiceTriplet.create(); + +obj.get('sFirst'); // $ExpectType FirstSvc +obj.get('sSecond').second(); // $ExpectType "" +obj.get('sThird'); // $ExpectType ThirdSvc +obj.get('unknownService'); // $ExpectType Service diff --git a/types/ember__service/index.d.ts b/types/ember__service/index.d.ts new file mode 100644 index 0000000000..fa5d687441 --- /dev/null +++ b/types/ember__service/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for @ember/service 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export default class Service extends Ember.Service { } +export const inject: typeof Ember.inject.service; + +// A type registry for Ember `Service`s. Meant to be declaration-merged so +// string lookups resolve to the correct type. +// tslint:disable-next-line no-empty-interface strict-export-declare-modifiers +interface Registry {} diff --git a/types/ember__service/tsconfig.json b/types/ember__service/tsconfig.json new file mode 100644 index 0000000000..9f0a8a04c2 --- /dev/null +++ b/types/ember__service/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/service": ["ember__service"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__service-tests.ts" + ] +} diff --git a/types/ember__service/tslint.json b/types/ember__service/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__service/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__string/ember__string-tests.ts b/types/ember__string/ember__string-tests.ts new file mode 100644 index 0000000000..f9f7dbef50 --- /dev/null +++ b/types/ember__string/ember__string-tests.ts @@ -0,0 +1,33 @@ +import { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } from '@ember/string'; + +dasherize(); // $ExpectError +dasherize('blue man group'); // $ExpectType string +dasherize('', ''); // $ExpectError + +camelize(); // $ExpectError +camelize('blue man group'); // $ExpectType string +camelize('', ''); // $ExpectError + +decamelize(); // $ExpectError +decamelize('blue man group'); // $ExpectType string +decamelize('', ''); // $ExpectError + +underscore(); // $ExpectError +underscore('blue man group'); // $ExpectType string +underscore('', ''); // $ExpectError + +w(); // $ExpectError +w('blue man group'); // $ExpectType string[] +w('', ''); // $ExpectError + +classify(); // $ExpectError +classify('blue man group'); // $ExpectType string +classify('', ''); // $ExpectError + +capitalize(); // $ExpectError +capitalize('blue man group'); // $ExpectType string +capitalize('', ''); // $ExpectError + +loc(); // $ExpectError +loc("_Hello World"); // $ExpectType string +loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string diff --git a/types/ember__string/index.d.ts b/types/ember__string/index.d.ts new file mode 100644 index 0000000000..1586b4dcc4 --- /dev/null +++ b/types/ember__string/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for @ember/string 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; + +export const camelize: typeof Ember.String.camelize; +export const capitalize: typeof Ember.String.capitalize; +export const classify: typeof Ember.String.classify; +export const dasherize: typeof Ember.String.dasherize; +export const decamelize: typeof Ember.String.decamelize; +export const htmlSafe: typeof Ember.String.htmlSafe; +export const isHTMLSafe: typeof Ember.String.isHTMLSafe; +export const loc: typeof Ember.String.loc; +export const underscore: typeof Ember.String.underscore; +export const w: typeof Ember.String.w; diff --git a/types/ember__string/tsconfig.json b/types/ember__string/tsconfig.json new file mode 100644 index 0000000000..100fad10f5 --- /dev/null +++ b/types/ember__string/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/string": ["ember__string"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__string-tests.ts" + ] +} diff --git a/types/ember__string/tslint.json b/types/ember__string/tslint.json new file mode 100644 index 0000000000..10d875b8db --- /dev/null +++ b/types/ember__string/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": {} +} diff --git a/types/ember__test/adapter.d.ts b/types/ember__test/adapter.d.ts new file mode 100644 index 0000000000..5f312cf381 --- /dev/null +++ b/types/ember__test/adapter.d.ts @@ -0,0 +1,2 @@ +import Ember from 'ember'; +export default class TestAdapter extends Ember.Test.Adapter { } diff --git a/types/ember__test/ember__test-tests.ts b/types/ember__test/ember__test-tests.ts new file mode 100644 index 0000000000..b98ab26a01 --- /dev/null +++ b/types/ember__test/ember__test-tests.ts @@ -0,0 +1,39 @@ +import { registerWaiter, registerHelper, registerAsyncHelper } from '@ember/test'; +import TestAdapter from '@ember/test/adapter'; + +const pending = 0; +registerWaiter(() => pending !== 0); + +declare const MyDb: { + hasPendingTransactions(): boolean; +}; + +registerWaiter(MyDb, MyDb.hasPendingTransactions); +registerWaiter(); // $ExpectError + +registerHelper('boot', app => { + app.advanceReadiness(); // $ExpectType void + app.deferReadiness(); // $ExpectType void + app.register('foo', class {}); // $ExpectType void + app.register('foo'); // $ExpectError + app.register(); // $ExpectError +}); + +registerAsyncHelper('boot', app => { + app.advanceReadiness(); + app.deferReadiness(); + app.register('foo', class {}); +}); + +registerAsyncHelper('waitForPromise', (app, promise) => { + app.advanceReadiness(); + app.deferReadiness(); + app.register('foo', class {}); + return new Promise(() => { + const adapter = new TestAdapter(); + adapter.asyncStart(); + return promise.then(() => { + adapter.asyncEnd(); + }); + }); +}); diff --git a/types/ember__test/index.d.ts b/types/ember__test/index.d.ts new file mode 100644 index 0000000000..94bc312566 --- /dev/null +++ b/types/ember__test/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for @ember/test 3.0 +// Project: http://emberjs.com/ +// Definitions by: Mike North +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import Ember from 'ember'; +export const registerAsyncHelper: typeof Ember.Test.registerAsyncHelper; +export const registerHelper: typeof Ember.Test.registerHelper; +export const registerWaiter: typeof Ember.Test.registerWaiter; +export const unregisterHelper: typeof Ember.Test.unregisterHelper; +export const unregisterWaiter: typeof Ember.Test.unregisterWaiter; diff --git a/types/ember__test/tsconfig.json b/types/ember__test/tsconfig.json new file mode 100644 index 0000000000..89f8c76b60 --- /dev/null +++ b/types/ember__test/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@ember/test": ["ember__test"], + "@ember/test/*": ["ember__test/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "adapter.d.ts", + "ember__test-tests.ts" + ] +} diff --git a/types/ember__test/tslint.json b/types/ember__test/tslint.json new file mode 100644 index 0000000000..1a60b8a5dd --- /dev/null +++ b/types/ember__test/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} diff --git a/types/ember__utils/ember__utils-tests.ts b/types/ember__utils/ember__utils-tests.ts index d93e2a1ec7..8b270f1bec 100644 --- a/types/ember__utils/ember__utils-tests.ts +++ b/types/ember__utils/ember__utils-tests.ts @@ -8,6 +8,7 @@ import { tryInvoke, typeOf } from '@ember/utils'; +import EmberObject from '@ember/object'; (function() { /** isNone */ @@ -161,3 +162,10 @@ import { isEmpty({ size: 1 }); // $ExpectType boolean isEmpty({ size: () => 0 }); // $ExpectType boolean })(); + +class Foo extends EmberObject.extend({ + abc: true, + bar() { return '123'; } +}) { + def: 'hello'; +} diff --git a/types/env-paths/env-paths-tests.ts b/types/env-paths/env-paths-tests.ts index 5281df4cfc..9f360bbe41 100644 --- a/types/env-paths/env-paths-tests.ts +++ b/types/env-paths/env-paths-tests.ts @@ -6,3 +6,5 @@ envPaths('./'); envPaths('./', {suffix: 'test'}); // $ExpectType Paths envPaths('./', {suffix: false}); +// $ExpectType Paths +envPaths('./', {suffix: true}); diff --git a/types/env-paths/index.d.ts b/types/env-paths/index.d.ts index 69deed7731..8b594d8a61 100644 --- a/types/env-paths/index.d.ts +++ b/types/env-paths/index.d.ts @@ -5,7 +5,7 @@ export = envPaths; -declare function envPaths(name: string, opts?: { suffix: string | false }): envPaths.Paths; +declare function envPaths(name: string, opts?: { suffix: string | boolean }): envPaths.Paths; declare namespace envPaths { interface Paths { diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index e1762b843e..0711243d0c 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -363,6 +363,10 @@ function ShallowWrapperTest() { shallowWrapper.simulate('click', args); } + function test_simulateError(error: any) { + shallowWrapper.simulateError(error); + } + function test_setState() { shallowWrapper = shallowWrapper.setState({ stateProperty: 'state' }, () => console.log('state updated')); } diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index a91f60b3c6..60262e3d04 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -221,6 +221,13 @@ export interface CommonWrapper

> { */ simulate(event: string, ...args: any[]): this; + /** + * Used to simulate throwing a rendering error. Pass an error to throw. + * Returns itself. + * @param error + */ + simulateError(error: any): this; + /** * A method to invoke setState() on the root component instance similar to how you might in the definition of * the component, and re-renders. This method is useful for testing your component in hard to achieve states, diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 0098a14489..ac1c6e3452 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -287,6 +287,30 @@ Camera.Constants.BarCodeType; } }} />); }; +async (camera: CameraObject) => { + const picture = await camera.takePictureAsync({ + quality: 0.5, + base64: true, + exif: true + }); + + picture.uri; + picture.width; + picture.height; + picture.exif; + picture.base64; + + camera.takePictureAsync({ + quality: 1, + onPictureSaved: pic => { + pic.uri; + pic.width; + pic.height; + pic.exif; + pic.base64; + } + }); +}; async () => { const result = await DocumentPicker.getDocumentAsync(); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 868afd5e56..1376dea57c 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -769,6 +769,9 @@ export namespace Brightness { */ export interface PictureOptions { quality?: number; + base64?: boolean; + exif?: boolean; + onPictureSaved?: (data: PictureResponse) => void; } export interface PictureResponse { diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index 248a0ba96c..a9d044cfcb 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -201,8 +201,8 @@ declare namespace Faker { }; system: { - fileName(ext: string, type: string): string; - commonFileName(ext: string, type: string): string; + fileName(ext?: string, type?: string): string; + commonFileName(ext: string, type?: string): string; mimeType(): string; commonFileType(): string; commonFileExt(): string; diff --git a/types/grasp/grasp-tests.ts b/types/grasp/grasp-tests.ts index 87da0b8d45..0c732e2e21 100644 --- a/types/grasp/grasp-tests.ts +++ b/types/grasp/grasp-tests.ts @@ -17,10 +17,7 @@ grasp({ }); // $ExpectError -grasp({ - args: [], - textFormat: { cyan: "cyan" } -}); +grasp({ args: [], textFormat: { cyan: "cyan" } }); // $ExpectType string grasp.VERSION; diff --git a/types/helmet/helmet-tests.ts b/types/helmet/helmet-tests.ts index afedea6c23..59e5613408 100644 --- a/types/helmet/helmet-tests.ts +++ b/types/helmet/helmet-tests.ts @@ -25,9 +25,10 @@ function helmetTest() { */ function contentSecurityPolicyTest() { const emptyArray: string[] = []; - const config = { + const config: helmet.IHelmetContentSecurityPolicyConfiguration = { directives: { baseUri: ['base.example.com'], + blockAllMixedContent: true, childSrc: ['child.example.com'], connectSrc: ['connect.example.com'], defaultSrc: ['*'], @@ -37,14 +38,20 @@ function contentSecurityPolicyTest() { frameSrc: emptyArray, imgSrc: ['images.example.com'], mediaSrc: ['media.example.com'], + manifestSrc: ['manifest.example.com'], objectSrc: ['objects.example.com'], pluginTypes: emptyArray, + prefetchSrc: ['prefetch.example.com'], reportUri: '/some-url', - sandbox: emptyArray, + reportTo: 'report.example.com', + requireSriFor: emptyArray, + sandbox: ['allow-presentation'], scriptSrc: ['scripts.example.com', function (req: express.Request, res: express.Response) { return "'nonce-abc123'"; }], - styleSrc: ['css.example.com'] + styleSrc: ['css.example.com'], + upgradeInsecureRequests: true, + workerSrc: ['worker.example.com'] }, reportOnly: false, setAllHeaders: false, diff --git a/types/helmet/index.d.ts b/types/helmet/index.d.ts index 6f89728e8a..3625d029a0 100644 --- a/types/helmet/index.d.ts +++ b/types/helmet/index.d.ts @@ -35,8 +35,27 @@ declare namespace helmet { } export type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction; + export type HelmetCspSandboxDirective = + | string + | 'allow-forms' + | 'allow-modals' + | 'allow-orientation-lock' + | 'allow-pointer-lock' + | 'allow-popups-to-escape-sandbox' + | 'allow-popups' + | 'allow-presentation' + | 'allow-same-origin' + | 'allow-scripts' + | 'allow-top-navigation' + + export type HelmetCspRequireSriForValue = + | string + | 'script' + | 'style' + export interface IHelmetContentSecurityPolicyDirectives { baseUri?: HelmetCspDirectiveValue[]; + blockAllMixedContent?: boolean; childSrc?: HelmetCspDirectiveValue[]; connectSrc?: HelmetCspDirectiveValue[]; defaultSrc?: HelmetCspDirectiveValue[]; @@ -45,13 +64,45 @@ declare namespace helmet { frameAncestors?: HelmetCspDirectiveValue[]; frameSrc?: HelmetCspDirectiveValue[]; imgSrc?: HelmetCspDirectiveValue[]; + manifestSrc?: HelmetCspDirectiveValue[]; mediaSrc?: HelmetCspDirectiveValue[]; objectSrc?: HelmetCspDirectiveValue[]; pluginTypes?: HelmetCspDirectiveValue[]; + prefetchSrc?: HelmetCspDirectiveValue[]; + reportTo?: string; reportUri?: string; - sandbox?: HelmetCspDirectiveValue[]; + requireSriFor?: HelmetCspRequireSriForValue[]; + sandbox?: HelmetCspSandboxDirective[]; scriptSrc?: HelmetCspDirectiveValue[]; styleSrc?: HelmetCspDirectiveValue[]; + upgradeInsecureRequests?: boolean; + workerSrc?: HelmetCspDirectiveValue[]; + } + + export interface IHelmetContentSecurityPolicyDirectives { + 'base-uri'?: HelmetCspDirectiveValue[]; + 'block-all-mixed-content'?: boolean; + 'child-src'?: HelmetCspDirectiveValue[]; + 'connect-src'?: HelmetCspDirectiveValue[]; + 'default-src'?: HelmetCspDirectiveValue[]; + 'font-src'?: HelmetCspDirectiveValue[]; + 'form-action'?: HelmetCspDirectiveValue[]; + 'frame-ancestors'?: HelmetCspDirectiveValue[]; + 'frame-src'?: HelmetCspDirectiveValue[]; + 'img-src'?: HelmetCspDirectiveValue[]; + 'manifest-src'?: HelmetCspDirectiveValue[]; + 'media-src'?: HelmetCspDirectiveValue[]; + 'object-src'?: HelmetCspDirectiveValue[]; + 'plugin-types'?: HelmetCspDirectiveValue[]; + 'prefetch-src'?: HelmetCspDirectiveValue[]; + 'report-to'?: string; + 'report-uri'?: string; + 'require-sri-for'?: HelmetCspRequireSriForValue[]; + 'sandbox'?: HelmetCspSandboxDirective[]; + 'script-src'?: HelmetCspDirectiveValue; + 'style-src'?: HelmetCspDirectiveValue; + 'upgrade-insecure-requests'?: boolean; + 'worker-src'?: HelmetCspDirectiveValue; } export interface IHelmetContentSecurityPolicyConfiguration { diff --git a/types/jest-when/index.d.ts b/types/jest-when/index.d.ts new file mode 100644 index 0000000000..af62a95830 --- /dev/null +++ b/types/jest-when/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for jest-when 1.1 +// Project: https://github.com/timkindberg/jest-when#readme +// Definitions by: Alden Taylor +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export interface PartialMockInstance { + mockReturnValue: jest.MockInstance['mockReturnValue']; +} + +export interface When { + (fn: jest.Mocked | jest.Mock): When; + // due to no-unnecessary-generics lint rule, the generics have been replaced with 'any' + // calledWith(...matchers: any[]): PartialMockInstance; + // expectCalledWith(...matchers: any[]): PartialMockInstance; + calledWith(...matchers: any[]): PartialMockInstance; + expectCalledWith(...matchers: any[]): PartialMockInstance; +} + +export const when: When; diff --git a/types/jest-when/jest-when-tests.ts b/types/jest-when/jest-when-tests.ts new file mode 100644 index 0000000000..13da65928d --- /dev/null +++ b/types/jest-when/jest-when-tests.ts @@ -0,0 +1,57 @@ +import { when } from 'jest-when'; + +describe('mock-when test', () => { + it('basic usage:', () => { + const fn = jest.fn(); + when(fn).calledWith(1).mockReturnValue('yay!'); + + const result = fn(1); + expect(result).toEqual('yay!'); + }); + + it('Supports multiple args:', () => { + const fn = jest.fn(); + when(fn).calledWith(1, true, 'foo').mockReturnValue('yay!'); + + const result = fn(1, true, 'foo'); + expect(result).toEqual('yay!'); + }); + + it('Supports jest matchers:', () => { + const fn = jest.fn(); + when(fn).calledWith( + expect.anything(), + expect.any(Number), + expect.arrayContaining([false]) + ).mockReturnValue('yay!'); + + const result = fn('whatever', 100, [true, false]); + expect(result).toEqual('yay!'); + }); + + it('Supports compound declarations:', () => { + const fn = jest.fn(); + when(fn).calledWith(1).mockReturnValue('no'); + when(fn).calledWith(2).mockReturnValue('way?'); + when(fn).calledWith(3).mockReturnValue('yes'); + when(fn).calledWith(4).mockReturnValue('way!'); + + expect(fn(1)).toEqual('no'); + expect(fn(2)).toEqual('way?'); + expect(fn(3)).toEqual('yes'); + expect(fn(4)).toEqual('way!'); + expect(fn(5)).toEqual(undefined); + }); + + it('Assert the args:', () => { + const fn = jest.fn(); + when(fn).expectCalledWith(1).mockReturnValue('x'); + let testPassed = false; + try { + fn(2); // Will throw a helpful jest assertion error with args diff + } catch (e) { + testPassed = true; + } + expect(testPassed).toBeTruthy(); + }); +}); diff --git a/types/jest-when/tsconfig.json b/types/jest-when/tsconfig.json new file mode 100644 index 0000000000..46c037813f --- /dev/null +++ b/types/jest-when/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", + "jest-when-tests.ts" + ] +} \ No newline at end of file diff --git a/types/redux-little-router/tslint.json b/types/jest-when/tslint.json similarity index 100% rename from types/redux-little-router/tslint.json rename to types/jest-when/tslint.json diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 5af6969665..166be7d526 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -13,6 +13,8 @@ // Rafael Kallis // Conan Lai // Peter Thorson +// Will Garcia +// Simon Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -147,6 +149,13 @@ export interface UriOptions { relativeOnly?: boolean; } +export interface DataUriOptions { + /** + * optional parameter defaulting to true which will require = padding if true or make padding optional if false + */ + paddingRequired?: boolean; +} + export interface Base64Options { /** * optional parameter defaulting to true which will require = padding if true or make padding optional if false @@ -630,6 +639,11 @@ export interface StringSchema extends AnySchema { */ uri(options?: UriOptions): this; + /** + * Requires the string value to be a valid data URI string. + */ + dataUri(options?: DataUriOptions): this; + /** * Requires the string value to be a valid GUID. */ diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 5defe20cc1..c9805e1fc3 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -120,6 +120,12 @@ base64Opts = { paddingRequired: bool }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +let dataUriOpts: Joi.DataUriOptions = null; + +dataUriOpts = { paddingRequired: bool }; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + let whenOpts: Joi.WhenOptions = null; whenOpts = { is: x }; @@ -818,6 +824,8 @@ strSchema = strSchema.normalize(); strSchema = strSchema.normalize('NFKC'); strSchema = strSchema.base64(); strSchema = strSchema.base64(base64Opts); +strSchema = strSchema.dataUri(); +strSchema = strSchema.dataUri(dataUriOpts); { // common strSchema = strSchema.allow(x); diff --git a/types/jsdom/index.d.ts b/types/jsdom/index.d.ts index cfb54fa25f..1aa9750fbc 100644 --- a/types/jsdom/index.d.ts +++ b/types/jsdom/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for jsdom 11.0 +// Type definitions for jsdom 11.12 // Project: https://github.com/tmpvar/jsdom#readme // Definitions by: Leonard Thieu +// Johan Palmfjord // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -101,6 +102,20 @@ export type ConstructorOptions = Options & { * Values that are not "text/html" or an XML mime type will throw. It defaults to "text/html". */ contentType?: string; + /** + * jsdom does not have the capability to render visual content, and will act like a headless browser by default. + * It provides hints to web pages through APIs such as document.hidden that their content is not visible. + * + * When the pretendToBeVisual option is set to true, jsdom will pretend that it is rendering and displaying + * content. + */ + pretendToBeVisual?: boolean + /** + * The maximum size in code units for the separate storage areas used by localStorage and sessionStorage. + * Attempts to store data larger than this limit will cause a DOMException to be thrown. By default, it is set + * to 5,000,000 code units per origin, as inspired by the HTML specification. + */ + storageQuota?: number }; export interface DOMWindow extends Window { diff --git a/types/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts index 2dbbdca601..da82b2db7c 100644 --- a/types/jsdom/jsdom-tests.ts +++ b/types/jsdom/jsdom-tests.ts @@ -68,6 +68,14 @@ function test_beforeParse() { }); } +function test_storageQuota() { + new JSDOM('', { storageQuota: 1337 }); +} + +function test_pretendToBeVisual() { + new JSDOM('', { pretendToBeVisual: true }); +} + function test_serialize() { const dom = new JSDOM(`hello`); diff --git a/types/koa-convert/index.d.ts b/types/koa-convert/index.d.ts index ed5cd38480..498088b4c6 100644 --- a/types/koa-convert/index.d.ts +++ b/types/koa-convert/index.d.ts @@ -7,7 +7,7 @@ import { Context, Middleware } from "koa"; declare function convert( - mw: (context: Context, next: () => void) => Generator + mw: (context: Context, next: () => Promise) => Generator ): Middleware; export = convert; diff --git a/types/kue/index.d.ts b/types/kue/index.d.ts index 4117ef0a82..9153039ff0 100644 --- a/types/kue/index.d.ts +++ b/types/kue/index.d.ts @@ -78,6 +78,8 @@ export declare class Job extends events.EventEmitter { public failed_at: string | number; public started_at: string | number; public client: redisClientFactory.RedisClient; + public workerId: string; + private _error: string; private _max_attempts; static priorities: Priorities; diff --git a/types/mali/index.d.ts b/types/mali/index.d.ts index 1c73b18c75..8e536d5330 100644 --- a/types/mali/index.d.ts +++ b/types/mali/index.d.ts @@ -10,68 +10,68 @@ import { EventEmitter } from 'events'; import { Stream } from 'stream'; declare class Mali extends EventEmitter { - constructor(path: any, name?: string | ReadonlyArray, options?: any); - name: string; - env: string; - ports: ReadonlyArray; // ? not sure which it is - silent: boolean; + constructor(path: any, name?: string | ReadonlyArray, options?: any); + name: string; + env: string; + ports: ReadonlyArray; + silent: boolean; - addService(path: any, name: string | ReadonlyArray, options?: any): void; - use(service?: any, name?: any, fns?: any): void; - start(port?: any, creds?: any, options?: any): any; // gnarly type asserting for these functions so Im just gonna let them handle it. - toJSON(): any; - close(): void; - inspect(): any; + addService(path: any, name: string | ReadonlyArray, options?: any): void; + use(service?: any, name?: any, fns?: any): void; + start(port: number | string, creds?: any, options?: any): any; // gnarly type inferring for these functions so Im just gonna let them handle it. + toJSON(): any; + close(): Promise; + inspect(): any; } declare namespace Mali { - interface Context { - name: string; - fullName: string; - service: string; - package: string; - app: any; // ? app - call: any; - request: Request; - response: Response; - req: any; // ? - res: any; // ? - type: string; - metadata: string; - get(field: string): any; - set(field: any, val?: any): void; // do I need `?:` if its of type `any`? - sendMetadata(md: any): void; - getStatus(field: string): any; - setStatus(field: any, val?: any): void; // ^ - } + interface Context { + name: string; + fullName: string; + service: string; + package: string; + app: any; // ? app + call: any; + request: Request; + response: Response; + req: any; // ? + res: any; // ? + type: string; + metadata: string; + get(field: string): any; + set(field: any, val?: any): void; // do I need `?:` if its of type `any`? + sendMetadata(md: any): void; + getStatus(field: string): any; + setStatus(field: any, val?: any): void; // ^ + } - class Request { - constructor(call: any, type: string); - call: any; - type: string; - metadata: any; - req: any; // ? + class Request { + constructor(call: any, type: string); + call: any; + type: string; + metadata: any; + req: any; // ? - getMetadata(): any; - get(field: string): any; - } + getMetadata(): any; + get(field: string): any; + } - class Response { - constructor(call: any, type: string); - call: any; - type: string; - metadata: any; - status: any; - res: any; // ? - set(field: any, val?: any): void; // is `val?:` necessary when its of type `any`? - get(field: string): any; - getMetadata(): any; - sendMetadata(md?: any): void; - getStatus(field: string): any; - setStatus(field: any, val?: any): void; // ^ same as above - } + class Response { + constructor(call: any, type: string); + call: any; + type: string; + metadata: any; + status: any; + res: any; // ? + set(field: any, val?: any): void; // is `val?:` necessary when its of type `any`? + get(field: string): any; + getMetadata(): any; + sendMetadata(md?: any): void; + getStatus(field: string): any; + setStatus(field: any, val?: any): void; // ^ same as above + } - function exec(ctx: Context, handler: any, cb?: any): void; + function exec(ctx: Context, handler: any, cb?: any): void; } export = Mali; diff --git a/types/memdown/index.d.ts b/types/memdown/index.d.ts new file mode 100644 index 0000000000..ab7b8dfe36 --- /dev/null +++ b/types/memdown/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for memdown 3.0 +// Project: https://github.com/Level/memdown +// Definitions by: Meirion Hughes +// Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { AbstractLevelDOWN } from 'abstract-leveldown'; + +export interface MemDown extends AbstractLevelDOWN {} + +export interface MemDownConstructor { + // tslint:disable-next-line no-unnecessary-generics + new (): MemDown; + // tslint:disable-next-line no-unnecessary-generics + (): MemDown; +} + +export const MemDown: MemDownConstructor; +export default MemDown; diff --git a/types/memdown/memdown-tests.ts b/types/memdown/memdown-tests.ts new file mode 100644 index 0000000000..f93a4bb779 --- /dev/null +++ b/types/memdown/memdown-tests.ts @@ -0,0 +1,16 @@ +import MemDown from 'memdown'; + +const test = (db: MemDown) => { + db.open(() => { + db.put("key", "value", (err?: Error) => { }); + db.get("key", (err?: Error) => { }); + db.get("key", (err: Error | undefined, value: string) => { }); + db.close(() => {}); + }); +}; + +// doesn't need `new` and can be called as a function +test(new MemDown()); +test(new MemDown()); +test(MemDown()); +test(MemDown()); diff --git a/types/memdown/tsconfig.json b/types/memdown/tsconfig.json new file mode 100644 index 0000000000..dd3aa17b6c --- /dev/null +++ b/types/memdown/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", + "memdown-tests.ts" + ] +} \ No newline at end of file diff --git a/types/memdown/tslint.json b/types/memdown/tslint.json new file mode 100644 index 0000000000..256ee54775 --- /dev/null +++ b/types/memdown/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 07b26d494c..443712c325 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -51,8 +51,8 @@ export interface RedirectProps { strict?: boolean; } -export interface RouteComponentProps

{ - match: match

; +export interface RouteComponentProps { + match: match; location: H.Location; history: H.History; staticContext?: any; diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 3cbc3af64a..cad52bb88a 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -14,6 +14,7 @@ // Wan Bachtiar // Geraldine Lemeur // Jimmy Shimizu +// Dominik Heigl // Angela-1 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -23,7 +24,7 @@ /// /// -import { ObjectID } from 'bson'; +import { ObjectID, Timestamp } from 'bson'; import { EventEmitter } from 'events'; import { Readable, Writable } from "stream"; @@ -59,13 +60,136 @@ export class MongoClient extends EventEmitter { logout(options?: { dbName?: string }): Promise; logout(options: { dbName?: string }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#startSession */ - startSession(options?: any): ClientSession; + startSession(options?: SessionOptions): ClientSession; + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#watch */ + watch(pipeline?: Object[], options?: ChangeStreamOptions & { startAtClusterTime?: Timestamp, session?: ClientSession }): ChangeStream; + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#withSession */ + withSession(operation: (session: ClientSession) => Promise): Promise; + /** http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#withSession */ + withSession(options: SessionOptions, operation: (session: ClientSession) => Promise): Promise; } -declare class ClientSession extends EventEmitter { - endSession(callback?: MongoCallback): void; - endSession(options: any, callback?: MongoCallback): void; +/** + * http://mongodb.github.io/node-mongodb-native/3.1/api/ClientSession.html + */ +export interface ClientSession extends EventEmitter { + /** The server id associated with this session */ + id: any; + /** + * Aborts the currently active transaction in this session. + * @param {MongoCallback} [cb] Optional callback for completion of this operation + */ + abortTransaction(cb?: MongoCallback): Promise; + /** + * Advances the operationTime for a ClientSession. + * @param {mongodb.Timestamp} operationTime + */ + advanceOperationTime(operamtionTime: Timestamp): void; + /** + * Commits the currently active transaction in this session. + * @param {MongoCallback} [cb] Optional callback for completion of this operation + */ + commitTransaction(cb?: MongoCallback): Promise; + + /** + * Ends this session on the server + * @param {MongoCallback} [cb] Optional callback for completion of this operation + */ + endSession(cb?: MongoCallback): void; + /** + * Ends this session on the server + * @param {*} [options] Optional settings. Currently reserved for future use + * @param {MongoCallback} [cb] Optional callback for completion of this operation + */ + endSession(options: any, cb?: MongoCallback): void + + /** + * Used to determine if this session equals another + * + * @param {ClientSession} session A class representing a client session on the server + * @returns {boolean} if the sessions are equal + */ equals(session: ClientSession): boolean; + + /** Increment the transaction number on the internal ServerSession */ + incrementTransactionNumber(): void; + + /** + * @returns {boolean} this session is currently in a transaction or not + */ + inTransaction(): boolean; + + /** + * Starts a new transaction with the given options. + * @param {TransactionOptions} options + * @memberof ClientSession + */ + startTransaction(options?: TransactionOptions): void; + +} + +// http://mongodb.github.io/node-mongodb-native/3.1/api/global.html#ReadConcern +type ReadConcernLevel = 'local' | 'available' | 'majority' | 'linearizable' | 'snapshot'; + +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * http://mongodb.github.io/node-mongodb-native/3.1/api/global.html#ReadConcern + */ +export interface ReadConcern { + level: ReadConcernLevel; +} + +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * http://mongodb.github.io/node-mongodb-native/3.1/api/global.html#WriteConcern + */ +interface WriteConcern { + /** + * requests acknowledgement that the write operation has + * propagated to a specified number of mongod hosts + * @type {(number | 'majority' | string)} default 1 + */ + w?: number | 'majority' | string; + /** + * requests acknowledgement from MongoDB that the write operation has + * been written to the journal + * @type {boolean} default false + */ + j?: boolean; + /** + * a time limit, in milliseconds, for the write concern + * @type {number} + * @memberof WriteConcern + */ + wtimeout?: number; +} + +/** + * Options to pass when creating a Client Session + * http://mongodb.github.io/node-mongodb-native/3.1/api/global.html#SessionOptions + */ +export interface SessionOptions { + /** + * Whether causal consistency should be enabled on this session + * @type {boolean} default true + */ + causalConsistency?: boolean; + /** + * The default TransactionOptions to use for transactions started on this session. + */ + defaultTransactionOptions?: TransactionOptions; +} + +/** + * Configuration options for a transaction. + * http://mongodb.github.io/node-mongodb-native/3.1/api/global.html#TransactionOptions + */ +export interface TransactionOptions { + readConcern?: ReadConcern; + writeConcern?: WriteConcern; + readPreference?: any; } export interface MongoClientCommonOption { @@ -191,7 +315,7 @@ export interface DbCreateOptions extends CommonOptions { // ES6 compatible promise constructor promiseLibrary?: Object; /** https://docs.mongodb.com/manual/reference/read-concern/#read-concern */ - readConcern?: { level?: Object }; + readConcern?: ReadConcern; // Sets a cap on how many operations the driver will buffer up before giving up on getting a // working connection, default is -1 which is unlimited. bufferMaxEntries?: number; @@ -333,14 +457,7 @@ export class Db extends EventEmitter { stats(options: { scale?: number }, callback: MongoCallback): void; } -export interface CommonOptions { - /** The write concern. */ - w?: string | number; - /** The write concern timeout. */ - wtimeout?: number; - /** Specify a journal write concern. */ - j?: boolean; - /** Session to use for this operation */ +export interface CommonOptions extends WriteConcern { session?: ClientSession; } @@ -400,7 +517,7 @@ export interface DbCollectionOptions extends CommonOptions { readPreference?: ReadPreference | string; serializeFunctions?: boolean; strict?: boolean; - readConcern?: { level: Object }; + readConcern?: ReadConcern; } /** http://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createIndex */ @@ -490,7 +607,7 @@ export interface Collection { // The current write concern values. writeConcern: any; // The current read concern values. - readConcern: any; + readConcern: ReadConcern; // Get current index hint for collection. hint: any; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#aggregate */ @@ -520,8 +637,8 @@ export interface Collection { createIndex(fieldOrSpec: string | any, options: IndexOptions, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#createIndexes and http://docs.mongodb.org/manual/reference/command/createIndexes/ */ createIndexes(indexSpecs: Object[], callback: MongoCallback): void; - createIndexes(indexSpecs: Object[], options?: {session?: ClientSession}): Promise; - createIndexes(indexSpecs: Object[], options: {session?: ClientSession}, callback: MongoCallback): void; + createIndexes(indexSpecs: Object[], options?: { session?: ClientSession }): Promise; + createIndexes(indexSpecs: Object[], options: { session?: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteMany */ deleteMany(filter: FilterQuery, callback: MongoCallback): void; deleteMany(filter: FilterQuery, options?: CommonOptions): Promise; @@ -535,17 +652,17 @@ export interface Collection { distinct(key: string, query: Object, options?: { readPreference?: ReadPreference | string, maxTimeMS?: number, session?: ClientSession }): Promise; distinct(key: string, query: Object, options: { readPreference?: ReadPreference | string, maxTimeMS?: number, session?: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#drop */ - drop(options?: {session: ClientSession}): Promise; + drop(options?: { session: ClientSession }): Promise; drop(callback: MongoCallback): void; - drop(options: {session: ClientSession}, callback: MongoCallback): void; + drop(options: { session: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#dropIndex */ dropIndex(indexName: string, callback: MongoCallback): void; dropIndex(indexName: string, options?: CommonOptions & { maxTimeMS?: number }): Promise; dropIndex(indexName: string, options: CommonOptions & { maxTimeMS?: number }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#dropIndexes */ - dropIndexes(options?: {session?: ClientSession, maxTimeMS?: number}): Promise; + dropIndexes(options?: { session?: ClientSession, maxTimeMS?: number }): Promise; dropIndexes(callback?: MongoCallback): void; - dropIndexes(options: {session?: ClientSession, maxTimeMS?: number}, callback: MongoCallback): void; + dropIndexes(options: { session?: ClientSession, maxTimeMS?: number }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#estimatedDocumentCount */ estimatedDocumentCount(callback: MongoCallback): void; estimatedDocumentCount(query: Object, callback: MongoCallback): void; @@ -584,13 +701,13 @@ export interface Collection { group(keys: Object | Array | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: { readPreference?: ReadPreference | string }): Promise; group(keys: Object | Array | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options: { readPreference?: ReadPreference | string }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#indexes */ - indexes(options?: {session: ClientSession}): Promise; + indexes(options?: { session: ClientSession }): Promise; indexes(callback: MongoCallback): void; - indexes(options: {session?: ClientSession}, callback: MongoCallback): void; + indexes(options: { session?: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#indexExists */ indexExists(indexes: string | string[], callback: MongoCallback): void; - indexExists(indexes: string | string[], options?: {session: ClientSession}): Promise; - indexExists(indexes: string | string[], options: {session: ClientSession}, callback: MongoCallback): void; + indexExists(indexes: string | string[], options?: { session: ClientSession }): Promise; + indexExists(indexes: string | string[], options: { session: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#indexInformation */ indexInformation(callback: MongoCallback): void; indexInformation(options?: { full: boolean, session: ClientSession }): Promise; @@ -615,9 +732,9 @@ export interface Collection { insertOne(docs: Object, options?: CollectionInsertOneOptions): Promise; insertOne(docs: Object, options: CollectionInsertOneOptions, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#isCapped */ - isCapped(options?: {session: ClientSession}): Promise; + isCapped(options?: { session: ClientSession }): Promise; isCapped(callback: MongoCallback): void; - isCapped(options: {session: ClientSession}, callback: MongoCallback): void; + isCapped(options: { session: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#listIndexes */ listIndexes(options?: { batchSize?: number, readPreference?: ReadPreference | string, session?: ClientSession }): CommandCursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#mapReduce */ @@ -625,17 +742,17 @@ export interface Collection { mapReduce(map: Function | string, reduce: Function | string, options?: MapReduceOptions): Promise; mapReduce(map: Function | string, reduce: Function | string, options: MapReduceOptions, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#options */ - options(options?: {session: ClientSession}): Promise; + options(options?: { session: ClientSession }): Promise; options(callback: MongoCallback): void; - options(options: {session: ClientSession}, callback: MongoCallback): void; + options(options: { session: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#parallelCollectionScan */ parallelCollectionScan(callback: MongoCallback[]>): void; parallelCollectionScan(options?: ParallelCollectionScanOptions): Promise[]>; parallelCollectionScan(options: ParallelCollectionScanOptions, callback: MongoCallback[]>): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#reIndex */ - reIndex(options?: {session: ClientSession}): Promise; + reIndex(options?: { session: ClientSession }): Promise; reIndex(callback: MongoCallback): void; - reIndex(options: {session: ClientSession}, callback: MongoCallback): void; + reIndex(options: { session: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#remove */ /** @deprecated Use use deleteOne, deleteMany or bulkWrite */ remove(selector: Object, callback: MongoCallback): void; @@ -678,7 +795,7 @@ export interface Collection { updateOne(filter: FilterQuery, update: Object, options?: ReplaceOneOptions): Promise; updateOne(filter: FilterQuery, update: Object, options: ReplaceOneOptions, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#watch */ - watch(pipeline?: Object[], options?: ChangeStreamOptions & { session?: ClientSession }): ChangeStream; + watch(pipeline?: Object[], options?: ChangeStreamOptions & { startAtClusterTime?: Timestamp, session?: ClientSession }): ChangeStream; } export type FilterQuery = { @@ -718,7 +835,7 @@ export type FilterQuery = { $bitsAnySet?: Object; [key: string]: any; }; -} | { [key:string]: any }; +} | { [key: string]: any }; // Documentation: http://docs.mongodb.org/manual/reference/command/collStats/ export interface CollStats { @@ -1157,7 +1274,7 @@ export interface FindOneOptions { export interface InsertWriteOpResult { insertedCount: number; ops: Array; - insertedIds: {[key: number]: ObjectID}; + insertedIds: { [key: number]: ObjectID }; connection: any; result: { ok: number, n: number } } @@ -1505,11 +1622,18 @@ export class GridFSBucketWriteStream extends Writable { /** https://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucketWriteStream.html */ export interface GridFSBucketWriteStreamOptions { + /** Custom file id for the GridFS file. */ id?: GridFSBucketWriteStreamId, + /** The chunk size to use, in bytes */ chunkSizeBytes?: number, + /** The write concern */ w?: number, + /** The write concern timeout */ wtimeout?: number, + /** The journal write concern */ j?: number + /** Default false; If true, disables adding an md5 field to file data */ + disableMD5?: boolean } /** http://mongodb.github.io/node-mongodb-native/3.1/api/ChangeStream.html */ @@ -1565,29 +1689,29 @@ export interface LoggerState { export class Logger { constructor(className: string, options?: LoggerOptions) // Log a message at the debug level - debug(message: string, state: LoggerState):void + debug(message: string, state: LoggerState): void // Log a message at the warn level - warn(message: string, state: LoggerState):void + warn(message: string, state: LoggerState): void // Log a message at the info level - info(message: string, state: LoggerState):void + info(message: string, state: LoggerState): void // Log a message at the error level - error(message: string, state: LoggerState):void + error(message: string, state: LoggerState): void // Is the logger set at info level - isInfo():boolean + isInfo(): boolean // Is the logger set at error level - isError():boolean + isError(): boolean // Is the logger set at error level - isWarn():boolean + isWarn(): boolean // Is the logger set at debug level - isDebug():boolean + isDebug(): boolean // Resets the logger to default settings, error and no filtered classes - static reset():void + static reset(): void // Get the current logger function - static currentLogger():log + static currentLogger(): log //Set the current logger function - static setCurrentLogger(log: log):void + static setCurrentLogger(log: log): void // Set what classes to log. - static filter(type: string, values: string[]):void + static filter(type: string, values: string[]): void // Set the current log level - static setLevel(level: string):void + static setLevel(level: string): void } diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index e1f8a767fa..9151346ea5 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -175,5 +175,113 @@ let testFunc = async () => { testClient = await mongodb.connect(connectionString); }; -mongodb.connect(connectionString, (err: mongodb.MongoError, client: mongodb.MongoClient) => {}); -mongodb.connect(connectionString, options, (err: mongodb.MongoError, client: mongodb.MongoClient) => {}); +mongodb.connect(connectionString, (err: mongodb.MongoError, client: mongodb.MongoClient) => { }); +mongodb.connect(connectionString, options, (err: mongodb.MongoError, client: mongodb.MongoClient) => { }); + +// https://docs.mongodb.com/manual/core/transactions/ + +async function commitWithRetry(session: mongodb.ClientSession) { + try { + await session.commitTransaction(); + console.log('Transaction committed.'); + } catch (error) { + if ( + error.errorLabels && + error.errorLabels.indexOf('UnknownTransactionCommitResult') < 0 + ) { + console.log('UnknownTransactionCommitResult, retrying commit operation ...'); + await commitWithRetry(session); + } else { + console.log('Error during commit ...'); + throw error; + } + } +} + +async function runTransactionWithRetry( + txnFunc: (client: mongodb.MongoClient, session: mongodb.ClientSession) => Promise, + client: mongodb.MongoClient, + session: mongodb.ClientSession) { + try { + await txnFunc(client, session); + } catch (error) { + console.log('Transaction aborted. Caught exception during transaction.'); + + // If transient error, retry the whole transaction + if (error.errorLabels && error.errorLabels.indexOf('TransientTransactionError') < 0) { + console.log('TransientTransactionError, retrying transaction ...'); + await runTransactionWithRetry(txnFunc, client, session); + } else { + throw error; + } + } +} + +async function updateEmployeeInfo(client: mongodb.MongoClient, session: mongodb.ClientSession) { + session.startTransaction({ + readConcern: { level: 'snapshot' }, + writeConcern: { w: 'majority' } + }); + + const employeesCollection = client.db('hr').collection('employees'); + const eventsCollection = client.db('reporting').collection('events'); + + await employeesCollection.updateOne( + { employee: 3 }, + { $set: { status: 'Inactive' } }, + { session } + ); + await eventsCollection.insertOne( + { + employee: 3, + status: { new: 'Inactive', old: 'Active' } + }, + { session } + ); + + try { + await commitWithRetry(session); + } catch (error) { + await session.abortTransaction(); + throw error; + } +} + +async function transfer(client: mongodb.MongoClient, from: any, to: any, amount: number) { + const db = client.db(); + const session = client.startSession(); + session.startTransaction(); + try { + const opts = { session, returnOriginal: false }; + const A = await db.collection('Account'). + findOneAndUpdate({ name: from }, { $inc: { balance: -amount } }, opts). + then(res => res.value); + if (A.balance < 0) { + // If A would have negative balance, fail and abort the transaction + // `session.abortTransaction()` will undo the above `findOneAndUpdate()` + throw new Error('Insufficient funds: ' + (A.balance + amount)); + } + + const B = await db.collection('Account'). + findOneAndUpdate({ name: to }, { $inc: { balance: amount } }, opts). + then(res => res.value); + + await session.commitTransaction(); + session.endSession(); + return { from: A, to: B }; + } catch (error) { + // If an error occurred, abort the whole transaction and + // undo any changes that might have happened + await session.abortTransaction(); + session.endSession(); + throw error; // Rethrow so calling function sees error + } + } + +mongodb.connect(connectionString).then((client) => { + client.startSession(); + client.withSession(session => + runTransactionWithRetry(updateEmployeeInfo, client, session) + ); +}); + diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index b3a5d7e682..70a4247d07 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.9 +// Type definitions for Mongoose 5.2.13 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -11,6 +11,7 @@ // ondratra // alfirin // Idan Dardikman +// Dominik Heigl // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -62,9 +63,9 @@ declare module "mongoose" { * Some mongoose classes have the same name as the native JS classes * Keep references to native classes using a "Native" prefix */ - class NativeBuffer extends global.Buffer {} - class NativeDate extends global.Date {} - class NativeError extends global.Error {} + class NativeBuffer extends global.Buffer { } + class NativeDate extends global.Date { } + class NativeError extends global.Error { } /* * section index.js @@ -72,7 +73,7 @@ declare module "mongoose" { */ export var DocumentProvider: any; // recursive constructor - export var Mongoose: new(...args: any[]) => typeof mongoose; + export var Mongoose: new (...args: any[]) => typeof mongoose; type Mongoose = typeof mongoose; export var SchemaTypes: typeof Schema.Types; @@ -158,6 +159,8 @@ declare module "mongoose" { /** Sets mongoose options */ export function set(key: string, value: any): void; + export function startSession(options?: mongodb.SessionOptions, cb?: (err: any, session: mongodb.ClientSession) => void): Promise; + class CastError extends Error { /** * The Mongoose CastError constructor @@ -210,16 +213,16 @@ declare module "mongoose" { open(connection_string: string, database?: string, port?: number, options?: ConnectionOpenOptions, callback?: (err: any) => void): any; - /** - * Opens the connection to MongoDB. - * @param mongodb://uri or the host to which you are connecting - * @param database database name - * @param port database port - * @param options Mongoose forces the db option forceServerObjectId false and cannot be overridden. - * Mongoose defaults the server auto_reconnect options to true which can be overridden. - * See the node-mongodb-native driver instance for options that it understands. - * Options passed take precedence over options included in connection strings. - */ + /** + * Opens the connection to MongoDB. + * @param mongodb://uri or the host to which you are connecting + * @param database database name + * @param port database port + * @param options Mongoose forces the db option forceServerObjectId false and cannot be overridden. + * Mongoose defaults the server auto_reconnect options to true which can be overridden. + * See the node-mongodb-native driver instance for options that it understands. + * Options passed take precedence over options included in connection strings. + */ openUri(connection_string: string, database?: string, port?: number, options?: ConnectionOpenOptions, callback?: (err: any) => void): any; @@ -346,7 +349,7 @@ declare module "mongoose" { /** Specify a journal write concern (default: false). */ journal?: boolean; /** The write concern */ - w?: number|string; + w?: number | string; /** The write concern timeout. */ wTimeoutMS?: number; /** The ReadPreference mode as listed here: http://mongodb.github.io/node-mongodb-native/2.1/api/ReadPreference.html */ @@ -425,7 +428,9 @@ declare module "mongoose" { interface ConnectionOptions extends ConnectionOpenOptions, - ConnectionOpenSetOptions {} + ConnectionOpenSetOptions { } + + interface ClientSession extends mongodb.ClientSession { } /* * section drivers/node-mongodb-native/collection.js @@ -460,6 +465,8 @@ declare module "mongoose" { */ useDb(name: string): Connection; + startSession(options?: mongodb.SessionOptions, cb?: (err: any, session: mongodb.ClientSession) => void): Promise; + /** Expose the possible connection states. */ static STATES: any; } @@ -870,7 +877,7 @@ declare module "mongoose" { /** defaults to true */ validateBeforeSave?: boolean; /** defaults to "__v" */ - versionKey?: string|boolean; + versionKey?: string | boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be @@ -945,9 +952,9 @@ declare module "mongoose" { * to the front of this SchemaType's validators array using unshift(). */ required?: SchemaTypeOpts.RequiredFn | - boolean | [boolean, string] | - string | [string, string] | - any; + boolean | [boolean, string] | + string | [string, string] | + any; /** * Sets default select() behavior for this path. @@ -975,11 +982,11 @@ declare module "mongoose" { * and must return Boolean. Returning false means validation failed. */ validate?: RegExp | [RegExp, string] | - SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | - SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.AsyncValidateOpts | - SchemaTypeOpts.AsyncPromiseValidationFn | SchemaTypeOpts.AsyncPromiseValidationOpts | - (SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.AsyncValidateOpts | - SchemaTypeOpts.AsyncPromiseValidationFn | SchemaTypeOpts.AsyncPromiseValidationOpts)[]; + SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | + SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.AsyncValidateOpts | + SchemaTypeOpts.AsyncPromiseValidationFn | SchemaTypeOpts.AsyncPromiseValidationOpts | + (SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.AsyncValidateOpts | + SchemaTypeOpts.AsyncPromiseValidationFn | SchemaTypeOpts.AsyncPromiseValidationOpts)[]; /** Declares an unique index. */ unique?: boolean | any; @@ -1006,16 +1013,16 @@ declare module "mongoose" { * Sets a minimum date validator. */ min?: number | [number, string] | - Date | [Date, string] | - any; + Date | [Date, string] | + any; /** * Date, Number only - Sets a maximum number validator. * Sets a maximum date validator. */ max?: number | [number, string] | - Date | [Date, string] | - any; + Date | [Date, string] | + any; /** * Date only - Declares a TTL index (rounded to the nearest second) @@ -1483,9 +1490,9 @@ declare module "mongoose" { // var objectId: mongoose.Types.ObjectId should reference mongodb.ObjectID not // the ObjectIdConstructor, so we add the interface below - interface ObjectId extends mongodb.ObjectID {} + interface ObjectId extends mongodb.ObjectID { } - class Decimal128 extends mongodb.Decimal128 {} + class Decimal128 extends mongodb.Decimal128 { } /* * section types/embedded.js @@ -1531,7 +1538,7 @@ declare module "mongoose" { * So we save this type as the second type parameter in DocumentQuery. Since people have * been using Query, we set it as an alias of DocumentQuery. */ - class Query extends DocumentQuery {} + class Query extends DocumentQuery { } class DocumentQuery extends mquery { /** * Specifies a javascript function or expression to pass to MongoDBs query system. @@ -1922,6 +1929,13 @@ declare module "mongoose" { /** Sets query conditions to the provided JSON object. */ setQuery(conditions: any): this; + /** + * Sets the [MongoDB session](https://docs.mongodb.com/manual/reference/server-sessions/) + * associated with this query. Sessions are how you mark a query as part of a + * [transaction](/docs/transactions.html). + */ + session(session: mongodb.ClientSession | null): this; + /** * Specifies a $size query condition. * When called with one argument, the most recent path passed to where() is used. @@ -1972,14 +1986,14 @@ declare module "mongoose" { /** Executes this query and returns a promise */ then(resolve?: (res: T) => void | TRes | PromiseLike, - reject?: (err: any) => void | TRes | PromiseLike): Promise; + reject?: (err: any) => void | TRes | PromiseLike): Promise; /** * Converts this query to a customized, reusable query * constructor with all arguments and options retained. */ - toConstructor(): new(...args: any[]) => Query; - toConstructor(): new(...args: any[]) => DocumentQuery; + toConstructor(): new (...args: any[]) => Query; + toConstructor(): new (...args: any[]) => DocumentQuery; /** * Declare and/or execute this query as an update() operation. @@ -2007,7 +2021,7 @@ declare module "mongoose" { // https://github.com/aheckmann/mquery // mquery currently does not have a type definition please // replace it if one is ever created - class mquery {} + class mquery { } interface QueryFindOneAndRemoveOptions { /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ @@ -2446,6 +2460,7 @@ declare module "mongoose" { */ sample(size: number): this; + session(session: mongodb.ClientSession | null): this; /** * Appends a new $skip operator to this aggregate pipeline. * @param num number of records to skip before next stage @@ -2462,8 +2477,8 @@ declare module "mongoose" { sort(arg: string | any): this; /** Provides promise for aggregate. */ - then(resolve?: (val: T) => void | TRes | PromiseLike, - reject?: (err: any) => void | TRes | PromiseLike): Promise; + then(resolve?: (val: T) => void | TRes | PromiseLike, + reject?: (err: any) => void | TRes | PromiseLike): Promise; /** * Appends new custom $unwind operator(s) to this aggregate pipeline. @@ -2600,7 +2615,7 @@ declare module "mongoose" { * This function does not trigger any middleware. In particular, it does not trigger aggregate middleware. * @param options See https://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#watch */ - watch(options?: mongodb.ChangeStreamOptions & {session?: any}): mongodb.ChangeStream; + watch(options?: mongodb.ChangeStreamOptions & { session?: ClientSession }): mongodb.ChangeStream; /** * Translate any aliases fields/conditions so the final query or document object is pure @@ -2744,6 +2759,24 @@ declare module "mongoose" { /** sets the document fields to return */ select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + + /** + * Issue a mongodb findOneAndDelete command by a document's _id field. + * findByIdAndDelete(id, ...) is equivalent to findByIdAndDelete({ _id: id }, ...). + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * Executes immediately if callback is passed, else a Query object is returned. + * @param id value of _id to query by + */ + findByIdAndDelete(): DocumentQuery; + findByIdAndDelete(id: any | number | string, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findByIdAndDelete(id: any | number | string, options: { + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** sets the document fields to return */ + select?: any; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** * Issues a mongodb findAndModify update command by a document's _id field. findByIdAndUpdate(id, ...) @@ -2847,9 +2880,9 @@ declare module "mongoose" { * with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`. */ insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; - insertMany(docs: any[], options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, docs: T[]) => void): Promise; + insertMany(docs: any[], options?: { ordered?: boolean, rawResult?: boolean } & ModelOptions, callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(doc: any, options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; + insertMany(doc: any, options?: { ordered?: boolean, rawResult?: boolean } & ModelOptions, callback?: (error: any, doc: T) => void): Promise; /** * Performs any async initialization of this model against MongoDB. @@ -2993,7 +3026,12 @@ declare module "mongoose" { schema: Schema; } - interface ModelFindByIdAndUpdateOptions { + /** https://mongoosejs.com/docs/api.html#query_Query-setOptions */ + interface ModelOptions { + session?: ClientSession | null; + } + + interface ModelFindByIdAndUpdateOptions extends ModelOptions { /** true to return the modified document rather than the original. defaults to false */ new?: boolean; /** creates the object if it doesn't exist. defaults to false. */ @@ -3045,7 +3083,7 @@ declare module "mongoose" { populate?: ModelPopulateOptions | ModelPopulateOptions[]; } - interface ModelUpdateOptions { + interface ModelUpdateOptions extends ModelOptions { /** safe mode (defaults to value set in schema (true)) */ safe?: boolean; /** whether to create the doc if it doesn't match (false) */ diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 83f6f226b5..dea144c279 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1900,3 +1900,64 @@ MyModel.createIndexes((err: any): void => {}).then(() => {}); mongoose.connection.createCollection('foo').then(() => {}); mongoose.connection.createCollection('foo', {wtimeout: 5}).then(() => {}); mongoose.connection.createCollection('foo', {wtimeout: 5}, (err: Error, coll): void => {coll.collectionName}).then(() => {}); + +const db = mongoose.connection; +const User = mongoose.model('User', new mongoose.Schema({ name: String })); + +let session: mongoose.ClientSession; +mongoose.connection.createCollection('users'). + then(() => db.startSession()). + then(_session => { + session = _session; + session.startTransaction(); + User.findOne({ name: 'foo' }).session(session); + session.commitTransaction(); + return User.create({ name: 'foo' }); + }); + +const Event = db.model('Event', new mongoose.Schema({ createdAt: Date }), 'Event'); + +db.createCollection('users'). + then(() => db.startSession()). + then(_session => { + session = _session; + return User.create({ name: 'foo' }); + }). + then(() => { + session.startTransaction(); + return User.findOne({ name: 'foo' }).session(session).exec(); + }). + then(() => { + session.commitTransaction(); + return User.findOne({ name: 'bar' }).exec(); + }). + catch(() => { + session.abortTransaction(); + }); + db.createCollection('Event'). + then(() => db.startSession()). + then(_session => { + session = _session; + session.startTransaction(); + return Event.insertMany([ + { createdAt: new Date('2018-06-01') }, + { createdAt: new Date('2018-06-02') }, + { createdAt: new Date('2017-06-01') }, + { createdAt: new Date('2017-05-31') } + ], { session: session }); + }). + then(() => Event.aggregate([ + { + $group: { + _id: { + month: { $month: '$createdAt' }, + year: { $year: '$createdAt' } + }, + count: { $sum: 1 } + } + }, + { $sort: { count: -1, '_id.year': -1, '_id.month': -1 } } + ]).session(session).exec()). + then((res: any) => { + session.commitTransaction(); + }); \ No newline at end of file diff --git a/types/native-toast/index.d.ts b/types/native-toast/index.d.ts new file mode 100644 index 0000000000..1b9e532255 --- /dev/null +++ b/types/native-toast/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for native-toast 2.0 +// Project: https://github.com/egoist/native-toast +// Definitions by: Michael Nahkies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const toast: { + (options: ToastOptions): Toast, + success: (options: ToastOptions) => Toast, + warning: (options: ToastOptions) => Toast, + info: (options: ToastOptions) => Toast, + error: (options: ToastOptions) => Toast, +}; + +export default toast; + +export interface ToastOptions { + message?: string; + position?: "center" | "west" | "east" | "south" | "south-west" | "south-east" | "north" | "north-west" | "north-east"; + timeout?: number; + el?: HTMLElement; + rounded?: boolean; + type?: "success" | "warning" | "info" | "error"; + debug?: boolean; + edge?: boolean; + icon?: boolean; + closeOnClick?: boolean; + elements?: HTMLElement[]; +} + +export interface Toast { + show(): void; + hide(): void; + destroy(): void; +} diff --git a/types/native-toast/native-toast-tests.ts b/types/native-toast/native-toast-tests.ts new file mode 100644 index 0000000000..73d6890549 --- /dev/null +++ b/types/native-toast/native-toast-tests.ts @@ -0,0 +1,20 @@ +import toast, { Toast, ToastOptions } from "native-toast"; + +let t: Toast; + +t = toast({ + message: "Team created", + position: "north-east", + timeout: 5000, + type: "success", +}); + +t.hide(); +t.show(); + +const o: ToastOptions = { + message: "test", + position: "west" +}; + +toast.success(o); diff --git a/types/native-toast/tsconfig.json b/types/native-toast/tsconfig.json new file mode 100644 index 0000000000..d36ee00fd9 --- /dev/null +++ b/types/native-toast/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "native-toast-tests.ts" + ] +} diff --git a/types/native-toast/tslint.json b/types/native-toast/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/native-toast/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/next/document.d.ts b/types/next/document.d.ts index 0b21fb53c8..e6ba38b6c9 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -57,6 +57,6 @@ export interface NextScriptProps { export class Head extends React.Component {} export class Main extends React.Component {} export class NextScript extends React.Component {} -export default class extends React.Component { +export default class Document extends React.Component { static getInitialProps(ctx: NextDocumentContext): Promise | DocumentProps; } diff --git a/types/node-resque/index.d.ts b/types/node-resque/index.d.ts index 208c2d29a3..4b09807ee5 100644 --- a/types/node-resque/index.d.ts +++ b/types/node-resque/index.d.ts @@ -5,8 +5,6 @@ /// -import { EventEmitter } from 'events'; - export interface ConnectionOptions { pkg?: string; host?: string; @@ -17,7 +15,7 @@ export interface ConnectionOptions { options?: any; } -export class Connection extends EventEmitter { +export class Connection extends NodeJS.EventEmitter { constructor(options: ConnectionOptions); connect(): Promise; @@ -38,7 +36,7 @@ export interface QueueOptions { connection?: ConnectionOptions; } -export class Queue extends EventEmitter { +export class Queue extends NodeJS.EventEmitter { constructor(options: QueueOptions, jobs?: JobsHash); connect(): Promise; @@ -60,7 +58,7 @@ export interface WorkerOptions { export type WorkerEvent = 'start' | 'end' | 'cleaning_worker' | 'poll' | 'ping' | 'job' | 'reEnqueue' | 'success' | 'failure' | 'error' | 'pause'; -export class Worker extends EventEmitter { +export class Worker extends NodeJS.EventEmitter { constructor(options: WorkerOptions, jobs?: JobsHash); connect(): Promise; @@ -100,7 +98,7 @@ export interface SchedulerOptions { export type SchedulerEvent = 'start' | 'end' | 'poll' | 'master' | 'cleanStuckWorker' | 'error' | 'workingTimestamp' | 'transferredJob'; -export class Scheduler extends EventEmitter { +export class Scheduler extends NodeJS.EventEmitter { constructor(options: SchedulerOptions, jobs?: JobsHash); connect(): Promise; diff --git a/types/nodemailer/lib/mailer/index.d.ts b/types/nodemailer/lib/mailer/index.d.ts index 00cf40839c..ece591e30e 100644 --- a/types/nodemailer/lib/mailer/index.d.ts +++ b/types/nodemailer/lib/mailer/index.d.ts @@ -47,9 +47,9 @@ declare namespace Mail { /** optional content type for the attachment, if not set will be derived from the filename property */ contentType?: string; /** optional transfer encoding for the attachment, if not set it will be derived from the contentType property. Example values: quoted-printable, base64. If it is unset then base64 encoding is used for the attachment. If it is set to false then previous default applies (base64 for most, 7bit for text). */ - contentTransferEncoding?: string; + contentTransferEncoding?: '7bit' | 'base64' | 'quoted-printable' | false; /** optional content disposition type for the attachment, defaults to ‘attachment’ */ - contentDisposition?: string; + contentDisposition?: 'attachment' | 'inline'; /** is an object of additional headers */ headers?: Headers; /** an optional value that overrides entire node content in the mime message. If used then all other options set for this node are ignored. */ diff --git a/types/nodemailer/lib/smtp-connection.d.ts b/types/nodemailer/lib/smtp-connection.d.ts index fefce90819..61cc227583 100644 --- a/types/nodemailer/lib/smtp-connection.d.ts +++ b/types/nodemailer/lib/smtp-connection.d.ts @@ -173,17 +173,17 @@ declare class SMTPConnection extends EventEmitter { constructor(options?: SMTPConnection.Options); /** Creates a connection to a SMTP server and sets up connection listener */ - connect(callback: () => void): void; + connect(callback: (err?: SMTPConnection.SMTPError) => void): void; /** Sends QUIT */ quit(): void; /** Closes the connection to the server */ close(): void; /** Authenticate user */ - login(auth: SMTPConnection.AuthenticationCredentials | SMTPConnection.AuthenticationOAuth2 | SMTPConnection.Credentials, callback: (err: SMTPConnection.SMTPError | null) => void): void; + login(auth: SMTPConnection.AuthenticationCredentials | SMTPConnection.AuthenticationOAuth2 | SMTPConnection.Credentials, callback: (err?: SMTPConnection.SMTPError) => void): void; /** Sends a message */ send(envelope: SMTPConnection.Envelope, message: string | Buffer | Readable, callback: (err: SMTPConnection.SMTPError | null, info: SMTPConnection.SentMessageInfo) => void): void; /** Resets connection state */ - reset(callback: (err: Error | null) => void): void; + reset(callback: (err?: SMTPConnection.SMTPError) => void): void; addListener(event: 'connect' | 'end', listener: () => void): this; addListener(event: 'error', listener: (err: SMTPConnection.SMTPError) => void): this; diff --git a/types/nodemailer/nodemailer-tests.ts b/types/nodemailer/nodemailer-tests.ts index 140b351c6b..18661a8ff6 100644 --- a/types/nodemailer/nodemailer-tests.ts +++ b/types/nodemailer/nodemailer-tests.ts @@ -123,7 +123,7 @@ function message_attachments_test() { attachments: [ { // utf-8 string as an attachment filename: 'text1.txt', - content: 'hello world!' + content: 'hello world!', }, { // binary buffer as an attachment filename: 'text2.txt', @@ -138,12 +138,15 @@ function message_attachments_test() { }, { // stream as an attachment filename: 'text4.txt', - content: fs.createReadStream('file.txt') + content: fs.createReadStream('file.txt'), + contentTransferEncoding: 'quoted-printable' }, { // define custom content type for the attachment filename: 'text.bin', content: 'hello world!', - contentType: 'text/plain' + contentType: 'text/plain', + contentTransferEncoding: '7bit', + contentDisposition: 'attachment' }, { // use URL as an attachment filename: 'license.txt', @@ -152,10 +155,13 @@ function message_attachments_test() { { // encoded string as an attachment filename: 'text1.txt', content: 'aGVsbG8gd29ybGQh', - encoding: 'base64' + encoding: 'base64', + contentTransferEncoding: 'base64' }, { // data uri as an attachment - path: 'data:text/plain;base64,aGVsbG8gd29ybGQ=' + path: 'data:text/plain;base64,aGVsbG8gd29ybGQ=', + contentDisposition: 'inline', + contentTransferEncoding: false }, { // use pregenerated MIME node @@ -1053,7 +1059,8 @@ function dkim_specific_header_key_test() { function smtp_connection_test() { const connection = new SMTPConnection(); - connection.connect(() => { + connection.connect((err) => { + if (err) throw err; connection.login({ user: 'user', pass: 'pass' }, (err) => { if (err) throw err; connection.send({ from: 'a@example.com', to: 'b@example.net' }, 'message', (err, info) => { diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index c5759c3f1f..d0ff5828bd 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -16865,11 +16865,11 @@ declare namespace OfficeExtension { */ interface LoadOption { /** - * A comma-delimited string, or array of strings, that specifies the properties/relationships to load. + * A comma-delimited string, or array of strings, that specifies the properties to load. */ select?: string | string[]; /** - * A comma-delimited string, or array of strings, that specifies the relationships to load. + * A comma-delimited string, or array of strings, that specifies the navigation properties to load. */ expand?: string | string[]; /** @@ -16936,7 +16936,7 @@ 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 + * @param option A comma-delimited string, or array of strings, that specifies the properties to load, or an * {@link OfficeExtension.LoadOption} object. */ load(object: ClientObject, option?: string | string[] | LoadOption): void; @@ -17892,9 +17892,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Application` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Application` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Application` - 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; }): Excel.Application` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Application` - 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. * @@ -18048,9 +18048,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Workbook` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Workbook` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Workbook` - 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; }): Excel.Workbook` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Workbook` - 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. * @@ -18112,9 +18112,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.WorkbookProtection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.WorkbookProtection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.WorkbookProtection` - 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; }): Excel.WorkbookProtection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.WorkbookProtection` - 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. * @@ -18133,6 +18133,9 @@ declare namespace Excel { * An Excel worksheet is a grid of cells. It can contain data, tables, charts, etc. * * [Api set: ExcelApi 1.1] + * + * @remarks + * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-worksheets | how-to guide on working with worksheets} has detailed walkthroughs and code samples. */ class Worksheet extends OfficeExtension.ClientObject { /** @@ -18378,9 +18381,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Worksheet` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Worksheet` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Worksheet` - 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; }): Excel.Worksheet` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Worksheet` - 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. * @@ -18507,9 +18510,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.WorksheetCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.WorksheetCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.WorksheetCollection` - 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; }): Excel.WorksheetCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.WorksheetCollection` - 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. * @@ -18603,9 +18606,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.WorksheetProtection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.WorksheetProtection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.WorksheetProtection` - 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; }): Excel.WorksheetProtection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.WorksheetProtection` - 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. * @@ -18790,6 +18793,9 @@ declare namespace Excel { * Range represents a set of one or more contiguous cells such as a cell, a row, a column, block of cells, etc. * * [Api set: ExcelApi 1.1] + * + * @remarks + * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-ranges | how-to guide on working with ranges} has detailed walkthroughs, images, and code samples. */ class Range extends OfficeExtension.ClientObject { /** @@ -19289,9 +19295,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Range` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Range` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.Range` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -19483,9 +19489,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeView` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeView` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeView` - 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; }): Excel.RangeView` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeView` - 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. * @@ -19531,9 +19537,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeViewCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeViewCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeViewCollection` - 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; }): Excel.RangeViewCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeViewCollection` - 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. * @@ -19595,9 +19601,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.SettingCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.SettingCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.SettingCollection` - 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; }): Excel.SettingCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.SettingCollection` - 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. * @@ -19669,9 +19675,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Setting` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Setting` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Setting` - 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; }): Excel.Setting` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Setting` - 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. * @@ -19750,9 +19756,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.NamedItemCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.NamedItemCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.NamedItemCollection` - 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; }): Excel.NamedItemCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.NamedItemCollection` - 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. * @@ -19882,9 +19888,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.NamedItem` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.NamedItem` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.NamedItem` - 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; }): Excel.NamedItem` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.NamedItem` - 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. * @@ -19926,9 +19932,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.NamedItemArrayValues` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.NamedItemArrayValues` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.NamedItemArrayValues` - 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; }): Excel.NamedItemArrayValues` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.NamedItemArrayValues` - 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. * @@ -19998,9 +20004,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Binding` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Binding` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Binding` - 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; }): Excel.Binding` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Binding` - 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. * @@ -20157,9 +20163,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.BindingCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.BindingCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.BindingCollection` - 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; }): Excel.BindingCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.BindingCollection` - 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. * @@ -20237,9 +20243,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TableCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TableCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.TableCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -20264,6 +20270,9 @@ declare namespace Excel { * Represents an Excel table. * * [Api set: ExcelApi 1.1] + * + * @remarks + * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables | how-to guide on working with tables} has detailed walkthroughs, images, and code samples. */ class Table extends OfficeExtension.ClientObject { /** @@ -20441,9 +20450,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Table` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Table` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.Table` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -20543,9 +20552,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TableColumnCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TableColumnCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.TableColumnCollection` - 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; }): Excel.TableColumnCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.TableColumnCollection` - 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. * @@ -20654,9 +20663,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TableColumn` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TableColumn` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.TableColumn` - 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; }): Excel.TableColumn` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.TableColumn` - 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. * @@ -20734,9 +20743,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TableRowCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TableRowCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.TableRowCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -20808,9 +20817,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TableRow` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TableRow` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.TableRow` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -20958,9 +20967,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeFormat` - 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; }): Excel.RangeFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeFormat` - 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. * @@ -21016,9 +21025,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.FormatProtection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.FormatProtection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.FormatProtection` - 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; }): Excel.FormatProtection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.FormatProtection` - 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. * @@ -21074,9 +21083,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeFill` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeFill` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeFill` - 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; }): Excel.RangeFill` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeFill` - 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. * @@ -21146,9 +21155,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeBorder` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeBorder` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeBorder` - 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; }): Excel.RangeBorder` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeBorder` - 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. * @@ -21212,9 +21221,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeBorderCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeBorderCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeBorderCollection` - 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; }): Excel.RangeBorderCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeBorderCollection` - 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. * @@ -21295,9 +21304,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.RangeFont` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.RangeFont` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.RangeFont` - 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; }): Excel.RangeFont` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeFont` - 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. * @@ -21391,9 +21400,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartCollection` - 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; }): Excel.ChartCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartCollection` - 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. * @@ -21409,6 +21418,9 @@ declare namespace Excel { * Represents a chart object in a workbook. * * [Api set: ExcelApi 1.1] + * + * @remarks + * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-charts | how-to guide on working with charts} has detailed walkthroughs, images, and code samples. */ class Chart extends OfficeExtension.ClientObject { /** @@ -21598,9 +21610,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Chart` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Chart` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Chart` - 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; }): Excel.Chart` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Chart` - 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. * @@ -21663,9 +21675,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartAreaFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartAreaFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartAreaFormat` - 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; }): Excel.ChartAreaFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAreaFormat` - 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. * @@ -21728,9 +21740,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartSeriesCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartSeriesCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartSeriesCollection` - 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; }): Excel.ChartSeriesCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartSeriesCollection` - 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. * @@ -21917,9 +21929,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartSeries` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartSeries` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartSeries` - 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; }): Excel.ChartSeries` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartSeries` - 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. * @@ -21975,9 +21987,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartSeriesFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartSeriesFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartSeriesFormat` - 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; }): Excel.ChartSeriesFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartSeriesFormat` - 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. * @@ -22030,9 +22042,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartPointsCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartPointsCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartPointsCollection` - 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; }): Excel.ChartPointsCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartPointsCollection` - 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. * @@ -22127,9 +22139,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartPoint` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartPoint` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartPoint` - 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; }): Excel.ChartPoint` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartPoint` - 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. * @@ -22185,9 +22197,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartPointFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartPointFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartPointFormat` - 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; }): Excel.ChartPointFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartPointFormat` - 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. * @@ -22270,9 +22282,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartAxes` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartAxes` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartAxes` - 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; }): Excel.ChartAxes` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAxes` - 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. * @@ -22542,9 +22554,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartAxis` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartAxis` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartAxis` - 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; }): Excel.ChartAxis` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAxis` - 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. * @@ -22600,9 +22612,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartAxisFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartAxisFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartAxisFormat` - 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; }): Excel.ChartAxisFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAxisFormat` - 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. * @@ -22665,9 +22677,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartAxisTitle` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartAxisTitle` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartAxisTitle` - 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; }): Excel.ChartAxisTitle` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAxisTitle` - 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. * @@ -22716,9 +22728,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartAxisTitleFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartAxisTitleFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartAxisTitleFormat` - 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; }): Excel.ChartAxisTitleFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAxisTitleFormat` - 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. * @@ -22823,9 +22835,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartDataLabels` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartDataLabels` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartDataLabels` - 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; }): Excel.ChartDataLabels` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartDataLabels` - 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. * @@ -22923,9 +22935,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartDataLabel` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartDataLabel` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartDataLabel` - 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; }): Excel.ChartDataLabel` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartDataLabel` - 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. * @@ -22981,9 +22993,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartDataLabelFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartDataLabelFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartDataLabelFormat` - 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; }): Excel.ChartDataLabelFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartDataLabelFormat` - 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. * @@ -23039,9 +23051,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartGridlines` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartGridlines` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartGridlines` - 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; }): Excel.ChartGridlines` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartGridlines` - 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. * @@ -23090,9 +23102,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartGridlinesFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartGridlinesFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartGridlinesFormat` - 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; }): Excel.ChartGridlinesFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartGridlinesFormat` - 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. * @@ -23204,9 +23216,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartLegend` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartLegend` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartLegend` - 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; }): Excel.ChartLegend` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartLegend` - 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. * @@ -23255,9 +23267,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartLegendEntry` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartLegendEntry` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartLegendEntry` - 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; }): Excel.ChartLegendEntry` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartLegendEntry` - 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. * @@ -23303,9 +23315,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartLegendEntryCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartLegendEntryCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartLegendEntryCollection` - 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; }): Excel.ChartLegendEntryCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartLegendEntryCollection` - 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. * @@ -23358,9 +23370,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartLegendFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartLegendFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartLegendFormat` - 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; }): Excel.ChartLegendFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartLegendFormat` - 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. * @@ -23512,9 +23524,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartTitle` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartTitle` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartTitle` - 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; }): Excel.ChartTitle` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartTitle` - 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. * @@ -23563,9 +23575,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartFormatString` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartFormatString` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartFormatString` - 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; }): Excel.ChartFormatString` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartFormatString` - 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. * @@ -23628,9 +23640,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartTitleFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartTitleFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartTitleFormat` - 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; }): Excel.ChartTitleFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartTitleFormat` - 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. * @@ -23724,9 +23736,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartBorder` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartBorder` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartBorder` - 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; }): Excel.ChartBorder` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartBorder` - 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. * @@ -23796,9 +23808,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartLineFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartLineFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartLineFormat` - 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; }): Excel.ChartLineFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartLineFormat` - 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. * @@ -23882,9 +23894,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartFont` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartFont` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartFont` - 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; }): Excel.ChartFont` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartFont` - 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. * @@ -23975,9 +23987,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartTrendline` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartTrendline` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartTrendline` - 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; }): Excel.ChartTrendline` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartTrendline` - 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. * @@ -24041,9 +24053,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartTrendlineCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartTrendlineCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartTrendlineCollection` - 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; }): Excel.ChartTrendlineCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartTrendlineCollection` - 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. * @@ -24089,9 +24101,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ChartTrendlineFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ChartTrendlineFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ChartTrendlineFormat` - 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; }): Excel.ChartTrendlineFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartTrendlineFormat` - 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. * @@ -24213,9 +24225,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TableSort` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TableSort` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.TableSort` - 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; }): Excel.TableSort` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.TableSort` - 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. * @@ -24428,9 +24440,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Filter` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Filter` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Filter` - 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; }): Excel.Filter` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Filter` - 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. * @@ -24615,9 +24627,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CustomXmlPartScopedCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CustomXmlPartScopedCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.CustomXmlPartScopedCollection` - 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; }): Excel.CustomXmlPartScopedCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.CustomXmlPartScopedCollection` - 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. * @@ -24688,9 +24700,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CustomXmlPartCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CustomXmlPartCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.CustomXmlPartCollection` - 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; }): Excel.CustomXmlPartCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.CustomXmlPartCollection` - 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. * @@ -24752,9 +24764,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CustomXmlPart` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CustomXmlPart` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.CustomXmlPart` - 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; }): Excel.CustomXmlPart` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.CustomXmlPart` - 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. * @@ -24816,9 +24828,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.PivotTableCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.PivotTableCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.PivotTableCollection` - 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; }): Excel.PivotTableCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.PivotTableCollection` - 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. * @@ -24834,6 +24846,9 @@ declare namespace Excel { * Represents an Excel PivotTable. * * [Api set: ExcelApi 1.3] + * + * @remarks + * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-pivottables | how-to guide on working with PivotTables} has detailed walkthroughs, images, and code samples. */ class PivotTable extends OfficeExtension.ClientObject { /** @@ -24885,9 +24900,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.PivotTable` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.PivotTable` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.PivotTable` - 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; }): Excel.PivotTable` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.PivotTable` - 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. * @@ -25013,9 +25028,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.DocumentProperties` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.DocumentProperties` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.DocumentProperties` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -25085,9 +25100,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CustomProperty` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CustomProperty` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.CustomProperty` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -25159,9 +25174,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CustomPropertyCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CustomPropertyCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.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; }): Excel.CustomPropertyCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.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. * @@ -25239,9 +25254,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalFormatCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalFormatCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalFormatCollection` - 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; }): Excel.ConditionalFormatCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalFormatCollection` - 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. * @@ -25452,9 +25467,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalFormat` - 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; }): Excel.ConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalFormat` - 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. * @@ -25553,9 +25568,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.DataBarConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.DataBarConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.DataBarConditionalFormat` - 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; }): Excel.DataBarConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.DataBarConditionalFormat` - 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. * @@ -25619,9 +25634,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalDataBarPositiveFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalDataBarPositiveFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalDataBarPositiveFormat` - 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; }): Excel.ConditionalDataBarPositiveFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalDataBarPositiveFormat` - 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. * @@ -25692,9 +25707,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalDataBarNegativeFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalDataBarNegativeFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalDataBarNegativeFormat` - 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; }): Excel.ConditionalDataBarNegativeFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalDataBarNegativeFormat` - 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. * @@ -25772,9 +25787,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CustomConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CustomConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.CustomConditionalFormat` - 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; }): Excel.CustomConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.CustomConditionalFormat` - 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. * @@ -25837,9 +25852,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalFormatRule` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalFormatRule` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalFormatRule` - 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; }): Excel.ConditionalFormatRule` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalFormatRule` - 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. * @@ -25909,9 +25924,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.IconSetConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.IconSetConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.IconSetConditionalFormat` - 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; }): Excel.IconSetConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.IconSetConditionalFormat` - 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. * @@ -26003,9 +26018,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ColorScaleConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ColorScaleConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ColorScaleConditionalFormat` - 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; }): Excel.ColorScaleConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ColorScaleConditionalFormat` - 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. * @@ -26119,9 +26134,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TopBottomConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TopBottomConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.TopBottomConditionalFormat` - 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; }): Excel.TopBottomConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.TopBottomConditionalFormat` - 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. * @@ -26199,9 +26214,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.PresetCriteriaConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.PresetCriteriaConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.PresetCriteriaConditionalFormat` - 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; }): Excel.PresetCriteriaConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.PresetCriteriaConditionalFormat` - 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. * @@ -26272,9 +26287,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.TextConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.TextConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.TextConditionalFormat` - 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; }): Excel.TextConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.TextConditionalFormat` - 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. * @@ -26352,9 +26367,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.CellValueConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.CellValueConditionalFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.CellValueConditionalFormat` - 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; }): Excel.CellValueConditionalFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.CellValueConditionalFormat` - 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. * @@ -26453,9 +26468,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalRangeFormat` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalRangeFormat` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalRangeFormat` - 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; }): Excel.ConditionalRangeFormat` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalRangeFormat` - 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. * @@ -26539,9 +26554,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalRangeFont` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalRangeFont` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalRangeFont` - 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; }): Excel.ConditionalRangeFont` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalRangeFont` - 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. * @@ -26597,9 +26612,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalRangeFill` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalRangeFill` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalRangeFill` - 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; }): Excel.ConditionalRangeFill` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalRangeFill` - 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. * @@ -26662,9 +26677,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalRangeBorder` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalRangeBorder` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalRangeBorder` - 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; }): Excel.ConditionalRangeBorder` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalRangeBorder` - 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. * @@ -26756,9 +26771,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.ConditionalRangeBorderCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.ConditionalRangeBorderCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.ConditionalRangeBorderCollection` - 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; }): Excel.ConditionalRangeBorderCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ConditionalRangeBorderCollection` - 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. * @@ -26951,9 +26966,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.Style` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.Style` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.Style` - 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; }): Excel.Style` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Style` - 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. * @@ -27001,9 +27016,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Excel.StyleCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Excel.StyleCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Excel.StyleCollection` - 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; }): Excel.StyleCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.StyleCollection` - 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. * @@ -28328,9 +28343,9 @@ declare namespace Excel { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): FunctionResult` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): FunctionResult` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): FunctionResult` - 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; }): FunctionResult` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): FunctionResult` - 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. * @@ -42644,9 +42659,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Body` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Body` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43155,9 +43170,9 @@ declare namespace Word { * * 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?: string | string[]): Word.ContentControl` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.ContentControl` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43263,9 +43278,9 @@ declare namespace Word { * * 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?: string | string[]): Word.ContentControlCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.ContentControlCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43340,9 +43355,9 @@ declare namespace Word { * * 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?: string | string[]): Word.CustomProperty` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.CustomProperty` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43422,9 +43437,9 @@ declare namespace Word { * * 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?: string | string[]): Word.CustomPropertyCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.CustomPropertyCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43520,9 +43535,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Document` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Document` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43621,9 +43636,9 @@ declare namespace Word { * * 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?: string | string[]): Word.DocumentCreated` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.DocumentCreated` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43799,9 +43814,9 @@ declare namespace Word { * * 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?: string | string[]): Word.DocumentProperties` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.DocumentProperties` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -43928,9 +43943,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Font` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Font` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -44282,9 +44297,9 @@ declare namespace Word { * * 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?: string | string[]): Word.InlinePicture` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.InlinePicture` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -44336,9 +44351,9 @@ declare namespace Word { * * 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?: string | string[]): Word.InlinePictureCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.InlinePictureCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -44524,9 +44539,9 @@ declare namespace Word { * * 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?: string | string[]): Word.List` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.List` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -44605,9 +44620,9 @@ declare namespace Word { * * 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?: string | string[]): Word.ListCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.ListCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -44702,9 +44717,9 @@ declare namespace Word { * * 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?: string | string[]): Word.ListItem` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.ListItem` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -45290,9 +45305,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Paragraph` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Paragraph` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -45358,9 +45373,9 @@ declare namespace Word { * * 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?: string | string[]): Word.ParagraphCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.ParagraphCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -45880,9 +45895,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Range` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Range` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -45934,9 +45949,9 @@ declare namespace Word { * * 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?: string | string[]): Word.RangeCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.RangeCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -46033,9 +46048,9 @@ declare namespace Word { * * 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?: string | string[]): Word.SearchOptions` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.SearchOptions` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -46138,9 +46153,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Section` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Section` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -46192,9 +46207,9 @@ declare namespace Word { * * 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?: string | string[]): Word.SectionCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.SectionCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -46745,9 +46760,9 @@ declare namespace Word { * * 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?: string | string[]): Word.Table` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.Table` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -46799,9 +46814,9 @@ declare namespace Word { * * 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?: string | string[]): Word.TableCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.TableCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -47067,9 +47082,9 @@ declare namespace Word { * * 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?: string | string[]): Word.TableRow` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.TableRow` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -47121,9 +47136,9 @@ declare namespace Word { * * 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?: string | string[]): Word.TableRowCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.TableRowCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -47375,9 +47390,9 @@ declare namespace Word { * * 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?: string | string[]): Word.TableCell` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.TableCell` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -47429,9 +47444,9 @@ declare namespace Word { * * 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?: string | string[]): Word.TableCellCollection` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.TableCellCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -47499,9 +47514,9 @@ declare namespace Word { * * 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?: string | string[]): Word.TableBorder` - Where option is a comma-delimited string or an array of strings that specify the properties 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; }): Word.TableBorder` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties 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. * @@ -53399,9 +53414,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Application` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Application` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.Application` - 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; }): OneNote.Application` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.Application` - 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. * @@ -53457,9 +53472,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysis` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysis` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysis` - 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; }): OneNote.InkAnalysis` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysis` - 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. * @@ -53530,9 +53545,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysisParagraph` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysisParagraph` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysisParagraph` - 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; }): OneNote.InkAnalysisParagraph` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysisParagraph` - 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. * @@ -53595,9 +53610,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysisParagraphCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysisParagraphCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysisParagraphCollection` - 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; }): OneNote.InkAnalysisParagraphCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysisParagraphCollection` - 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. * @@ -53665,9 +53680,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysisLine` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysisLine` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysisLine` - 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; }): OneNote.InkAnalysisLine` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysisLine` - 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. * @@ -53730,9 +53745,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysisLineCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysisLineCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysisLineCollection` - 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; }): OneNote.InkAnalysisLineCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysisLineCollection` - 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. * @@ -53814,9 +53829,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysisWord` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysisWord` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysisWord` - 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; }): OneNote.InkAnalysisWord` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysisWord` - 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. * @@ -53879,9 +53894,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkAnalysisWordCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkAnalysisWordCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkAnalysisWordCollection` - 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; }): OneNote.InkAnalysisWordCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkAnalysisWordCollection` - 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. * @@ -53935,9 +53950,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.FloatingInk` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.FloatingInk` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.FloatingInk` - 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; }): OneNote.FloatingInk` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.FloatingInk` - 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. * @@ -53987,9 +54002,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkStroke` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkStroke` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkStroke` - 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; }): OneNote.InkStroke` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkStroke` - 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. * @@ -54052,9 +54067,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkStrokeCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkStrokeCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkStrokeCollection` - 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; }): OneNote.InkStrokeCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkStrokeCollection` - 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. * @@ -54115,9 +54130,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkWord` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkWord` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkWord` - 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; }): OneNote.InkWord` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkWord` - 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. * @@ -54180,9 +54195,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.InkWordCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.InkWordCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.InkWordCollection` - 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; }): OneNote.InkWordCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.InkWordCollection` - 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. * @@ -54289,9 +54304,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Notebook` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Notebook` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.Notebook` - 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; }): OneNote.Notebook` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.Notebook` - 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. * @@ -54363,9 +54378,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.NotebookCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.NotebookCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.NotebookCollection` - 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; }): OneNote.NotebookCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.NotebookCollection` - 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. * @@ -54479,9 +54494,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.SectionGroup` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.SectionGroup` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.SectionGroup` - 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; }): OneNote.SectionGroup` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.SectionGroup` - 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. * @@ -54553,9 +54568,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.SectionGroupCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.SectionGroupCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.SectionGroupCollection` - 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; }): OneNote.SectionGroupCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.SectionGroupCollection` - 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. * @@ -54712,9 +54727,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Section` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Section` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.Section` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -54786,9 +54801,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.SectionCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.SectionCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.SectionCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -54975,9 +54990,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Page` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Page` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.Page` - 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; }): OneNote.Page` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.Page` - 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. * @@ -55049,9 +55064,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.PageCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.PageCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.PageCollection` - 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; }): OneNote.PageCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.PageCollection` - 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. * @@ -55161,9 +55176,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.PageContent` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.PageContent` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.PageContent` - 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; }): OneNote.PageContent` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.PageContent` - 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. * @@ -55226,9 +55241,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.PageContentCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.PageContentCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.PageContentCollection` - 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; }): OneNote.PageContentCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.PageContentCollection` - 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. * @@ -55329,9 +55344,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Outline` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Outline` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.Outline` - 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; }): OneNote.Outline` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.Outline` - 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. * @@ -55587,9 +55602,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Paragraph` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Paragraph` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.Paragraph` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -55652,9 +55667,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.ParagraphCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.ParagraphCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.ParagraphCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -55708,9 +55723,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.NoteTag` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.NoteTag` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.NoteTag` - 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; }): OneNote.NoteTag` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.NoteTag` - 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. * @@ -55782,9 +55797,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.RichText` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.RichText` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.RichText` - 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; }): OneNote.RichText` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.RichText` - 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. * @@ -55898,9 +55913,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Image` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Image` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.Image` - 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; }): OneNote.Image` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.Image` - 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. * @@ -56055,9 +56070,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.Table` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.Table` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.Table` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -56163,9 +56178,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.TableRow` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.TableRow` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.TableRow` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -56228,9 +56243,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.TableRowCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.TableRowCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.TableRowCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -56366,9 +56381,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.TableCell` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.TableCell` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.TableCell` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -56431,9 +56446,9 @@ declare namespace OneNote { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): OneNote.TableCellCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): OneNote.TableCellCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): OneNote.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; }): OneNote.TableCellCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): OneNote.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. * @@ -59727,9 +59742,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Application` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Application` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.Application` - 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; }): Visio.Application` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.Application` - 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. * @@ -59815,9 +59830,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Document` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Document` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.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; }): Visio.Document` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.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. * @@ -59941,9 +59956,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.DocumentView` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.DocumentView` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.DocumentView` - 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; }): Visio.DocumentView` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.DocumentView` - 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. * @@ -60055,9 +60070,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Page` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Page` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.Page` - 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; }): Visio.Page` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.Page` - 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. * @@ -60154,9 +60169,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.PageView` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.PageView` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.PageView` - 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; }): Visio.PageView` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.PageView` - 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. * @@ -60202,9 +60217,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.PageCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.PageCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.PageCollection` - 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; }): Visio.PageCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.PageCollection` - 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. * @@ -60247,9 +60262,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.ShapeCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.ShapeCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.ShapeCollection` - 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; }): Visio.ShapeCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.ShapeCollection` - 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. * @@ -60358,9 +60373,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Shape` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Shape` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.Shape` - 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; }): Visio.Shape` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.Shape` - 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. * @@ -60446,9 +60461,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.ShapeView` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.ShapeView` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.ShapeView` - 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; }): Visio.ShapeView` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.ShapeView` - 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. * @@ -60574,9 +60589,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.ShapeDataItemCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.ShapeDataItemCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.ShapeDataItemCollection` - 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; }): Visio.ShapeDataItemCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.ShapeDataItemCollection` - 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. * @@ -60629,9 +60644,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.ShapeDataItem` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.ShapeDataItem` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.ShapeDataItem` - 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; }): Visio.ShapeDataItem` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.ShapeDataItem` - 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. * @@ -60677,9 +60692,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.HyperlinkCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.HyperlinkCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.HyperlinkCollection` - 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; }): Visio.HyperlinkCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.HyperlinkCollection` - 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. * @@ -60732,9 +60747,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Hyperlink` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Hyperlink` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.Hyperlink` - 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; }): Visio.Hyperlink` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.Hyperlink` - 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. * @@ -60780,9 +60795,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.CommentCollection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.CommentCollection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.CommentCollection` - 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; }): Visio.CommentCollection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.CommentCollection` - 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. * @@ -60842,9 +60857,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Comment` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Comment` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.Comment` - 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; }): Visio.Comment` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.Comment` - 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. * @@ -60879,9 +60894,9 @@ declare namespace Visio { * * In addition to this signature, this method has the following signatures: * - * `load(option?: string | string[]): Visio.Selection` - Where option is a comma-delimited string or an array of strings that specify the properties/relationships to load. + * `load(option?: string | string[]): Visio.Selection` - Where option is a comma-delimited string or an array of strings that specify the properties to load. * - * `load(option?: { select?: string; expand?: string; }): Visio.Selection` - 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; }): Visio.Selection` - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load. * * `load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.Selection` - 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. * diff --git a/types/parity-pmd/parity-pmd-tests.ts b/types/parity-pmd/parity-pmd-tests.ts index 3645e7598c..d538b5f353 100644 --- a/types/parity-pmd/parity-pmd-tests.ts +++ b/types/parity-pmd/parity-pmd-tests.ts @@ -22,6 +22,4 @@ format({}); // Invalid sub type // $ExpectError -format({ - messageType: 1 -}); +format({ messageType: 1 }); diff --git a/types/parity-pmr/parity-pmr-tests.ts b/types/parity-pmr/parity-pmr-tests.ts index 03bcc3534d..4fbb2b31b4 100644 --- a/types/parity-pmr/parity-pmr-tests.ts +++ b/types/parity-pmr/parity-pmr-tests.ts @@ -17,9 +17,7 @@ format({}); // Invalid sub type // $ExpectError -format({ - messageType: 1 -}); +format({ messageType: 1 }); // $ExpectType PMRMessage parse(buffer); diff --git a/types/parity-poe/parity-poe-tests.ts b/types/parity-poe/parity-poe-tests.ts index c5b50d5189..fb9c267572 100644 --- a/types/parity-poe/parity-poe-tests.ts +++ b/types/parity-poe/parity-poe-tests.ts @@ -21,9 +21,7 @@ formatInbound({}); // Invalid sub type // $ExpectError -formatInbound({ - messageType: 1 -}); +formatInbound({ messageType: 1 }); /** * parseInbound tests @@ -52,9 +50,7 @@ formatOutbound({}); // Invalid sub type // $ExpectError -formatOutbound({ - messageType: 1 -}); +formatOutbound({ messageType: 1 }); /** * parseOutbound tests diff --git a/types/passport-saml/index.d.ts b/types/passport-saml/index.d.ts index d9c86a9b23..cc2faafe5c 100644 --- a/types/passport-saml/index.d.ts +++ b/types/passport-saml/index.d.ts @@ -19,11 +19,11 @@ export interface CacheProvider { remove(key: string, callback: (err: Error | null, key: string) => void | null): void; } -export type VerifiedCallback = (err: Error | null, user: {}, info: {}) => void; +export type VerifiedCallback = (err: Error | null, user: object, info: object) => void; -export type VerifyWithRequest = (req: express.Request, profile: {}, done: VerifiedCallback) => void; +export type VerifyWithRequest = (req: express.Request, profile: object, done: VerifiedCallback) => void; -export type VerifyWithoutRequest = (profile: {}, done: VerifiedCallback) => void; +export type VerifyWithoutRequest = (profile: object, done: VerifiedCallback) => void; export class Strategy extends passport.Strategy { constructor(config: SamlConfig, verify: VerifyWithRequest | VerifyWithoutRequest); @@ -41,13 +41,13 @@ export interface SamlConfig { entryPoint: string; issuer: string; privateCert?: string; - cert?: {}; + cert?: string; decryptionPvk?: string; signatureAlgorithm?: 'sha1' | 'sha256' | 'sha512'; // Additional SAML behaviors - additionalParams?: {}; - additionalAuthorizeParams?: {}; + additionalParams?: any; + additionalAuthorizeParams?: any; identifierFormat?: string; acceptedClockSkewMs?: number; attributeConsumingServiceIndex?: string; @@ -68,12 +68,12 @@ export interface SamlConfig { // Logout logoutUrl?: string; - additionalLogoutParams?: {}; + additionalLogoutParams?: any; logoutCallbackUrl?: string; } export interface AuthenticateOptions extends passport.AuthenticateOptions { - additionalParams?: {}; + additionalParams?: object; } export interface AuthorizeOptions extends AuthenticateOptions { diff --git a/types/payment/index.d.ts b/types/payment/index.d.ts index fbd3f5ba65..7a1426e7d6 100644 --- a/types/payment/index.d.ts +++ b/types/payment/index.d.ts @@ -11,6 +11,10 @@ interface Fns { * * Validates length */ validateCardNumber(cardNumber: string): boolean; + /** + * Formats a card number + */ + formatCardNumber(cardNumber: string): string; /** * Validates a card expiry: * * Validates numbers diff --git a/types/plur/index.d.ts b/types/plur/index.d.ts new file mode 100644 index 0000000000..3f94e66fef --- /dev/null +++ b/types/plur/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for plur 3.0 +// Project: https://github.com/sindresorhus/plur#readme +// Definitions by: Kyle Roach +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function plur( + word: string, + plural: string | number, + count?: number +): string; + +export = plur; diff --git a/types/plur/plur-tests.ts b/types/plur/plur-tests.ts new file mode 100644 index 0000000000..be509830df --- /dev/null +++ b/types/plur/plur-tests.ts @@ -0,0 +1,5 @@ +import plur = require('plur'); + +const word = 'chicken'; + +plur(word, 2); diff --git a/types/plur/tsconfig.json b/types/plur/tsconfig.json new file mode 100644 index 0000000000..cb98c338e3 --- /dev/null +++ b/types/plur/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "plur-tests.ts"] +} diff --git a/types/plur/tslint.json b/types/plur/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/plur/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index e66ee97dfa..eab93cf2eb 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -592,6 +592,14 @@ export interface ScreenshotOptions { encoding?: "base64" | "binary"; } +export interface BinaryScreenShotOptions extends ScreenshotOptions { + encoding?: "binary"; +} + +export interface Base64ScreenShotOptions extends ScreenshotOptions { + encoding: "base64"; +} + /** Options for `addStyleTag` */ export interface StyleTagOptions { /** Url of the tag. */ @@ -747,7 +755,9 @@ export interface ElementHandle extends JSHandle, Ev * If the element is detached from DOM, the method throws an error. * @param options Same options as in page.screenshot. */ - screenshot(options?: ScreenshotOptions): Promise; + screenshot(options?: Base64ScreenShotOptions): Promise; + screenshot(options?: BinaryScreenShotOptions): Promise; + screenshot(options?: ScreenshotOptions): Promise; /** * This method scrolls element into view if needed, and then uses touchscreen.tap to tap in the center of the element. * If the element is detached from DOM, the method throws an error. @@ -1346,6 +1356,8 @@ export interface Page extends EventEmitter, FrameBase { * Captures a screenshot of the page. * @param options The screenshot options. */ + screenshot(options?: Base64ScreenShotOptions): Promise; + screenshot(options?: BinaryScreenShotOptions): Promise; screenshot(options?: ScreenshotOptions): Promise; /** diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index 1e3d35737b..fb0c283d4b 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -403,8 +403,12 @@ puppeteer.launch().then(async browser => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto("https://example.com"); - const base64string: string = (await page.screenshot({ encoding: "base64" })) as string; - const buffer: Buffer = (await page.screenshot({ encoding: "binary" })) as Buffer; + const base64string: string = await page.screenshot({ encoding: "base64" }); + const buffer: Buffer = await page.screenshot({ encoding: "binary" }); + const screenshotOptions: puppeteer.ScreenshotOptions = { + fullPage: true, + }; + const stringOrBuffer: string | Buffer = await page.screenshot(screenshotOptions); browser.close(); })(); diff --git a/types/q/index.d.ts b/types/q/index.d.ts index bdcd3c68ca..7926965cf8 100644 --- a/types/q/index.d.ts +++ b/types/q/index.d.ts @@ -61,7 +61,7 @@ declare namespace Q { * The then method from the Promises/A+ specification, with an additional progress handler. */ then(onFulfill?: ((value: T) => IWhenable) | null, onReject?: ((error: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; - + then(onFulfill?: ((value: T) => IWhenable) | null, onReject?: ((error: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; /** * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so * without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, diff --git a/types/q/q-tests.ts b/types/q/q-tests.ts index 226d86ced8..62160614e4 100644 --- a/types/q/q-tests.ts +++ b/types/q/q-tests.ts @@ -245,6 +245,9 @@ Q.try(() => { }) .catch((error) => console.error("Couldn't sync to the cloud", error)); +// ensure Q.Promise is compatible with PromiseLike +const p7: PromiseLike = Q.Promise((resolve) => resolve()); + // thenReject, returning a Promise of the same type as the Promise it is called on function thenRejectSameType(arg: any): Q.Promise { if (!arg) { diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index a33fde5f5f..59f3b7860b 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -346,8 +346,8 @@ declare namespace R { * `chain` maps a function over a list and concatenates the results. * This implementation is compatible with the Fantasy-land Chain spec */ - chain(fn: (n: T) => U[], list: ReadonlyArray): U[]; - chain(fn: (n: T) => U[]): (list: ReadonlyArray) => U[]; + chain(fn: (n: T) => ReadonlyArray, list: ReadonlyArray): U[]; + chain(fn: (n: T) => ReadonlyArray): (list: ReadonlyArray) => U[]; /** * Restricts a number to be within a range. @@ -745,7 +745,7 @@ declare namespace R { * Returns a new list by pulling every item out of it (and all its sub-arrays) and putting * them in a new array, depth-first. */ - flatten(x: ReadonlyArray | ReadonlyArray): T[]; + flatten(x: ReadonlyArray | ReadonlyArray | ReadonlyArray>): T[]; /** * Returns a new function much like the supplied one, except that the first two arguments' diff --git a/types/react-global-configuration/index.d.ts b/types/react-global-configuration/index.d.ts index 30ce772f10..d2a4157720 100644 --- a/types/react-global-configuration/index.d.ts +++ b/types/react-global-configuration/index.d.ts @@ -9,11 +9,7 @@ export interface Options { assign: boolean; } -declare namespace ReactGlobalConfiguration { - function set(newConfiguration: any, newOptions?: Options): void; - function get(key?: string): any; - function get(key: string, fallbackValue: Value): Value; - function serialize(): string; -} - -export default ReactGlobalConfiguration; +export function set(newConfiguration: any, newOptions?: Options): void; +export function get(key?: string): any; +export function get(key: string, fallbackValue: Value): Value; +export function serialize(): string; diff --git a/types/react-global-configuration/tsconfig.json b/types/react-global-configuration/tsconfig.json index d55b74d8f8..c75d7c7cce 100644 --- a/types/react-global-configuration/tsconfig.json +++ b/types/react-global-configuration/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true }, "files": [ "index.d.ts", diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index c1dff99d71..899859a69d 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -8,6 +8,7 @@ // Brian Houser , // Krister Kari // Martin Raedlinger +// Kanitkorn Sujautra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -94,6 +95,7 @@ declare namespace ReactIntl { interface Props extends PropsBase { value: DateSource; + children?: (formattedDate: string) => React.ReactNode; } } @@ -104,6 +106,7 @@ declare namespace ReactIntl { interface Props extends PropsBase { value: DateSource; + children?: (formattedTime: string) => React.ReactNode; } } class FormattedTime extends React.Component { } @@ -125,6 +128,7 @@ declare namespace ReactIntl { interface Props extends PropsBase { value: DateSource; + children?: (formattedRelative: string) => React.ReactNode; } } @@ -154,6 +158,7 @@ declare namespace ReactIntl { interface Props extends PropsBase { value: number; + children?: (formattedNumber: string) => React.ReactNode; } } class FormattedNumber extends React.Component { } @@ -177,6 +182,7 @@ declare namespace ReactIntl { interface Props extends PropsBase { value: number; + children?: (formattedPlural: React.ReactNode) => React.ReactNode; } } class FormattedPlural extends React.Component { } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index b69c59bd74..d3d30757a1 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -96,6 +96,17 @@ class SomeComponent extends React.Component + + {formattedRelative => formattedRelative.toUpperCase()} + + + + {formattedNum => ( + {formattedNum} + )} + + - - - - - - - - - - {(formattedNum: string) => ( - {formattedNum} + + {formattedPlural => ( + {formattedPlural} )} - + + + + + + + + {formattedDate => formattedDate.toUpperCase()} + + + + + + + + {formattedTime => formattedTime.toUpperCase()} + ; } } diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index ad8abe57fd..98f6c92c3f 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -31,6 +31,7 @@ /// /// +import * as PropTypes from 'prop-types'; import * as React from 'react'; type Constructor = new(...args: any[]) => T; @@ -8936,7 +8937,7 @@ export const PixelRatio: PixelRatioStatic; export interface ComponentInterface

{ name?: string; displayName?: string; - propTypes: P; + propTypes: PropTypes.ValidationMap

; } /** @@ -8958,7 +8959,7 @@ export function requireNativeComponent

( viewName: string, componentInterface?: ComponentInterface

, extraConfig?: { nativeOnly?: any } -): React.ComponentClass

; +): React.ComponentClass>>; export function findNodeHandle( componentOrHandle: null | number | React.Component | React.ComponentClass @@ -9001,10 +9002,10 @@ export namespace addons { // // Prop Types // -export const ColorPropType: React.Requireable; -export const EdgeInsetsPropType: React.Requireable; -export const PointPropType: React.Requireable; -export const ViewPropTypes: React.Requireable; +export const ColorPropType: React.Validator; +export const EdgeInsetsPropType: React.Validator; +export const PointPropType: React.Validator; +export const ViewPropTypes: React.ValidationMap; declare global { function require(name: string): any; diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 8bc6757c48..b2b66ee2da 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -20,6 +20,7 @@ import { BackAndroid, BackHandler, Button, + ColorPropType, DataSourceAssetCallback, DeviceEventEmitterStatic, Dimensions, @@ -73,6 +74,7 @@ import { KeyboardAvoidingView, Modal, TimePickerAndroid, + ViewPropTypes, } from "react-native"; declare module "react-native" { @@ -186,13 +188,20 @@ const testNativeSyntheticEvent = (e: NativeSyntheticEvent): voi e.nativeEvent; } +type ElementProps = C extends React.Component ? P : never; + class CustomView extends React.Component { render() { return Custom View; } } -class Welcome extends React.Component { +class Welcome extends React.Component & { color: string }> { + static propTypes = { + ...ViewPropTypes, + color: ColorPropType, + }; + refs: { [key: string]: any; rootView: View; @@ -218,8 +227,9 @@ class Welcome extends React.Component { } render() { + const { color, ...props } = this.props; return ( - + Welcome to React Native To get started, edit index.ios.js diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index b52c4829f5..1e6211926e 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -23,6 +23,7 @@ // Jake // Gustavo Brunoro // Denis Frezzato +// Mickael Wegerich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -457,10 +458,16 @@ export type NavigationTabAction = | NavigationNavigateAction | NavigationBackAction; +export type NavigationDrawerAction = + | NavigationOpenDrawerAction + | NavigationCloseDrawerAction + | NavigationToggleDrawerAction; + export type NavigationAction = | NavigationInitAction | NavigationStackAction - | NavigationTabAction; + | NavigationTabAction + | NavigationDrawerAction; export type NavigationRouteConfig = | NavigationComponent @@ -600,7 +607,7 @@ export interface NavigationEventsProps extends ViewProps { export const NavigationEvents: React.ComponentType; export interface NavigationScreenProp { - state: S; + state: S & { params?: P }; dispatch: NavigationDispatch; goBack: (routeKey?: string | null) => boolean; dismiss: () => boolean; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 6bf037eb4a..a9063577a6 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -336,6 +336,24 @@ function renderBasicDrawerNavigator(): JSX.Element { ); } +interface ParamsOnStateProps { + navigation: NavigationScreenProp<{}, { foobar: string }>; +} + +class ParamsOnState extends React.Component { + render() { + if (this.props.navigation.state.params) { + // $ExpectType string + this.props.navigation.state.params.foobar; + } else { + // $ExpectType undefined + this.props.navigation.state.params; + } + + return ; + } +} + interface CustomTransitionerProps { navigation: NavigationScreenProp; } diff --git a/types/react-onsenui/index.d.ts b/types/react-onsenui/index.d.ts index b65a6510e0..3124fa32f2 100644 --- a/types/react-onsenui/index.d.ts +++ b/types/react-onsenui/index.d.ts @@ -311,6 +311,8 @@ export class Input extends Component<{ disabled?: boolean, readOnly?: boolean, onChange?: (e: React.ChangeEvent) => void, + onBlur?: (e: React.FocusEvent) => void, + onFocus?: (e: React.FocusEvent) => void, value?: string, defaultValue?: string, checked?: boolean, diff --git a/types/react-onsenui/react-onsenui-tests.tsx b/types/react-onsenui/react-onsenui-tests.tsx index a7c3bca3fc..b4f4d540b3 100644 --- a/types/react-onsenui/react-onsenui-tests.tsx +++ b/types/react-onsenui/react-onsenui-tests.tsx @@ -19,6 +19,8 @@ export class App extends React.Component { } onChange(event: React.ChangeEvent) {} + onBlur(event: React.FocusEvent) {} + onFocus(event: React.FocusEvent) {} onClick(event: React.MouseEvent) {} onRadioChange(event: Event) {} onCheckboxChange(event: Event) {} @@ -41,7 +43,7 @@ export class App extends React.Component { Test page - +