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/bip32/bip32-tests.ts b/types/bip32/bip32-tests.ts new file mode 100644 index 0000000000..4256ca6366 --- /dev/null +++ b/types/bip32/bip32-tests.ts @@ -0,0 +1,9 @@ +import { fromBase58 } from 'bip32'; + +const node = fromBase58("xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi"); + +const child = node.derivePath('m/0'); + +const grandchild = child.derive(2); + +grandchild.toWIF() === 'Kxtby4wzfHeCaRXma16dBNLgUE7Ct3Xkb6sRs3aZ56Bmtf1rcNWs'; diff --git a/types/bip32/index.d.ts b/types/bip32/index.d.ts new file mode 100644 index 0000000000..99a1b8dffd --- /dev/null +++ b/types/bip32/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for bip32 1.0 +// Project: https://github.com/bitcoinjs/bip32#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +export interface NetworkType { + wif: number; // UInt8 + bip32: { + public: number; // UInt32 + private: number; // UInt32 + }; +} + +export class BIP32 { + private constructor(d: Buffer, Q: Buffer, chainCode: Buffer, network: NetworkType); + + identifier: Buffer; + fingerprint: Buffer; + privateKey: Buffer; + publicKey: Buffer; + + private depth: number; + private index: number; + private parentFingerprint: number; + private network: NetworkType; + + isNeutered(): boolean; + neutered(): BIP32; + toBase58(): string; + toWIF(): string; + derive(index: number): BIP32; + deriveHardened(index: number): BIP32; + derivePath(path: string): BIP32; + sign(hash: Buffer): Buffer; + verify(hash: Buffer, signature: Buffer): boolean; +} + +/** + * Returns a node + * @param string base58 encoded string + * @param network network type of the node + */ +export function fromBase58(string: string, network?: NetworkType): BIP32; + +/** + * Returns a hardened node + * @param privateKey node private key + * @param chainCode 256-bits entropy extension + * @param network network type of the node + */ +export function fromPrivateKey(privateKey: Buffer, chainCode: Buffer, network?: NetworkType): BIP32; + +/** + * Returns a non-hardened node + * @param publicKey node public key + * @param chainCode 256-bits entropy extension + * @param network network type of the node + */ +export function fromPublicKey(publicKey: Buffer, chainCode: Buffer, network?: NetworkType): BIP32; + +/** + * Returns a hardened node + * @param seed seed encoding node info + * @param network network type of the node + */ +export function fromSeed(seed: Buffer, network?: NetworkType): BIP32; diff --git a/types/bip32/tsconfig.json b/types/bip32/tsconfig.json new file mode 100644 index 0000000000..ca18bb2a82 --- /dev/null +++ b/types/bip32/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "bip32-tests.ts" + ] +} diff --git a/types/bip32/tslint.json b/types/bip32/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bip32/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/cookie-session/index.d.ts b/types/cookie-session/index.d.ts index a0b7a2e6b0..af48860396 100644 --- a/types/cookie-session/index.d.ts +++ b/types/cookie-session/index.d.ts @@ -15,7 +15,7 @@ declare namespace CookieSessionInterfaces { /** * The name of the cookie to set, defaults to session. */ - name: string; + name?: string; /** * The list of keys to use to sign & verify cookie values. Set cookies are always signed with keys[0], while the other keys are valid for verification, allowing for key rotation. @@ -47,6 +47,11 @@ declare namespace CookieSessionInterfaces { */ domain?: string; + /** + * a boolean or string indicating whether the cookie is a "same site" cookie (false by default). This can be set to 'strict', 'lax', or true (which maps to 'strict'). + */ + sameSite?: "strict" | "lax" | boolean; + /** * a boolean indicating whether the cookie is only to be sent over HTTPS (false by default for HTTP, true by default for HTTPS). */ 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/d3.cloud.layout/d3.cloud.layout-tests.ts b/types/d3-cloud/d3-cloud-tests.ts similarity index 100% rename from types/d3.cloud.layout/d3.cloud.layout-tests.ts rename to types/d3-cloud/d3-cloud-tests.ts diff --git a/types/d3.cloud.layout/index.d.ts b/types/d3-cloud/index.d.ts similarity index 100% rename from types/d3.cloud.layout/index.d.ts rename to types/d3-cloud/index.d.ts diff --git a/types/d3.cloud.layout/tsconfig.json b/types/d3-cloud/tsconfig.json similarity index 94% rename from types/d3.cloud.layout/tsconfig.json rename to types/d3-cloud/tsconfig.json index ffb26214cc..d5f3d151b7 100644 --- a/types/d3.cloud.layout/tsconfig.json +++ b/types/d3-cloud/tsconfig.json @@ -24,6 +24,6 @@ }, "files": [ "index.d.ts", - "d3.cloud.layout-tests.ts" + "d3-cloud-tests.ts" ] } \ No newline at end of file diff --git a/types/d3.cloud.layout/tslint.json b/types/d3-cloud/tslint.json similarity index 100% rename from types/d3.cloud.layout/tslint.json rename to types/d3-cloud/tslint.json 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 fe784dae8b..6d79e1df8b 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'; @@ -28,51 +38,25 @@ declare module 'ember' { // Get an alias to the global Array type to use in inner scope below. type GlobalArray = T[]; - /** - * 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; - }; + // TODO: TypeScript 3.0 + // type FunctionArgs any> = F extends (...args: infer ARGS) => any ? ARGS : never; + type FunctionArgs = + F extends (a: infer A) => any + ? [A] + : F extends (a: infer A, b: infer B) => any + ? [A, B] + : F extends (a: infer A, b: infer B, c: infer C) => any + ? [A, B, C] + : F extends (a: infer A, b: infer B, c: infer C, d: infer D) => any + ? [A, B, C, D] + : F extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => any + ? [A, B, C, D, E] + : never; - 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. @@ -90,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; @@ -129,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; @@ -310,6 +277,17 @@ declare module 'ember' { interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} + interface StringPrototypeExtensions { + camelize(): string; + decamelize(): string; + classify(): string; + capitalize(): string; + loc(values?: string[]): string; + dasherize(): string; + underscore(): string; + w(): string[]; + } + /** * Given a fullName return a factory manager. */ @@ -2439,7 +2417,7 @@ declare module 'ember' { function fmt(...args: string[]): string; function htmlSafe(str: string): Handlebars.SafeString; function isHTMLSafe(str: string): boolean; - function loc(...args: string[]): string; + function loc(template: string, args?: string[]): string; function underscore(str: string): string; function w(str: string): string[]; } @@ -3142,7 +3120,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. */ @@ -3286,14 +3264,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 @@ -3320,7 +3301,14 @@ declare module 'ember' { * Checks to see if the `methodName` exists on the `obj`, * and if it does, invokes it with the arguments passed. */ - function tryInvoke(obj: any, methodName: string, args?: any[]): any; + function tryInvoke( + obj: T, + methodName: FNAME, + args: FunctionArgs): T[FNAME] extends ((...args: any[]) => any) + ? ReturnType + : undefined; + function tryInvoke(obj: T, methodName: FNAME): T[FNAME] extends (() => any) ? ReturnType : undefined; + function tryInvoke(obj: object, methodName: string, args?: any[]): undefined; /** * Forces the passed object to be part of an array. If the object is already * an array, it will return the object. Otherwise, it will add the object to 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/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..015be1057b --- /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: keyof this, 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: keyof this, 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/string-ext.ts b/types/ember/test/string-ext.ts new file mode 100644 index 0000000000..e4ac77d5b4 --- /dev/null +++ b/types/ember/test/string-ext.ts @@ -0,0 +1,28 @@ +import Ember from 'ember'; + +declare global { + interface String extends Ember.StringPrototypeExtensions {} +} + +''.dasherize('foo'); // $ExpectError +''.dasherize(); // $ExpectType string + +''.camelize(); // $ExpectType string +''.camelize('blue man group'); // $ExpectError + +''.decamelize(); // $ExpectType string +''.decamelize('blue man group'); // $ExpectError + +''.underscore(); // $ExpectType string +''.underscore('blue man group'); // $ExpectError + +''.w(); // $ExpectType string[] + +''.classify(); // $ExpectType string +''.classify('blue man group'); // $ExpectError + +''.capitalize(); // $ExpectType string +''.capitalize('blue man group'); // $ExpectError + +''.loc(); // $ExpectType string +''.loc("_Hello World"); // $ExpectError diff --git a/types/ember/test/string.ts b/types/ember/test/string.ts new file mode 100644 index 0000000000..0543bd60d0 --- /dev/null +++ b/types/ember/test/string.ts @@ -0,0 +1,36 @@ +import Ember from 'ember'; + +const { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } = 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 +// TODO - fix this case upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/281 +loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string 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 9ddc2b361e..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() { @@ -99,3 +99,78 @@ function testDefineProperty() { return `${this.firstName} ${this.lastName}`; })); } + +function testTryInvoke() { + class Foo { + hello() { return ['world']; } + add(x: number, y: string) { return x + parseInt(y, 10); } + apples(n: number) { return `${n} apples`; } + } + // zero-argument function + Ember.tryInvoke(new Foo(), 'hello'); // $ExpectType string[] + // one-argument function + Ember.tryInvoke(new Foo(), 'apples', [4]); // $ExpectType string + // multi-argument function with different types (reversed types negative test case below) + Ember.tryInvoke(new Foo(), 'add', [4, '3']); // $ExpectType number + + // Cases that should return undefined + // No args provided + Ember.tryInvoke(new Foo(), 'apples'); // $ExpectType undefined + // Function does not exist + Ember.tryInvoke(new Foo(), 'doesNotExist'); // $ExpectType undefined + // Empty args provided + Ember.tryInvoke(new Foo(), 'apples', []); // $ExpectType undefined + // Wrong args provided + Ember.tryInvoke(new Foo(), 'apples', ['']); // $ExpectType undefined + // Wrong arg types + Ember.tryInvoke(new Foo(), 'add', [4, 3]); // $ExpectType undefined + // 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 29f20bcc44..6619ea0e47 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -20,40 +20,49 @@ }, "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/application.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/engine.ts", - "test/engine-instance.ts", + "test/application.ts", + "test/array-ext.ts", + "test/array-proxy.ts", + "test/array.ts", + "test/component.ts", + "test/computed.ts", + "test/controller.ts", + "test/core-object.ts", + "test/create-negative.ts", + "test/create.ts", + "test/detect-instance.ts", + "test/detect.ts", "test/ember-tests.ts", + "test/engine-instance.ts", + "test/engine.ts", "test/error.ts", "test/event.ts", "test/extend.ts", - "test/create.ts", - "test/create-negative.ts", - "test/create.ts", + "test/function-ext.ts", + "test/helper.ts", + "test/inject.ts", + "test/mixin.ts", "test/object.ts", "test/observable.ts", - "test/mixin.ts", "test/reopen.ts", - "test/detect.ts", - "test/detect-instance.ts", - "test/array.ts", - "test/array-ext.ts", - "test/array-proxy.ts", - "test/helper.ts", - "test/computed.ts", - "test/component.ts", - "test/function-ext.ts", - "test/inject.ts", - "test/utils.ts", - "test/transition.ts", + "test/route.ts", "test/router.ts", "test/run.ts", + "test/string.ts", + "test/string-ext.ts", "test/test.ts", - "test/controller.ts", - "test/route.ts", + "test/transition.ts", + "test/utils.ts", "test/view-utils.ts" ] } 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__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__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__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__utils/ember__utils-tests.ts b/types/ember__utils/ember__utils-tests.ts new file mode 100644 index 0000000000..8b270f1bec --- /dev/null +++ b/types/ember__utils/ember__utils-tests.ts @@ -0,0 +1,171 @@ +import { + compare, + isBlank, + isEmpty, + isEqual, + isNone, + isPresent, + tryInvoke, + typeOf +} from '@ember/utils'; +import EmberObject from '@ember/object'; + +(function() { + /** isNone */ + const maybeUndefined: string | undefined = 'not actually undefined'; + if (isNone(maybeUndefined)) { + return; + } + const anotherString = maybeUndefined + 'another string'; + // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/256 + // isNone(); // $ExpectType boolean + isNone(null); // $ExpectType boolean + isNone(undefined); // $ExpectType boolean + isNone(''); // $ExpectType boolean + isNone([]); // $ExpectType boolean + isNone(function() {}); // $ExpectType boolean +})(); + +(function() { + /** tryInvoke */ + let d = new Date('03/15/2013'); + + // TODO fix enhance in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/257 + // tryInvoke(d, 'getTime'); // $ExpectType number + // tryInvoke(d, 'setFullYear', [2014]); // $ExpectType number + // tryInvoke(d, 'noSuchMethod', [2014]); // $ExpectType undefined + tryInvoke(d, 'getTime'); + tryInvoke(d, 'setFullYear', [2014]); + tryInvoke(d, 'noSuchMethod', [2014]); +})(); + +(function() { + /** isPresent */ + // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/258 + // isPresent(); // $ExpectType boolean + isPresent(null); // $ExpectType boolean + isPresent(undefined); // $ExpectType boolean + isPresent(''); // $ExpectType boolean + isPresent(' '); // $ExpectType boolean + isPresent('\n\t'); // $ExpectType boolean + isPresent([]); // $ExpectType boolean + isPresent({ length: 0 }); // $ExpectType boolean + isPresent(false); // $ExpectType boolean + isPresent(true); // $ExpectType boolean + isPresent('string'); // $ExpectType boolean + isPresent(0); // $ExpectType boolean + isPresent(function() {}); // $ExpectType boolean + isPresent({}); // $ExpectType boolean + isPresent(false); // $ExpectType boolean + isPresent('\n\t Hello'); // $ExpectType boolean + isPresent([1, 2, 3]); // $ExpectType boolean +})(); + +(function() { + /** typeOf */ + // TODO: more specific return type in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/259 + // typeOf(null); // $ExpectType 'null' + // typeOf(undefined); // $ExpectType 'undefined' + // typeOf('michael'); // $ExpectType 'string' + // // tslint:disable-next-line:no-construct + // typeOf(new String('michael')); // $ExpectType 'string' + // typeOf(101); // $ExpectType 'number' + // // tslint:disable-next-line:no-construct + // typeOf(new Number(101)); // $ExpectType 'number' + // typeOf(true); // $ExpectType 'boolean' + // // tslint:disable-next-line:no-construct + // typeOf(new Boolean(true)); // $ExpectType 'boolean' + // typeOf(() => 4); // $ExpectType 'function' + // typeOf([1, 2, 90]); // $ExpectType 'array' + // typeOf(/abc/); // $ExpectType 'regexp' + // typeOf(new Date()); // $ExpectType 'date' + // typeOf(FileList); // $ExpectType 'filelist' + // // typeOf(EmberObject.extend()); // $ExpectType 'class' + // // typeOf(EmberObject.create()); // $ExpectType 'instance' + // typeOf(new Error('teamocil')); // $ExpectType 'error' + + // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/260 + // typeOf(); + typeOf(null); + typeOf(undefined); + typeOf('michael'); + // tslint:disable-next-line:no-construct + typeOf(new String('michael')); + typeOf(101); + // tslint:disable-next-line:no-construct + typeOf(new Number(101)); + typeOf(true); + // tslint:disable-next-line:no-construct + typeOf(new Boolean(true)); + typeOf(() => 4); + typeOf([1, 2, 90]); + typeOf(/abc/); + typeOf(new Date()); + typeOf(FileList); + typeOf(new Error('teamocil')); +})(); + +(function() { + /** isEqual */ + isEqual('foo', 'bar'); // $ExpectType boolean + isEqual(14, 37); // $ExpectType boolean + isEqual(14, '1'); // $ExpectType boolean + isEqual(() => 4, () => 37); // $ExpectType boolean + isEqual(14); // $ExpectError + isEqual(); // $ExpectError +})(); + +(function() { + /** compare */ + compare('foo', 'bar'); // $ExpectType number + compare(14, 37); // $ExpectType number + compare(class {}, class {}); // $ExpectType number + compare([], class {}); // $ExpectType number + compare([], undefined); // $ExpectType number + compare({}, () => 4); // $ExpectType number + compare(14); // $ExpectError + compare(); // $ExpectError +})(); + +(function() { + /** isBlank */ + + // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/254 + // isBlank(); // $ExpectType boolean + isBlank(null); // $ExpectType boolean + isBlank(undefined); // $ExpectType boolean + isBlank(''); // $ExpectType boolean + isBlank([]); // $ExpectType boolean + isBlank('\n\t'); // $ExpectType boolean + isBlank(' '); // $ExpectType boolean + isBlank({}); // $ExpectType boolean + isBlank('\n\t Hello'); // $ExpectType boolean + isBlank('Hello world'); // $ExpectType boolean + isBlank([1, 2, 3]); // $ExpectType boolean +})(); + +(function() { + /** isEmpty */ + + // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/255 + // isEmpty(); // $ExpectType boolean + isEmpty(null); // $ExpectType boolean + isEmpty(undefined); // $ExpectType boolean + isEmpty(''); // $ExpectType boolean + isEmpty([]); // $ExpectType boolean + isEmpty({ size: 0 }); // $ExpectType boolean + isEmpty({}); // $ExpectType boolean + isEmpty('Adam Hawkins'); // $ExpectType boolean + isEmpty([0, 1, 2]); // $ExpectType boolean + isEmpty('\n\t'); // $ExpectType boolean + isEmpty(' '); // $ExpectType boolean + 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/ember__utils/index.d.ts b/types/ember__utils/index.d.ts new file mode 100644 index 0000000000..89a9a6cd96 --- /dev/null +++ b/types/ember__utils/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for @ember/utils 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 compare: typeof Ember.compare; +export const isBlank: typeof Ember.isBlank; +export const isEmpty: typeof Ember.isEmpty; +export const isEqual: typeof Ember.isEqual; +export const isNone: typeof Ember.isNone; +export const isPresent: typeof Ember.isPresent; +export const tryInvoke: typeof Ember.tryInvoke; +export const typeOf: typeof Ember.typeOf; diff --git a/types/ember__utils/tsconfig.json b/types/ember__utils/tsconfig.json new file mode 100644 index 0000000000..559e22e847 --- /dev/null +++ b/types/ember__utils/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/utils": ["ember__utils"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ember__utils-tests.ts" + ] +} diff --git a/types/ember__utils/tslint.json b/types/ember__utils/tslint.json new file mode 100644 index 0000000000..f77f8d2ed8 --- /dev/null +++ b/types/ember__utils/tslint.json @@ -0,0 +1,30 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Heavy use of Function type in this older package. + "ban-types": false, + "jsdoc-format": false, + "no-misused-new": false, + + // these are disabled because of rfc176 module exports + "strict-export-declare-modifiers": false, + "no-single-declare-module": false, + "no-declare-current-package": false, + "no-self-import": false, + + // We use interfaces in a number of places to express things (including + // mixins in particular, but also including extending a global + // interface) which TS currently can't express correctly. + "no-empty-interface": false, + + "no-duplicate-imports": false, + "no-unnecessary-qualifier": false, + "prefer-const": false, + "no-void-expression": false, + "only-arrow-functions": false, + "no-submodule-imports": false, + + // false positives + "unified-signatures": false + } +} 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/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/google-translate-api/google-translate-api-tests.ts b/types/google-translate-api/google-translate-api-tests.ts new file mode 100644 index 0000000000..25149c2660 --- /dev/null +++ b/types/google-translate-api/google-translate-api-tests.ts @@ -0,0 +1,3 @@ +import translate = require('google-translate-api'); + +translate('hello', { from: 'en', to: 'zh-tw' }); // $ExpectType Promise diff --git a/types/google-translate-api/index.d.ts b/types/google-translate-api/index.d.ts new file mode 100644 index 0000000000..1a53eacc4d --- /dev/null +++ b/types/google-translate-api/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for google-translate-api 2.3 +// Project: https://github.com/matheuss/google-translate-api#readme +// Definitions by: maple3142 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface TranslateOption { + from?: string; + to?: string; + raw?: boolean; +} +interface TranslateResult { + text: string; + from: { + language: { + didYouMean: boolean; + iso: string; + } + text: { + autoCorrected: boolean; + value: string; + didYouMean: boolean; + } + }; + raw: string; +} +declare function translate(text: string, options?: TranslateOption): Promise; +export = translate; diff --git a/types/google-translate-api/tsconfig.json b/types/google-translate-api/tsconfig.json new file mode 100644 index 0000000000..21eb234d62 --- /dev/null +++ b/types/google-translate-api/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", "google-translate-api-tests.ts"] +} diff --git a/types/google-translate-api/tslint.json b/types/google-translate-api/tslint.json new file mode 100644 index 0000000000..381c23f5c5 --- /dev/null +++ b/types/google-translate-api/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "semicolon": true + } +} 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/gulp-sequence/gulp-sequence-tests.ts b/types/gulp-sequence/gulp-sequence-tests.ts new file mode 100644 index 0000000000..f2c10418c8 --- /dev/null +++ b/types/gulp-sequence/gulp-sequence-tests.ts @@ -0,0 +1,70 @@ +import * as seq from 'gulp-sequence'; +import * as gulp from 'gulp'; + +seq.use(gulp).use(gulp).use(gulp); + +gulp.task('x', seq('foo')); +gulp.task('x', seq('foo', ['foo', 'bar'], 'qux')); +gulp.task('x', seq( + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11', + '12', + '13', + '14', + '15', + '16', + '17', + '18', + '19', + '20', + '21', + '22', + '23', + '24', + '25' +)); + +const noop = () => {}; + +// tslint:disable-next-line:no-void-expression +let r: undefined = seq('foo', noop); +// tslint:disable-next-line:no-void-expression +r = seq('foo', ['foo', 'bar'], 'qux', noop); +// tslint:disable-next-line:no-void-expression +r = seq( + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11', + '12', + '13', + '14', + '15', + '16', + '17', + '18', + '19', + '20', + '21', + '22', + '23', + '24', + '25', + noop +); diff --git a/types/gulp-sequence/index.d.ts b/types/gulp-sequence/index.d.ts new file mode 100644 index 0000000000..aa236e3a5a --- /dev/null +++ b/types/gulp-sequence/index.d.ts @@ -0,0 +1,391 @@ +// Type definitions for gulp-sequence 1.0 +// Project: https://github.com/teambition/gulp-sequence +// Definitions by: Alorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Gulp, TaskFunction } from 'gulp'; + +declare namespace seq { + type Step = string | string[]; + + type Done = (error?: any) => void; + + function use(gulp: Gulp): typeof seq; +} + +/* +Sequence functions (apart from the one returning TaskFunction) generated using the following (requires lodash for the padding): + +const fnBase = `declare function seq(`; +const argPad = _.pad('', fnBase.length, ' '); +const maxArgs = 25; + +const outDone = []; + +for (let i = 1; i <= maxArgs; i++) { + let def = []; + for (let j = 1; j <= i; j++) { + def.push(`s${j}: seq.Step`); + } + + def.push(`done: seq.Done): void;`); + outDone.push(def.join(`,\n${argPad}`)); +} + +console.log(fnBase + outDone.join(`\n${fnBase}`)); +*/ + +declare function seq(firstTask: seq.Step, ...additionalTasks: seq.Step[]): TaskFunction; + +declare function seq(s1: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + s20: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + s20: seq.Step, + s21: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + s20: seq.Step, + s21: seq.Step, + s22: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + s20: seq.Step, + s21: seq.Step, + s22: seq.Step, + s23: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + s20: seq.Step, + s21: seq.Step, + s22: seq.Step, + s23: seq.Step, + s24: seq.Step, + done: seq.Done): void; +declare function seq(s1: seq.Step, + s2: seq.Step, + s3: seq.Step, + s4: seq.Step, + s5: seq.Step, + s6: seq.Step, + s7: seq.Step, + s8: seq.Step, + s9: seq.Step, + s10: seq.Step, + s11: seq.Step, + s12: seq.Step, + s13: seq.Step, + s14: seq.Step, + s15: seq.Step, + s16: seq.Step, + s17: seq.Step, + s18: seq.Step, + s19: seq.Step, + s20: seq.Step, + s21: seq.Step, + s22: seq.Step, + s23: seq.Step, + s24: seq.Step, + s25: seq.Step, + done: seq.Done): void; + +export = seq; diff --git a/types/gulp-sequence/tsconfig.json b/types/gulp-sequence/tsconfig.json new file mode 100644 index 0000000000..cdfaf33610 --- /dev/null +++ b/types/gulp-sequence/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-sequence-tests.ts" + ] +} diff --git a/types/gulp-sequence/tslint.json b/types/gulp-sequence/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-sequence/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hammerjs/index.d.ts b/types/hammerjs/index.d.ts index 587a3c89a0..d1bb8ffd85 100644 --- a/types/hammerjs/index.d.ts +++ b/types/hammerjs/index.d.ts @@ -263,19 +263,15 @@ interface Recognizer canEmit():boolean; canRecognizeWith( otherRecognizer:Recognizer ):boolean; - dropRecognizeWith( otherRecognizer:Recognizer ):Recognizer; - dropRecognizeWith( otherRecognizer:string ):Recognizer; - dropRequireFailure( otherRecognizer:Recognizer ):Recognizer; - dropRequireFailure( otherRecognizer:string ):Recognizer; + dropRecognizeWith( otherRecognizer:Recognizer | Recognizer[] | string):Recognizer; + dropRequireFailure( otherRecognizer:Recognizer | Recognizer[] | string):Recognizer; emit( input:HammerInput ):void; getTouchAction():any[]; hasRequireFailures():boolean; process( inputData:HammerInput ):string; recognize( inputData:HammerInput ):void; - recognizeWith( otherRecognizer:Recognizer ):Recognizer; - recognizeWith( otherRecognizer:string ):Recognizer; - requireFailure( otherRecognizer:Recognizer ):Recognizer; - requireFailure( otherRecognizer:string ):Recognizer; + recognizeWith( otherRecognizer:Recognizer | Recognizer[] | string):Recognizer; + requireFailure( otherRecognizer:Recognizer | Recognizer[] | string):Recognizer; reset():void; set( options?:RecognizerOptions ):Recognizer; tryEmit( input:HammerInput ):void; 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-plugin-set/index.d.ts b/types/jest-plugin-set/index.d.ts new file mode 100644 index 0000000000..05d96335cb --- /dev/null +++ b/types/jest-plugin-set/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for jest-plugin-set 2.9 +// Project: https://github.com/negativetwelve/jest-plugins/tree/master/packages/jest-plugin-set +// Definitions by: Jonas Heinrich +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function set(name: string, block: () => void): void; diff --git a/types/jest-plugin-set/jest-plugin-set-tests.ts b/types/jest-plugin-set/jest-plugin-set-tests.ts new file mode 100644 index 0000000000..93096eeb19 --- /dev/null +++ b/types/jest-plugin-set/jest-plugin-set-tests.ts @@ -0,0 +1 @@ +set('variableA', () => {}); diff --git a/types/jest-plugin-set/tsconfig.json b/types/jest-plugin-set/tsconfig.json new file mode 100644 index 0000000000..4d7b7d4bbf --- /dev/null +++ b/types/jest-plugin-set/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-plugin-set-tests.ts" + ] +} diff --git a/react-table-filter/tslint.json b/types/jest-plugin-set/tslint.json similarity index 100% rename from react-table-filter/tslint.json rename to types/jest-plugin-set/tslint.json 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/koa-requestid/index.d.ts b/types/koa-requestid/index.d.ts new file mode 100644 index 0000000000..2fd2feea84 --- /dev/null +++ b/types/koa-requestid/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for koa-requestid 2.0 +// Project: https://github.com/seegno/koa-requestid/ +// Definitions by: Steven McDowall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Middleware } from 'koa'; + +export = requestId; + +declare function requestId(options?: { + expose?: string; + header?: string; + query?: string; +}): Middleware; diff --git a/types/koa-requestid/koa-requestid-tests.ts b/types/koa-requestid/koa-requestid-tests.ts new file mode 100644 index 0000000000..75fc5d0749 --- /dev/null +++ b/types/koa-requestid/koa-requestid-tests.ts @@ -0,0 +1,10 @@ +import Koa = require('koa'); +import requestId = require('koa-requestid'); +const app = new Koa(); + +app.use(requestId()); +app.use(async ctx => { + ctx.body = ctx.state.id; +}); + +app.listen(3000); diff --git a/types/koa-requestid/tsconfig.json b/types/koa-requestid/tsconfig.json new file mode 100644 index 0000000000..74c7711102 --- /dev/null +++ b/types/koa-requestid/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", + "koa-requestid-tests.ts" + ] +} diff --git a/types/koa-requestid/tslint.json b/types/koa-requestid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-requestid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/megajs/index.d.ts b/types/megajs/index.d.ts index 8162d6d648..731c5e5b1e 100644 --- a/types/megajs/index.d.ts +++ b/types/megajs/index.d.ts @@ -50,7 +50,7 @@ export interface MakeDirectoryOptions { export interface FileOptions { downloadId: string; key: string; - directory: boolean; + directory?: boolean; } export interface StorageOptions { 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..3534f82f49 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 @@ -2847,9 +2862,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 +3008,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 +3065,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/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 new file mode 100644 index 0000000000..4b09807ee5 --- /dev/null +++ b/types/node-resque/index.d.ts @@ -0,0 +1,131 @@ +// Type definitions for node-resque 5.4 +// Project: http://github.com/taskrabbit/node-resque +// Definitions by: Gordey Doronin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface ConnectionOptions { + pkg?: string; + host?: string; + port?: number; + database?: number; + namespace?: string; + looping?: boolean; + options?: any; +} + +export class Connection extends NodeJS.EventEmitter { + constructor(options: ConnectionOptions); + + connect(): Promise; + end(): Promise; +} + +export interface Job { + plugins?: string[]; + pluginOptions?: { [pluginName: string]: any }; + perform: (...args: any[]) => Promise; +} + +export interface JobsHash { + [jobName: string]: Job; +} + +export interface QueueOptions { + connection?: ConnectionOptions; +} + +export class Queue extends NodeJS.EventEmitter { + constructor(options: QueueOptions, jobs?: JobsHash); + + connect(): Promise; + enqueue(queue: string, jobName: string, args: ReadonlyArray): Promise; + enqueueIn(milliseconds: number, queue: string, jobName: string, args: ReadonlyArray): Promise; + end(): Promise; + + on(event: 'error', cb: (error: Error, queue: string) => void): this; + once(event: 'error', cb: (error: Error, queue: string) => void): this; +} + +export interface WorkerOptions { + connection?: ConnectionOptions; + queues: string[]; + name?: string; + timeout?: number; + looping?: boolean; +} + +export type WorkerEvent = 'start' | 'end' | 'cleaning_worker' | 'poll' | 'ping' | 'job' | 'reEnqueue' | 'success' | 'failure' | 'error' | 'pause'; + +export class Worker extends NodeJS.EventEmitter { + constructor(options: WorkerOptions, jobs?: JobsHash); + + connect(): Promise; + start(): Promise; + end(): Promise; + + on(event: 'start' | 'end' | 'pause', cb: () => void): this; + on(event: 'cleaning_worker', cb: (worker: string, pid: string) => void): this; + on(event: 'poll', cb: (queue: string) => void): this; + on(event: 'ping', cb: (time: number) => void): this; + on(event: 'job', cb: (queue: string, job: Job) => void): this; + on(event: 'reEnqueue', cb: (queue: string, job: Job, plugin: string) => void): this; + on(event: 'success', cb: (queue: string, job: Job, result: any) => void): this; + on(event: 'failure', cb: (queue: string, job: Job, failure: any) => void): this; + on(event: 'error', cb: (error: Error, queue: string, job: Job) => void): this; + + once(event: 'start' | 'end' | 'pause', cb: () => void): this; + once(event: 'cleaning_worker', cb: (worker: string, pid: string) => void): this; + once(event: 'poll', cb: (queue: string) => void): this; + once(event: 'ping', cb: (time: number) => void): this; + once(event: 'job', cb: (queue: string, job: Job) => void): this; + once(event: 'reEnqueue', cb: (queue: string, job: Job, plugin: string) => void): this; + once(event: 'success', cb: (queue: string, job: Job, result: any) => void): this; + once(event: 'failure', cb: (queue: string, job: Job, failure: any) => void): this; + once(event: 'error', cb: (error: Error, queue: string, job: Job) => void): this; + + removeAllListeners(event: WorkerEvent): this; +} + +export interface SchedulerOptions { + connection?: ConnectionOptions; + name?: string; + timeout?: number; + stuckWorkerTimeout?: number; + masterLockTimeout?: number; +} + +export type SchedulerEvent = 'start' | 'end' | 'poll' | 'master' | 'cleanStuckWorker' | 'error' | 'workingTimestamp' | 'transferredJob'; + +export class Scheduler extends NodeJS.EventEmitter { + constructor(options: SchedulerOptions, jobs?: JobsHash); + + connect(): Promise; + start(): Promise; + end(): Promise; + + on(event: 'start' | 'end' | 'poll' | 'master', cb: () => void): this; + on(event: 'cleanStuckWorker', cb: (workerName: string, errorPayload: ErrorPayload, delta: number) => void): this; + on(event: 'error', cb: (error: Error, queue: string) => void): this; + on(event: 'workingTimestamp', cb: (timestamp: number) => void): this; + on(event: 'transferredJob', cb: (timestamp: number, job: Job) => void): this; + + once(event: 'start' | 'end' | 'poll' | 'master', cb: () => void): this; + once(event: 'cleanStuckWorker', cb: (workerName: string, errorPayload: ErrorPayload, delta: number) => void): this; + once(event: 'error', cb: (error: Error, queue: string) => void): this; + once(event: 'workingTimestamp', cb: (timestamp: number) => void): this; + once(event: 'transferredJob', cb: (timestamp: number, job: Job) => void): this; + + removeAllListeners(event: SchedulerEvent): this; +} + +export interface ErrorPayload { + worker: string; + queue: string; + payload: any; + exception: string; + error: string; + backtrace: string[]; + failed_at: string; +} diff --git a/types/node-resque/node-resque-tests.ts b/types/node-resque/node-resque-tests.ts new file mode 100644 index 0000000000..4e09b54851 --- /dev/null +++ b/types/node-resque/node-resque-tests.ts @@ -0,0 +1,72 @@ +import { ConnectionOptions, Worker, Queue, Job, JobsHash, Scheduler } from 'node-resque'; + +class AddJob implements Job { + plugins: string[] = ['JobLock']; + + pluginOptions = { + JobLock: {} + }; + + perform(...args: number[]): Promise { + const answer = args[0] + args[1]; + return new Promise((resolve) => { setTimeout(resolve, 1000); }) + .then(() => answer); + } +} + +class SubtractJob implements Job { + perform(...args: number[]): Promise { + const answer = args[0] - args[1]; + return Promise.resolve(answer); + } +} + +const connection: ConnectionOptions = { host: 'localhost', port: 6379 }; +const queues = ['math', 'otherQueue']; +const jobs: JobsHash = { + add: new AddJob(), + subtract: new SubtractJob() +}; + +const worker = new Worker({ connection, queues }, jobs); +const queue = new Queue({ connection }, jobs); +const scheduler = new Scheduler({ connection }); + +// register for worker events +worker.on('start', () => { console.log('worker started'); }); +worker.on('end', () => { console.log('worker ended'); }); +worker.on('cleaning_worker', (worker) => { console.log(`cleaning old worker ${worker}`); }); +worker.on('poll', (queue) => { console.log(`worker polling ${queue}`); }); +worker.on('ping', (time) => { console.log(`worker check in @ ${time}`); }); +worker.on('job', (queue, job) => { console.log(`working job ${queue} ${JSON.stringify(job)}`); }); +worker.on('reEnqueue', (queue, job, plugin) => { console.log(`reEnqueue job (${plugin}) ${queue} ${JSON.stringify(job)}`); }); +worker.on('success', (queue, job, result) => { console.log(`job success ${queue} ${JSON.stringify(job)} >> ${result}`); }); +worker.on('failure', (queue, job, failure) => { console.log(`job failure ${queue} ${JSON.stringify(job)} >> ${failure}`); }); +worker.on('error', (error, queue, job) => { console.log(`error ${queue} ${JSON.stringify(job)} >> ${error}`); }); +worker.on('pause', () => { console.log('worker paused'); }); + +// register for scheduler events +scheduler.on('start', () => { console.log('scheduler started'); }); +scheduler.on('end', () => { console.log('scheduler ended'); }); +scheduler.on('poll', () => { console.log('scheduler polling'); }); +scheduler.on('master', () => { console.log('scheduler became master'); }); +scheduler.on('cleanStuckWorker', (workerName, errorPayload, delta) => { console.log(`failing ${workerName} (stuck for ${delta}s) and failing job ${errorPayload}`); }); +scheduler.on('error', (error) => { console.log(`scheduler error >> ${error}`); }); +scheduler.on('workingTimestamp', (timestamp) => { console.log(`scheduler working timestamp ${timestamp}`); }); +scheduler.on('transferredJob', (timestamp, job) => { console.log(`scheduler enquing job ${timestamp} >> ${JSON.stringify(job)}`); }); + +// register for queue events +queue.on('error', (error) => { console.log(error); }); + +// start worker +worker.connect().then(() => worker.start()); + +// start scheduler +scheduler.connect().then(() => scheduler.start()); + +queue.connect().then(() => { + queue.enqueue('math', 'add', [1, 2]); + queue.enqueue('math', 'add', [1, 2]); + queue.enqueue('math', 'add', [2, 3]); + queue.enqueueIn(3000, 'math', 'subtract', [2, 1]); +}); diff --git a/types/node-resque/tsconfig.json b/types/node-resque/tsconfig.json new file mode 100644 index 0000000000..6cdce9ca44 --- /dev/null +++ b/types/node-resque/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", + "node-resque-tests.ts" + ] +} diff --git a/types/node-resque/tslint.json b/types/node-resque/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/node-resque/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} 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/numeric/index.d.ts b/types/numeric/index.d.ts new file mode 100644 index 0000000000..d17791d7f6 --- /dev/null +++ b/types/numeric/index.d.ts @@ -0,0 +1,1199 @@ +// Type definitions for numeric 1.2 +// Project: https://github.com/sloisel/numeric +// Definitions by: Sasha Grin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +// Documentation: http://www.numericjs.com/documentation.html + +type NonNullPrimitive = number | string | boolean | undefined; +type Scalar = number; +type Vector = number[]; +type VectorBoolean = boolean[]; +type Matrix = number[][]; +type SparseMatrix = [Vector, Vector, Vector]; +type DeprecatedSparseMatrix = Array>; +type DeprecatedSparseVector = Array; +type CCSComparisonResult = [Vector, Vector, VectorBoolean]; +type ShapeFunction = (i: number, j: number) => boolean; +interface LUPP { + L: SparseMatrix; + U: SparseMatrix; + P: Vector; + Pinv: Vector; +} +interface LU { + L: Matrix; + U: Matrix; +} +type MultidimensionalArray = + | T[][] + | T[][][] + | T[][][][] + | T[][][][][] + | T[][][][][][] + | T[][][][][][][] + | T[][][][][][][][] + | T[][][][][][][][][][] + | T[][][][][][][][][][][] + | T[][][][][][][][][][][][] + | T[][][][][][][][][][][][][] + | T[][][][][][][][][][][][][][] + | T[][][][][][][][][][][][][][][] + | T[][][][][][][][][][][][][][][][]; +type MultidimensionalMatrix = MultidimensionalArray; + +type TensorValue = Scalar | Vector | MultidimensionalMatrix; +type NonScalar = Vector | MultidimensionalMatrix; + +declare class Tensor { + x: TensorValue; + y?: TensorValue; + + add(tensor: Tensor | TensorValue): Tensor; + sub(tensor: Tensor | TensorValue): Tensor; + mul(tensor: Tensor | TensorValue): Tensor; + // it's buggy. https://github.com/sloisel/numeric/pull/59 + reciprocal(): Tensor; + div(tensor: Tensor | TensorValue): Tensor; + dot(tensor: Tensor | TensorValue): Tensor; + transpose(): Tensor; + transjugate(): Tensor; + exp(): Tensor; + conj(): Tensor; + neg(): Tensor; + sin(): Tensor; + cos(): Tensor; + abs(): Tensor; + log(): Tensor; + norm2(): Tensor; + inv(): Tensor; + get(i: Vector): Tensor; + set(i: Vector, value: Tensor): Tensor; + getRows(i0: number, i1: number): Tensor; + setRows(i0: number, i1: number, tensor: Tensor): Tensor; + getRow(k: number): Tensor; + setRow(i: number, tensor: Tensor): Tensor; + getBlock(from: Vector, to: Vector): Tensor; + setBlock(from: Vector, to: Vector, tensor: Tensor): Tensor; + rep(s: Vector, value: Tensor | TensorValue): Tensor; + diag(d: Tensor | TensorValue): Tensor; + eig(): { lambda: Tensor; E: Tensor }; + identity(n: number): Tensor; + getDiag(): Tensor; + // fast fourier transforms + fft(): Tensor; + ifft(): Tensor; +} + +declare class Spline { + x: Vector; + yl: Vector; + yr: Vector; + kl: Vector; + kr: Vector; + + at(x0: Vector | Scalar): Vector | Scalar; + diff(): Spline; + roots(): Vector; +} + +declare class Dopri { + x: Vector; + y: Vector; + f: Vector; + ymid: Vector; + iterations: number; + msg: string; + events?: boolean | VectorBoolean; + + at(x: Vector): Vector | Matrix; +} + +interface Numeric { + readonly epsilon: number; + largeArray: number; + precision: number; + readonly version: string; + + seedrandom: { + seedrandom(seed: number | string, useEntropy?: boolean): string; + random(): number; + }; + + // utility functions + // Benchmarking routine + bench(func: () => any, interval?: number): number; + prettyPrint(x?: any): string; + parseDate(date: string): number; + parseDate(dates: string[]): number[]; + parseFloat(input: string): number; + parseFloat(inputs: string[]): number[]; + parseCSV(csv: string): string[][]; + // toCSV is buggy. + // https://github.com/sloisel/numeric/pull/51 + toCSV(csvArray: any[][]): string; + // Encode a matrix as an image URL + imageURL(img: number[][]): string; + getURL(url: string): any; + + // linear algebra with arrays + // Get Array dimensions + dim(arr: any): Vector; + // x and y are entrywise identical + same(x: any, y: any): boolean; + // Create an Array by duplicating values + rep(scale: Vector, value: T, key?: number): MultidimensionalArray; + + // Matrix-Matrix, Matrix-Vector, Vector-Matrix and Vector-Vector product + dot( + x: Vector | Matrix | Scalar, + y: Vector | Matrix | Scalar + ): Vector | Matrix | Scalar; + dotMMsmall(x: Matrix, y: Matrix): Matrix; + dotMMbig(x: Matrix, y: Matrix): Matrix; + dotMV(x: Matrix, y: Vector): Vector; + dotVM(x: Vector, y: Matrix): Vector; + dotVV(x: Vector, y: Vector): Scalar; + + // Create diagonal matrix + diag(diagonal: Vector): Matrix; + // Get the diagonal of a Matrix + getDiag(matrix: Matrix): Vector; + // Identity matrix + identity(num: number): Matrix; + + // Pointwise Math.abs(x) + abs(x: T): T; + absV(x: Vector): Vector; + abseqV(x: Vector): Vector; + abseq(x: T): T; + + // Pointwise arc-cosine + acos(x: T): T; + acosV(x: Vector): Vector; + acoseqV(x: Vector): Vector; + acoseq(x: T): T; + + // Pointwise arc-sine + asin(x: T): T; + asinV(x: Vector): Vector; + asineqV(x: Vector): Vector; + asineq(x: T): T; + + // Pointwise arc-tangent + atan(x: T): T; + atanV(x: Vector): Vector; + ataneqV(x: Vector): Vector; + ataneq(x: T): T; + + // Pointwise Math.ceil(x) + ceil(x: T): T; + ceilV(x: Vector): Vector; + ceileqV(x: Vector): Vector; + ceileq(x: T): T; + + // Pointwise Math.cos(x) + cos(x: T): T; + cosV(x: Vector): Vector; + coseqV(x: Vector): Vector; + coseq(x: T): T; + + // Pointwise Math.exp(x) + exp(x: T): T; + expV(x: Vector): Vector; + expeqV(x: Vector): Vector; + expeq(x: T): T; + + // Poinwise Math.floor(x) + floor(x: T): T; + floorV(x: Vector): Vector; + flooreqV(x: Vector): Vector; + flooreq(x: T): T; + + // Pointwise Math.log(x) + log(x: T): T; + logV(x: Vector): Vector; + logeqV(x: Vector): Vector; + logeq(x: T): T; + + // Pointwise Math.round(x) + round(x: T): T; + roundV(x: Vector): Vector; + roundeqV(x: Vector): Vector; + roundeq(x: T): T; + + // Pointwise Math.sin(x) + sin(x: T): T; + sinV(x: Vector): Vector; + sineqV(x: Vector): Vector; + sineq(x: T): T; + + // Pointwise Math.sqrt(x) + sqrt(x: T): T; + sqrtV(x: Vector): Vector; + sqrteqV(x: Vector): Vector; + sqrteq(x: T): T; + + // Pointwise tangent + tan(x: T): T; + tanV(x: Vector): Vector; + taneqV(x: Vector): Vector; + taneq(x: T): T; + + // Pointwise Number.isNan(x) + isNaN(x: Vector): VectorBoolean; + isNaN(x: MultidimensionalMatrix): MultidimensionalArray; + isNaNV(x: Vector): VectorBoolean; + isNaNeqV(x: Vector): VectorBoolean; + isNaNeq(x: Vector): VectorBoolean; + isNaNeq(x: MultidimensionalMatrix): MultidimensionalArray; + + // Pointwise Number.isFinite(x) + isFinite(x: Vector): VectorBoolean; + isFinite(x: MultidimensionalMatrix): MultidimensionalArray; + isFiniteV(x: Vector): VectorBoolean; + isFiniteeqV(x: Vector): VectorBoolean; + isFiniteeq(x: Vector): VectorBoolean; + isFiniteeq(x: MultidimensionalMatrix): MultidimensionalArray; + + // Pointwise -x + neg(x: T): T; + negV(x: Vector): Vector; + negeq(x: T): T; + negeqV(x: Vector): Vector; + + // Pointwise logical negation !x + not(x: NonNullPrimitive): boolean; + not(x: NonNullPrimitive[]): VectorBoolean; + not( + x: MultidimensionalArray + ): MultidimensionalArray; + notV(x: NonNullPrimitive[]): VectorBoolean; + noteq(x: NonNullPrimitive): boolean; + noteq(x: NonNullPrimitive[]): VectorBoolean; + noteq( + x: MultidimensionalArray + ): MultidimensionalArray; + noteqV(x: NonNullPrimitive[]): VectorBoolean; + + // Pointwise binary negation ~x + bnot(x: T): T; + bnotV(x: Vector): Vector; + bnoteq(x: T): T; + bnoteqV(x: Vector): Vector; + + // Deep copy of Array + clone< + T extends NonNullPrimitive[] | MultidimensionalArray + >( + x: T + ): T; + cloneV(x: NonNullPrimitive[]): NonNullPrimitive[]; + cloneeq(x: NonNullPrimitive[]): NonNullPrimitive[]; + cloneeq< + T extends NonNullPrimitive[] | MultidimensionalArray + >( + x: T + ): T; + cloneeqV(x: NonNullPrimitive[]): NonNullPrimitive[]; + + // Pointwise sum x+y + add(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + add( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + add( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "+"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "+"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "+"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + addVV(x: Vector, y: Vector): Vector; + addSV(x: Scalar, y: Vector): Vector; + addVS(x: Vector, y: Scalar): Vector; + addeq(x: Vector, y: Vector | Scalar): Vector; + addeqV(x: Vector, y: Vector): Vector; + addeqS(x: Vector, y: Scalar): Vector; + + // Pointwise x-y + sub(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + sub( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + sub( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "-"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "-"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "-"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + subVV(x: Vector, y: Vector): Vector; + subSV(x: Scalar, y: Vector): Vector; + subVS(x: Vector, y: Scalar): Vector; + subeq(x: Vector, y: Vector | Scalar): Vector; + subeqV(x: Vector, y: Vector): Vector; + subeqS(x: Vector, y: Scalar): Vector; + + // Pointwise x*y + mul(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + mul( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + mul( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "*"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "*"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "*"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + mulVV(x: Vector, y: Vector): Vector; + mulSV(x: Scalar, y: Vector): Vector; + mulVS(x: Vector, y: Scalar): Vector; + muleq(x: Vector, y: Vector | Scalar): Vector; + muleqV(x: Vector, y: Vector): Vector; + muleqS(x: Vector, y: Scalar): Vector; + + // Pointwise x/y + div(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + div( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + div( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "/"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "/"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "/"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + divVV(x: Vector, y: Vector): Vector; + divSV(x: Scalar, y: Vector): Vector; + divVS(x: Vector, y: Scalar): Vector; + diveq(x: Vector, y: Vector | Scalar): Vector; + diveqV(x: Vector, y: Vector): Vector; + diveqS(x: Vector, y: Scalar): Vector; + + // Pointwise x%y + mod(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + mod( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + mod( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "%"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "%"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "%"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + modVV(x: Vector, y: Vector): Vector; + modSV(x: Scalar, y: Vector): Vector; + modVS(x: Vector, y: Scalar): Vector; + modeq(x: Vector, y: Vector | Scalar): Vector; + modeqV(x: Vector, y: Vector): Vector; + modeqS(x: Vector, y: Scalar): Vector; + + // Pointwise x && y + and(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + and( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + and( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "&&"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "&&"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "&&"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + andVV(x: Vector, y: Vector): Vector; + andSV(x: Scalar, y: Vector): Vector; + andVS(x: Vector, y: Scalar): Vector; + andeq(x: Vector, y: Vector | Scalar): Vector; + andeqV(x: Vector, y: Vector): Vector; + andeqS(x: Vector, y: Scalar): Vector; + + // Pointwise logical or x||y + or(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + or( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + or( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "||"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "||"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "||"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + orVV(x: Vector, y: Vector): Vector; + orSV(x: Scalar, y: Vector): Vector; + orVS(x: Vector, y: Scalar): Vector; + oreq(x: Vector, y: Vector | Scalar): Vector; + oreqV(x: Vector, y: Vector): Vector; + oreqS(x: Vector, y: Scalar): Vector; + + // Pointwise comparison x === y + eq(x: Scalar, y: Scalar): boolean; + eq(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + eq( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + "==="(x: Scalar, y: Scalar, ...args: Scalar[]): boolean; + "==="(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + "==="( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + eqVV(x: Vector, y: Vector): VectorBoolean; + eqSV(x: Scalar, y: Vector): VectorBoolean; + eqVS(x: Vector, y: Scalar): VectorBoolean; + eqeq(x: Vector, y: Vector | Scalar): VectorBoolean; + eqeqV(x: Vector, y: Vector): VectorBoolean; + eqeqS(x: Vector, y: Scalar): VectorBoolean; + + // Pointwise x!==y + neq(x: Scalar, y: Scalar): boolean; + neq(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + neq( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + "!=="(x: Scalar, y: Scalar, ...args: Scalar[]): boolean; + "!=="(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + "!=="( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + neqVV(x: Vector, y: Vector): VectorBoolean; + neqSV(x: Scalar, y: Vector): VectorBoolean; + neqVS(x: Vector, y: Scalar): VectorBoolean; + neqeq(x: Vector, y: Vector | Scalar): VectorBoolean; + neqeqV(x: Vector, y: Vector): VectorBoolean; + neqeqS(x: Vector, y: Scalar): VectorBoolean; + + // Pointwise x; + "<"(x: Scalar, y: Scalar, ...args: Scalar[]): boolean; + "<"(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + "<"( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + ltVV(x: Vector, y: Vector): VectorBoolean; + ltSV(x: Scalar, y: Vector): VectorBoolean; + ltVS(x: Vector, y: Scalar): VectorBoolean; + lteq(x: Vector, y: Vector | Scalar): VectorBoolean; + lteqV(x: Vector, y: Vector): VectorBoolean; + lteqS(x: Vector, y: Scalar): VectorBoolean; + + // Pointwise x>y + gt(x: Scalar, y: Scalar): boolean; + gt(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + gt( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + ">"(x: Scalar, y: Scalar, ...args: Scalar[]): boolean; + ">"(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + ">"( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + gtVV(x: Vector, y: Vector): VectorBoolean; + gtSV(x: Scalar, y: Vector): VectorBoolean; + gtVS(x: Vector, y: Scalar): VectorBoolean; + gteq(x: Vector, y: Vector | Scalar): VectorBoolean; + gteqV(x: Vector, y: Vector): VectorBoolean; + gteqS(x: Vector, y: Scalar): VectorBoolean; + + // Pointwise x<=y + leq(x: Scalar, y: Scalar): boolean; + leq(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + leq( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + "<="(x: Scalar, y: Scalar, ...args: Scalar[]): boolean; + "<="(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + "<="( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + leqVV(x: Vector, y: Vector): VectorBoolean; + leqSV(x: Scalar, y: Vector): VectorBoolean; + leqVS(x: Vector, y: Scalar): VectorBoolean; + leqeq(x: Vector, y: Vector | Scalar): VectorBoolean; + leqeqV(x: Vector, y: Vector): VectorBoolean; + leqeqS(x: Vector, y: Scalar): VectorBoolean; + + // Pointwise x>=y + geq(x: Scalar, y: Scalar): boolean; + geq(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + geq( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + ">="(x: Scalar, y: Scalar, ...args: Scalar[]): boolean; + ">="(x: Scalar | Vector, y: Scalar | Vector): VectorBoolean; + ">="( + x: MultidimensionalMatrix, + y: MultidimensionalMatrix + ): MultidimensionalArray; + geqVV(x: Vector, y: Vector): VectorBoolean; + geqSV(x: Scalar, y: Vector): VectorBoolean; + geqVS(x: Vector, y: Scalar): VectorBoolean; + geqeq(x: Vector, y: Vector | Scalar): VectorBoolean; + geqeqV(x: Vector, y: Vector): VectorBoolean; + geqeqS(x: Vector, y: Scalar): VectorBoolean; + + // Pointwise x & y + band(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + band( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + band( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "&"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "&"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "&"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + bandVV(x: Vector, y: Vector): Vector; + bandSV(x: Scalar, y: Vector): Vector; + bandVS(x: Vector, y: Scalar): Vector; + bandeq(x: Vector, y: Vector | Scalar): Vector; + bandeqV(x: Vector, y: Vector): Vector; + bandeqS(x: Vector, y: Scalar): Vector; + + // Pointwise binary or x|y + bor(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + bor( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + bor( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "|"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "|"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "|"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + borVV(x: Vector, y: Vector): Vector; + borSV(x: Scalar, y: Vector): Vector; + borVS(x: Vector, y: Scalar): Vector; + boreq(x: Vector, y: Vector | Scalar): Vector; + boreqV(x: Vector, y: Vector): Vector; + boreqS(x: Vector, y: Scalar): Vector; + + // Pointwise binary xor x^y + bxor(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + bxor( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + bxor( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "^"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "^"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "^"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + bxorVV(x: Vector, y: Vector): Vector; + bxorSV(x: Scalar, y: Vector): Vector; + bxorVS(x: Vector, y: Scalar): Vector; + bxoreq(x: Vector, y: Vector | Scalar): Vector; + bxoreqV(x: Vector, y: Vector): Vector; + bxoreqS(x: Vector, y: Scalar): Vector; + + // Pointwise x< + ): Vector; + lshift( + x: T, + y: T | Scalar, + ...args: Array + ): T; + "<<"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + "<<"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + "<<"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + lshiftVV(x: Vector, y: Vector): Vector; + lshiftSV(x: Scalar, y: Vector): Vector; + lshiftVS(x: Vector, y: Scalar): Vector; + lshifteq(x: Vector, y: Vector | Scalar): Vector; + lshifteqV(x: Vector, y: Vector): Vector; + lshifteqS(x: Vector, y: Scalar): Vector; + + // Pointwise x>>y + rshift(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + rshift( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + rshift( + x: T, + y: T | Scalar, + ...args: Array + ): T; + ">>"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + ">>"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + ">>"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + rshiftVV(x: Vector, y: Vector): Vector; + rshiftSV(x: Scalar, y: Vector): Vector; + rshiftVS(x: Vector, y: Scalar): Vector; + rshifteq(x: Vector, y: Vector | Scalar): Vector; + rshifteqV(x: Vector, y: Vector): Vector; + rshifteqS(x: Vector, y: Scalar): Vector; + + // Pointwise x>>>y + rrshift(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + rrshift( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + rrshift( + x: T, + y: T | Scalar, + ...args: Array + ): T; + ">>>"(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + ">>>"( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + ">>>"( + x: T, + y: T | Scalar, + ...args: Array + ): T; + rrshiftVV(x: Vector, y: Vector): Vector; + rrshiftSV(x: Scalar, y: Vector): Vector; + rrshiftVS(x: Vector, y: Scalar): Vector; + rrshifteq(x: Vector, y: Vector | Scalar): Vector; + rrshifteqV(x: Vector, y: Vector): Vector; + rrshifteqS(x: Vector, y: Scalar): Vector; + + // Pointwise arc-tangent (two parameters) + atan2(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + atan2( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + atan2( + x: T, + y: T | Scalar, + ...args: Array + ): T; + atan2VV(x: Vector, y: Vector): Vector; + atan2SV(x: Scalar, y: Vector): Vector; + atan2VS(x: Vector, y: Scalar): Vector; + atan2eq(x: Vector, y: Vector | Scalar): Vector; + atan2eqV(x: Vector, y: Vector): Vector; + atan2eqS(x: Vector, y: Scalar): Vector; + + // Pointwise x**y + pow(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + pow( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + pow( + x: T, + y: T | Scalar, + ...args: Array + ): T; + powVV(x: Vector, y: Vector): Vector; + powSV(x: Scalar, y: Vector): Vector; + powVS(x: Vector, y: Scalar): Vector; + poweq(x: Vector, y: Vector | Scalar): Vector; + poweqV(x: Vector, y: Vector): Vector; + poweqS(x: Vector, y: Scalar): Vector; + + // Pointwise max(x,y) + max(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + max( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + max( + x: T, + y: T | Scalar, + ...args: Array + ): T; + maxVV(x: Vector, y: Vector): Vector; + maxSV(x: Scalar, y: Vector): Vector; + maxVS(x: Vector, y: Scalar): Vector; + maxeq(x: Vector, y: Vector | Scalar): Vector; + maxeqV(x: Vector, y: Vector): Vector; + maxeqS(x: Vector, y: Scalar): Vector; + + // Pointwise min(x,y) + min(x: Scalar, y: Scalar, ...args: Scalar[]): Scalar; + min( + x: Scalar | Vector, + y: Scalar | Vector, + ...args: Array + ): Vector; + min( + x: T, + y: T | Scalar, + ...args: Array + ): T; + minVV(x: Vector, y: Vector): Vector; + minSV(x: Scalar, y: Vector): Vector; + minVS(x: Vector, y: Scalar): Vector; + mineq(x: Vector, y: Vector | Scalar): Vector; + mineqV(x: Vector, y: Vector): Vector; + mineqS(x: Vector, y: Scalar): Vector; + + // One or more of the components of x are true + any(x: any): boolean; + anyV(x: any[]): boolean; + + // All the components of x are true + all(x: any): boolean; + allV(x: any[]): boolean; + + // Sum all the entries of x + sum(x: Scalar | Vector | MultidimensionalMatrix): number; + sumV(x: Vector): number; + + // Product of all the entries of x + prod(x: Scalar | Vector | MultidimensionalMatrix): number; + prodV(x: Vector): number; + + // Sum of squares of entries of x + norm2Squared(x: Scalar | Vector | MultidimensionalMatrix): number; + norm2SquaredV(x: Vector): number; + + // Largest modulus entry of x + norminf(x: Scalar | Vector | MultidimensionalMatrix): number; + norminfV(x: Vector): number; + + // Sum all absolute values of entries + norm1(x: Scalar | Vector | MultidimensionalMatrix): number; + norm1V(x: Vector): number; + + // Largest value of entries (not modulus) + sup(x: Scalar | Vector | MultidimensionalMatrix): number; + supV(x: Vector): number; + + // Smallest value of entries (not modulus) + inf(x: Scalar | Vector | MultidimensionalMatrix): number; + infV(x: Vector): number; + + // Round the values of entries + truncVV(x: Vector, y: Vector): Vector; + truncVS(x: Vector, y: number): Vector; + truncSV(x: number, y: Vector): Vector; + trunc(x: number | Vector, y: number | Vector): Vector; + + // Matrix inverse + inv(x: Matrix): Matrix; + // Determinant + det(x: Matrix): number; + // Matrix transpose + transpose(x: Matrix): Matrix; + // Negate matrix and transpose + negtranspose(x: Matrix): Matrix; + // Create an Array of random numbers + random(s: Vector): Vector | MultidimensionalMatrix; + // Square root of the sum of the square of the entries of x + norm2(x: Scalar | Vector | MultidimensionalMatrix): number; + // Generate evenly spaced values + linspace(from: number, to: number, numberOfValues?: number): Vector; + // Extract a block from a matrix + getBlock( + x: T, + from: Vector, + to: Vector + ): T; + // Set a block of a matrix + setBlock( + x: T, + from: Vector, + to: Vector, + b: T + ): T; + // create two-dimensional matrix + blockMatrix(x: Scalar | Vector | MultidimensionalMatrix): Matrix; + // x * y + tensor(x: Scalar, y: Scalar): Scalar; + // TensorValue product ret[i][j] = x[i]*y[j] + tensor(x: Vector, y: Vector): Matrix; + + // return instance of Tensor class. X — real value, y — imaginary part. + t(x: TensorValue, y?: TensorValue): Tensor; + + // Eigenvalues of real matrices + house(x: Vector): Vector; + toUpperHessenberg(matrix: Matrix): { H: Matrix; Q: Matrix }; + QRFrancis(x: Matrix, maxiter?: number): { Q: Matrix; B: Matrix }; + eig(A: Matrix, maxiter?: number): { lambda: Tensor; E: Tensor }; + + // Compressed Column Storage matrices + ccsSparse(matrix: Matrix): SparseMatrix; + ccsFull(matrix: SparseMatrix): Matrix; + ccsTSolve( + matrix: SparseMatrix, + b: Vector, + x?: Vector, + bj?: Vector, + xj?: Vector + ): Vector; + ccsDot(A: SparseMatrix, B: SparseMatrix): SparseMatrix; + ccsLUP(matrix: SparseMatrix, threshold?: number): LUPP; + ccsDim(matrix: SparseMatrix): Vector; + ccsGetBlock( + matrix: SparseMatrix, + i?: Vector | Scalar, + j?: Vector | Scalar + ): SparseMatrix; + ccsLUPSolve(lup: LUPP, B: SparseMatrix): Vector; + ccsScatter(matrix: SparseMatrix): SparseMatrix; + ccsGather(matrix: SparseMatrix): SparseMatrix; + + ccsadd(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsadd(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsaddMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccssub(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccssub(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccssubMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsmul(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsmul(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsmulMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsdiv(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsdiv(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsdivMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsmod(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsmod(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsmodMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsand(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsand(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsandMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsor(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsor(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsorMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccseq(x: SparseMatrix, y: Scalar | SparseMatrix): CCSComparisonResult; + ccseq(x: Scalar | SparseMatrix, y: SparseMatrix): CCSComparisonResult; + ccseqMM(x: SparseMatrix, y: SparseMatrix): CCSComparisonResult; + + ccsneq(x: SparseMatrix, y: Scalar | SparseMatrix): CCSComparisonResult; + ccsneq(x: Scalar | SparseMatrix, y: SparseMatrix): CCSComparisonResult; + ccsneqMM(x: SparseMatrix, y: SparseMatrix): CCSComparisonResult; + + ccslt(x: SparseMatrix, y: Scalar | SparseMatrix): CCSComparisonResult; + ccslt(x: Scalar | SparseMatrix, y: SparseMatrix): CCSComparisonResult; + ccsltMM(x: SparseMatrix, y: SparseMatrix): CCSComparisonResult; + + ccsgt(x: SparseMatrix, y: Scalar | SparseMatrix): CCSComparisonResult; + ccsgt(x: Scalar | SparseMatrix, y: SparseMatrix): CCSComparisonResult; + ccsgtMM(x: SparseMatrix, y: SparseMatrix): CCSComparisonResult; + + ccsleq(x: SparseMatrix, y: Scalar | SparseMatrix): CCSComparisonResult; + ccsleq(x: Scalar | SparseMatrix, y: SparseMatrix): CCSComparisonResult; + ccsleqMM(x: SparseMatrix, y: SparseMatrix): CCSComparisonResult; + + ccsgeq(x: SparseMatrix, y: Scalar | SparseMatrix): CCSComparisonResult; + ccsgeq(x: Scalar | SparseMatrix, y: SparseMatrix): CCSComparisonResult; + ccsgeqMM(x: SparseMatrix, y: SparseMatrix): CCSComparisonResult; + + ccsband(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsband(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsbandMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsbor(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsbor(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsborMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsbxor(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsbxor(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsbxorMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccslshift(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccslshift(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccslshiftMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsrshift(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsrshift(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsrshiftMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + ccsrrshift(x: SparseMatrix, y: Scalar | SparseMatrix): SparseMatrix; + ccsrrshift(x: Scalar | SparseMatrix, y: SparseMatrix): SparseMatrix; + ccsrrshiftMM(x: SparseMatrix, y: SparseMatrix): SparseMatrix; + + /** @deprecated */ + sdim(matrix: any, ret?: Vector, k?: number): Vector; + /** @deprecated */ + sclone(matrix: T, k?: number, n?: number): T; + /** @deprecated */ + sdiag(d: Vector): DeprecatedSparseMatrix; + /** @deprecated */ + sidentity(n: Scalar): DeprecatedSparseMatrix; + /** @deprecated */ + stranspose(matrix: DeprecatedSparseMatrix): DeprecatedSparseMatrix; + /** @deprecated */ + sdotMM( + a: DeprecatedSparseMatrix, + b: DeprecatedSparseMatrix + ): DeprecatedSparseMatrix; + /** @deprecated */ + sdotMV( + matrix: DeprecatedSparseMatrix, + vector: DeprecatedSparseVector + ): DeprecatedSparseVector; + /** @deprecated */ + sdotVM( + vector: DeprecatedSparseVector, + matrix: DeprecatedSparseMatrix + ): DeprecatedSparseMatrix; + /** @deprecated */ + sdotVV(x: DeprecatedSparseVector, y: DeprecatedSparseVector): number; + /** @deprecated */ + sdot( + x: Scalar | DeprecatedSparseVector | DeprecatedSparseMatrix, + y: Scalar | DeprecatedSparseVector | DeprecatedSparseMatrix + ): Scalar | DeprecatedSparseVector | DeprecatedSparseMatrix; + /** @deprecated */ + sscatter(matrix: DeprecatedSparseMatrix): DeprecatedSparseMatrix; + /** @deprecated */ + sgather( + matrix: DeprecatedSparseMatrix, + ret?: DeprecatedSparseVector, + k?: DeprecatedSparseVector + ): DeprecatedSparseMatrix; + + // Coordinate matrices + cLU(matrix: Matrix): LU; + cLUSolve(lu: LU, b: Vector): Vector; + cgrid(n: number | [number, number], shape?: "L" | ShapeFunction): Matrix; + cdelsq(g: Matrix): Matrix; + cdotmv(matrix: Matrix, x: Vector): Vector; + + // Splines + spline( + x: Vector, + y: Vector | Matrix, + k1?: "periodic" | Scalar, + kn?: "periodic" | Scalar + ): Spline; + + // Unconstrained optimisations + uncmin( + f: (x: Vector) => Scalar, + x0: Vector, + tol?: number, + gradient?: any, + maxit?: number, + callback?: ( + it: number, + x0: Vector, + f0: Scalar, + g0: Vector, + h1: Matrix + ) => any, + options?: { Hinv: Matrix } + ): { + solution: Vector; + f: Scalar; + gradient: Vector; + invHessian: Matrix; + iterations: number; + message: string; + }; + gradient(f: (x: Vector) => Scalar, x: Vector): Vector; + + // Ode solver (Dormand-Prince) + dopri( + x0: Scalar, + x1: Scalar, + y0: Scalar, + f: (x: Vector | Scalar, y: Vector | Scalar) => Vector | Scalar, + tol?: number, + maxit?: number, + event?: (x: Vector | Scalar, y: Vector | Scalar) => Vector | Scalar + ): Dopri; + + // Solving the linear problem Ax=b + solve(matrix: Matrix, vector: Vector): Vector; + LU(matrix: Matrix, fast?: boolean): { LU: Matrix; P: Vector }; + LUsolve(lup: { LU: Matrix; P: Vector }, vector: Vector): Vector; + + // Linear programming + echelonize(matrix: Matrix): { I: Matrix; A: Matrix; P: Vector }; + solveLP( + c: Vector, + A: Matrix, + b: Vector, + Aeq?: Matrix, + beq?: Matrix, + tol?: number, + maxit?: number + ): { solution: Scalar | Vector; message: string; iterations: number }; + + solveQP( + Dmat: Matrix, + dvec: Vector, + Amat: Matrix, + bvec: Vector, + meq?: number, + factorized?: any + ): { + solution: Vector; + value: Vector; + unconstrained_solution: Vector; + iterations: Vector; + iact: Vector; + message: string; + }; + + svd(matrix: Matrix): { U: Matrix; S: Vector; V: Matrix }; +} + +declare const numeric: Numeric; +export = numeric; diff --git a/types/numeric/numeric-tests.ts b/types/numeric/numeric-tests.ts new file mode 100644 index 0000000000..017f3ae6cd --- /dev/null +++ b/types/numeric/numeric-tests.ts @@ -0,0 +1,630 @@ +import numeric = require("numeric"); + +const vector = [2, 5]; +const matrix = [vector, vector]; +const threeDimensionalMatrix = [[[2, 3], [2, 3], [3, 5]]]; +const sparseMatrix: [number[], number[], number[]] = [vector, vector, vector]; + +numeric.bench(() => null, 150); // $ExpectType number +numeric.prettyPrint(vector); // $ExpectType string +numeric.parseDate("08-08-17"); // $ExpectType number +numeric.parseDate(["08-05-87", "08-05-75"]); // $ExpectType number[] +numeric.parseFloat("55.24"); // $ExpectType number +numeric.parseFloat(["25.15", "44.25", "as"]); // $ExpectType number[] +numeric.parseCSV("car, bike"); // $ExpectType string[][] +numeric.toCSV([[25, 52, 62, 66], ["car", "bad", "bike", {}]]); // $ExpectType string +numeric.imageURL([[25, 50], [52, 52]]); // $ExpectType string +numeric.getURL('sdf'); // $ExpectType any + +numeric.dim(matrix); // $ExpectType number[] +numeric.same(25, [25]); // $ExpectType boolean +numeric.rep([2, 5], true); +numeric.dotMMsmall(matrix, matrix); // $ExpectType number[][] +numeric.dotMMbig(matrix, matrix); // $ExpectType number[][] +numeric.dotMV(matrix, vector); // $ExpectType number[] +numeric.dotVM(vector, matrix); // $ExpectType number[] +numeric.dotVV(vector, vector); // $ExpectType number +numeric.dot(vector, matrix); // $ExpectType number | number[] | number[][] +numeric.diag([25, 52]); // $ExpectType number[][] +numeric.getDiag(matrix); // $ExpectType number[] +numeric.identity(24); // $ExpectType number[][] + +numeric.abs(matrix); // $ExpectType number[][] +numeric.absV(vector); // $ExpectType number[] +numeric.abseqV(vector); // $ExpectType number[] +numeric.abseq(matrix); // $ExpectType number[][] + +numeric.acos(matrix); // $ExpectType number[][] +numeric.acosV(vector); // $ExpectType number[] +numeric.acoseqV(vector); // $ExpectType number[] +numeric.acoseq(matrix); // $ExpectType number[][] + +numeric.asin(matrix); // $ExpectType number[][] +numeric.asinV(vector); // $ExpectType number[] +numeric.asineqV(vector); // $ExpectType number[] +numeric.asineq(matrix); // $ExpectType number[][] + +numeric.atan(matrix); // $ExpectType number[][] +numeric.atanV(vector); // $ExpectType number[] +numeric.ataneqV(vector); // $ExpectType number[] +numeric.ataneq(matrix); // $ExpectType number[][] + +numeric.ceil(matrix); // $ExpectType number[][] +numeric.ceilV(vector); // $ExpectType number[] +numeric.ceileqV(vector); // $ExpectType number[] +numeric.ceileq(matrix); // $ExpectType number[][] + +numeric.cos(matrix); // $ExpectType number[][] +numeric.cosV(vector); // $ExpectType number[] +numeric.coseqV(vector); // $ExpectType number[] +numeric.coseq(matrix); // $ExpectType number[][] + +numeric.exp(matrix); // $ExpectType number[][] +numeric.expV(vector); // $ExpectType number[] +numeric.expeqV(vector); // $ExpectType number[] +numeric.expeq(matrix); // $ExpectType number[][] + +numeric.floor(matrix); // $ExpectType number[][] +numeric.floorV(vector); // $ExpectType number[] +numeric.flooreqV(vector); // $ExpectType number[] +numeric.flooreq(matrix); // $ExpectType number[][] + +numeric.log(matrix); // $ExpectType number[][] +numeric.logV(vector); // $ExpectType number[] +numeric.logeqV(vector); // $ExpectType number[] +numeric.logeq(matrix); // $ExpectType number[][] + +numeric.round(matrix); // $ExpectType number[][] +numeric.roundV(vector); // $ExpectType number[] +numeric.roundeqV(vector); // $ExpectType number[] +numeric.roundeq(matrix); // $ExpectType number[][] + +numeric.sin(matrix); // $ExpectType number[][] +numeric.sinV(vector); // $ExpectType number[] +numeric.sineqV(vector); // $ExpectType number[] +numeric.sineq(matrix); // $ExpectType number[][] + +numeric.sqrt(matrix); // $ExpectType number[][] +numeric.sqrtV(vector); // $ExpectType number[] +numeric.sqrteqV(vector); // $ExpectType number[] +numeric.sqrteq(matrix); // $ExpectType number[][] + +numeric.tan(matrix); // $ExpectType number[][] +numeric.tanV(vector); // $ExpectType number[] +numeric.taneqV(vector); // $ExpectType number[] +numeric.taneq(matrix); // $ExpectType number[][] + +numeric.isNaN(vector); // $ExpectType boolean[] +numeric.isNaN(threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.isNaNV(vector); // $ExpectType boolean[] +numeric.isNaNeqV(vector); // $ExpectType boolean[] +numeric.isNaNeq(vector); // $ExpectType boolean[] +numeric.isNaNeq(threeDimensionalMatrix); // $ExpectType MultidimensionalArray + +numeric.isFinite(vector); // $ExpectType boolean[] +numeric.isFinite(threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.isFiniteV(vector); // $ExpectType boolean[] +numeric.isFiniteeqV(vector); // $ExpectType boolean[] +numeric.isFiniteeq(vector); // $ExpectType boolean[] +numeric.isFiniteeq(threeDimensionalMatrix); // $ExpectType MultidimensionalArray + +numeric.neg(matrix); // $ExpectType number[][] +numeric.negV(vector); // $ExpectType number[] +numeric.negeqV(vector); // $ExpectType number[] +numeric.negeq(matrix); // $ExpectType number[][] + +numeric.bnot(matrix); // $ExpectType number[][] +numeric.bnotV(vector); // $ExpectType number[] +numeric.bnoteqV(vector); // $ExpectType number[] +numeric.bnoteq(matrix); // $ExpectType number[][] + +numeric.not(2); // $ExpectType boolean +numeric.not(vector); // $ExpectType boolean[] +numeric.not(threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.notV(vector); // $ExpectType boolean[] +numeric.noteq(2); // $ExpectType boolean +numeric.noteq(vector); // $ExpectType boolean[] +numeric.noteq(threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.noteqV(vector); // $ExpectType boolean[] + +numeric.clone(vector); // $ExpectType number[] +numeric.cloneV(vector); // $ExpectType NonNullPrimitive[] +numeric.cloneeq(vector); // $ExpectType NonNullPrimitive[] +numeric.cloneeqV(vector); // $ExpectType NonNullPrimitive[] + +numeric.add(2, 5, 6); // $ExpectType number +numeric.add(2, 3, vector); // $ExpectType number[] +numeric.add(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["+"](2, 5, 6); // $ExpectType number +numeric["+"](2, 3, vector); // $ExpectType number[] +numeric["+"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.addVV(vector, vector); // $ExpectType number[] +numeric.addSV(2, vector); // $ExpectType number[] +numeric.addVS(vector, 2); // $ExpectType number[] +numeric.addeq(vector, 3); // $ExpectType number[] +numeric.addeqV(vector, vector); // $ExpectType number[] +numeric.addeqS(vector, 3); // $ExpectType number[] + +numeric.sub(2, 5, 6); // $ExpectType number +numeric.sub(2, 3, vector); // $ExpectType number[] +numeric.sub(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["-"](2, 5, 6); // $ExpectType number +numeric["-"](2, 3, vector); // $ExpectType number[] +numeric["-"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.subVV(vector, vector); // $ExpectType number[] +numeric.subSV(2, vector); // $ExpectType number[] +numeric.subVS(vector, 2); // $ExpectType number[] +numeric.subeq(vector, 3); // $ExpectType number[] +numeric.subeqV(vector, vector); // $ExpectType number[] +numeric.subeqS(vector, 3); // $ExpectType number[] + +numeric.mul(2, 5, 6); // $ExpectType number +numeric.mul(2, 3, vector); // $ExpectType number[] +numeric.mul(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["*"](2, 5, 6); // $ExpectType number +numeric["*"](2, 3, vector); // $ExpectType number[] +numeric["*"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.mulVV(vector, vector); // $ExpectType number[] +numeric.mulSV(2, vector); // $ExpectType number[] +numeric.mulVS(vector, 2); // $ExpectType number[] +numeric.muleq(vector, 3); // $ExpectType number[] +numeric.muleqV(vector, vector); // $ExpectType number[] +numeric.muleqS(vector, 3); // $ExpectType number[] + +numeric.div(2, 5, 6); // $ExpectType number +numeric.div(2, 3, vector); // $ExpectType number[] +numeric.div(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["/"](2, 5, 6); // $ExpectType number +numeric["/"](2, 3, vector); // $ExpectType number[] +numeric["/"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.divVV(vector, vector); // $ExpectType number[] +numeric.divSV(2, vector); // $ExpectType number[] +numeric.divVS(vector, 2); // $ExpectType number[] +numeric.diveq(vector, 3); // $ExpectType number[] +numeric.diveqV(vector, vector); // $ExpectType number[] +numeric.diveqS(vector, 3); // $ExpectType number[] + +numeric.mod(2, 5, 6); // $ExpectType number +numeric.mod(2, 3, vector); // $ExpectType number[] +numeric.mod(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["%"](2, 5, 6); // $ExpectType number +numeric["%"](2, 3, vector); // $ExpectType number[] +numeric["%"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.modVV(vector, vector); // $ExpectType number[] +numeric.modSV(2, vector); // $ExpectType number[] +numeric.modVS(vector, 2); // $ExpectType number[] +numeric.modeq(vector, 3); // $ExpectType number[] +numeric.modeqV(vector, vector); // $ExpectType number[] +numeric.modeqS(vector, 3); // $ExpectType number[] + +numeric.and(2, 5, 6); // $ExpectType number +numeric.and(2, 3, vector); // $ExpectType number[] +numeric.and(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["&&"](2, 5, 6); // $ExpectType number +numeric["&&"](2, 3, vector); // $ExpectType number[] +numeric["&&"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.andVV(vector, vector); // $ExpectType number[] +numeric.andSV(2, vector); // $ExpectType number[] +numeric.andVS(vector, 2); // $ExpectType number[] +numeric.andeq(vector, 3); // $ExpectType number[] +numeric.andeqV(vector, vector); // $ExpectType number[] +numeric.andeqS(vector, 3); // $ExpectType number[] + +numeric.or(2, 5, 6); // $ExpectType number +numeric.or(2, 3, vector); // $ExpectType number[] +numeric.or(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["||"](2, 5, 6); // $ExpectType number +numeric["||"](2, 3, vector); // $ExpectType number[] +numeric["||"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.orVV(vector, vector); // $ExpectType number[] +numeric.orSV(2, vector); // $ExpectType number[] +numeric.orVS(vector, 2); // $ExpectType number[] +numeric.oreq(vector, 3); // $ExpectType number[] +numeric.oreqV(vector, vector); // $ExpectType number[] +numeric.oreqS(vector, 3); // $ExpectType number[] + +numeric.eq(2, 5); // $ExpectType boolean +numeric.eq(2, vector); // $ExpectType boolean[] +numeric.eq(threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric["==="](2, 5); // $ExpectType boolean +numeric["==="](2, vector); // $ExpectType boolean[] +numeric["==="](threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.eqVV(vector, vector); // $ExpectType boolean[] +numeric.eqSV(2, vector); // $ExpectType boolean[] +numeric.eqVS(vector, 2); // $ExpectType boolean[] +numeric.eqeq(vector, 3); // $ExpectType boolean[] +numeric.eqeqV(vector, vector); // $ExpectType boolean[] +numeric.eqeqS(vector, 3); // $ExpectType boolean[] + +numeric.neq(2, 5); // $ExpectType boolean +numeric.neq(2, vector); // $ExpectType boolean[] +numeric.neq(threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric["==="](2, 5); // $ExpectType boolean +numeric["==="](2, vector); // $ExpectType boolean[] +numeric["==="](threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.neqVV(vector, vector); // $ExpectType boolean[] +numeric.neqSV(2, vector); // $ExpectType boolean[] +numeric.neqVS(vector, 2); // $ExpectType boolean[] +numeric.neqeq(vector, 3); // $ExpectType boolean[] +numeric.neqeqV(vector, vector); // $ExpectType boolean[] +numeric.neqeqS(vector, 3); // $ExpectType boolean[] + +numeric.lt(2, 5); // $ExpectType boolean +numeric.lt(2, vector); // $ExpectType boolean[] +numeric.lt(threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric["==="](2, 5); // $ExpectType boolean +numeric["==="](2, vector); // $ExpectType boolean[] +numeric["==="](threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.ltVV(vector, vector); // $ExpectType boolean[] +numeric.ltSV(2, vector); // $ExpectType boolean[] +numeric.ltVS(vector, 2); // $ExpectType boolean[] +numeric.lteq(vector, 3); // $ExpectType boolean[] +numeric.lteqV(vector, vector); // $ExpectType boolean[] +numeric.lteqS(vector, 3); // $ExpectType boolean[] + +numeric.gt(2, 5); // $ExpectType boolean +numeric.gt(2, vector); // $ExpectType boolean[] +numeric.gt(threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric["==="](2, 5); // $ExpectType boolean +numeric["==="](2, vector); // $ExpectType boolean[] +numeric["==="](threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.gtVV(vector, vector); // $ExpectType boolean[] +numeric.gtSV(2, vector); // $ExpectType boolean[] +numeric.gtVS(vector, 2); // $ExpectType boolean[] +numeric.gteq(vector, 3); // $ExpectType boolean[] +numeric.gteqV(vector, vector); // $ExpectType boolean[] +numeric.gteqS(vector, 3); // $ExpectType boolean[] + +numeric.leq(2, 5); // $ExpectType boolean +numeric.leq(2, vector); // $ExpectType boolean[] +numeric.leq(threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric["==="](2, 5); // $ExpectType boolean +numeric["==="](2, vector); // $ExpectType boolean[] +numeric["==="](threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.leqVV(vector, vector); // $ExpectType boolean[] +numeric.leqSV(2, vector); // $ExpectType boolean[] +numeric.leqVS(vector, 2); // $ExpectType boolean[] +numeric.leqeq(vector, 3); // $ExpectType boolean[] +numeric.leqeqV(vector, vector); // $ExpectType boolean[] +numeric.leqeqS(vector, 3); // $ExpectType boolean[] + +numeric.geq(2, 5); // $ExpectType boolean +numeric.geq(2, vector); // $ExpectType boolean[] +numeric.geq(threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric["==="](2, 5); // $ExpectType boolean +numeric["==="](2, vector); // $ExpectType boolean[] +numeric["==="](threeDimensionalMatrix, threeDimensionalMatrix); // $ExpectType MultidimensionalArray +numeric.geqVV(vector, vector); // $ExpectType boolean[] +numeric.geqSV(2, vector); // $ExpectType boolean[] +numeric.geqVS(vector, 2); // $ExpectType boolean[] +numeric.geqeq(vector, 3); // $ExpectType boolean[] +numeric.geqeqV(vector, vector); // $ExpectType boolean[] +numeric.geqeqS(vector, 3); // $ExpectType boolean[] + +numeric.band(2, 5, 6); // $ExpectType number +numeric.band(2, 3, vector); // $ExpectType number[] +numeric.band(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["&"](2, 5, 6); // $ExpectType number +numeric["&"](2, 3, vector); // $ExpectType number[] +numeric["&"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.bandVV(vector, vector); // $ExpectType number[] +numeric.bandSV(2, vector); // $ExpectType number[] +numeric.bandVS(vector, 2); // $ExpectType number[] +numeric.bandeq(vector, 3); // $ExpectType number[] +numeric.bandeqV(vector, vector); // $ExpectType number[] +numeric.bandeqS(vector, 3); // $ExpectType number[] + +numeric.bor(2, 5, 6); // $ExpectType number +numeric.bor(2, 3, vector); // $ExpectType number[] +numeric.bor(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["|"](2, 5, 6); // $ExpectType number +numeric["|"](2, 3, vector); // $ExpectType number[] +numeric["|"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.borVV(vector, vector); // $ExpectType number[] +numeric.borSV(2, vector); // $ExpectType number[] +numeric.borVS(vector, 2); // $ExpectType number[] +numeric.boreq(vector, 3); // $ExpectType number[] +numeric.boreqV(vector, vector); // $ExpectType number[] +numeric.boreqS(vector, 3); // $ExpectType number[] + +numeric.bxor(2, 5, 6); // $ExpectType number +numeric.bxor(2, 3, vector); // $ExpectType number[] +numeric.bxor(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["^"](2, 5, 6); // $ExpectType number +numeric["^"](2, 3, vector); // $ExpectType number[] +numeric["^"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.bxorVV(vector, vector); // $ExpectType number[] +numeric.bxorSV(2, vector); // $ExpectType number[] +numeric.bxorVS(vector, 2); // $ExpectType number[] +numeric.bxoreq(vector, 3); // $ExpectType number[] +numeric.bxoreqV(vector, vector); // $ExpectType number[] +numeric.bxoreqS(vector, 3); // $ExpectType number[] + +numeric.lshift(2, 5, 6); // $ExpectType number +numeric.lshift(2, 3, vector); // $ExpectType number[] +numeric.lshift(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric["<<"](2, 5, 6); // $ExpectType number +numeric["<<"](2, 3, vector); // $ExpectType number[] +numeric["<<"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.lshiftVV(vector, vector); // $ExpectType number[] +numeric.lshiftSV(2, vector); // $ExpectType number[] +numeric.lshiftVS(vector, 2); // $ExpectType number[] +numeric.lshifteq(vector, 3); // $ExpectType number[] +numeric.lshifteqV(vector, vector); // $ExpectType number[] +numeric.lshifteqS(vector, 3); // $ExpectType number[] + +numeric.rshift(2, 5, 6); // $ExpectType number +numeric.rshift(2, 3, vector); // $ExpectType number[] +numeric.rshift(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric[">>"](2, 5, 6); // $ExpectType number +numeric[">>"](2, 3, vector); // $ExpectType number[] +numeric[">>"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.rshiftVV(vector, vector); // $ExpectType number[] +numeric.rshiftSV(2, vector); // $ExpectType number[] +numeric.rshiftVS(vector, 2); // $ExpectType number[] +numeric.rshifteq(vector, 3); // $ExpectType number[] +numeric.rshifteqV(vector, vector); // $ExpectType number[] +numeric.rshifteqS(vector, 3); // $ExpectType number[] + +numeric.rrshift(2, 5, 6); // $ExpectType number +numeric.rrshift(2, 3, vector); // $ExpectType number[] +numeric.rrshift(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric[">>>"](2, 5, 6); // $ExpectType number +numeric[">>>"](2, 3, vector); // $ExpectType number[] +numeric[">>>"](threeDimensionalMatrix, 2, 4); // $ExpectType number[][][] +numeric.rrshiftVV(vector, vector); // $ExpectType number[] +numeric.rrshiftSV(2, vector); // $ExpectType number[] +numeric.rrshiftVS(vector, 2); // $ExpectType number[] +numeric.rrshifteq(vector, 3); // $ExpectType number[] +numeric.rrshifteqV(vector, vector); // $ExpectType number[] +numeric.rrshifteqS(vector, 3); // $ExpectType number[] + +numeric.atan2(2, 5, 6); // $ExpectType number +numeric.atan2(2, 3, vector); // $ExpectType number[] +numeric.atan2(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric.atan2VV(vector, vector); // $ExpectType number[] +numeric.atan2SV(2, vector); // $ExpectType number[] +numeric.atan2VS(vector, 2); // $ExpectType number[] +numeric.atan2eq(vector, 3); // $ExpectType number[] +numeric.atan2eqV(vector, vector); // $ExpectType number[] +numeric.atan2eqS(vector, 3); // $ExpectType number[] + +numeric.pow(2, 5, 6); // $ExpectType number +numeric.pow(2, 3, vector); // $ExpectType number[] +numeric.pow(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric.powVV(vector, vector); // $ExpectType number[] +numeric.powSV(2, vector); // $ExpectType number[] +numeric.powVS(vector, 2); // $ExpectType number[] +numeric.poweq(vector, 3); // $ExpectType number[] +numeric.poweqV(vector, vector); // $ExpectType number[] +numeric.poweqS(vector, 3); // $ExpectType number[] + +numeric.max(2, 5, 6); // $ExpectType number +numeric.max(2, 3, vector); // $ExpectType number[] +numeric.max(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric.maxVV(vector, vector); // $ExpectType number[] +numeric.maxSV(2, vector); // $ExpectType number[] +numeric.maxVS(vector, 2); // $ExpectType number[] +numeric.maxeq(vector, 3); // $ExpectType number[] +numeric.maxeqV(vector, vector); // $ExpectType number[] +numeric.maxeqS(vector, 3); // $ExpectType number[] + +numeric.min(2, 5, 6); // $ExpectType number +numeric.min(2, 3, vector); // $ExpectType number[] +numeric.min(threeDimensionalMatrix, 2, threeDimensionalMatrix); // $ExpectType number[][][] +numeric.minVV(vector, vector); // $ExpectType number[] +numeric.minSV(2, vector); // $ExpectType number[] +numeric.minVS(vector, 2); // $ExpectType number[] +numeric.mineq(vector, 3); // $ExpectType number[] +numeric.mineqV(vector, vector); // $ExpectType number[] +numeric.mineqS(vector, 3); // $ExpectType number[] + +numeric.any(23); // $ExpectType boolean +numeric.anyV(vector); // $ExpectType boolean + +numeric.all(23); // $ExpectType boolean +numeric.allV(vector); // $ExpectType boolean + +numeric.sum(threeDimensionalMatrix); // $ExpectType number +numeric.sumV(vector); // $ExceptType number + +numeric.prod(threeDimensionalMatrix); // $ExpectType number +numeric.prodV(vector); // $ExceptType number + +numeric.norm2Squared(threeDimensionalMatrix); // $ExpectType number +numeric.norm2SquaredV(vector); // $ExceptType number + +numeric.norminf(threeDimensionalMatrix); // $ExpectType number +numeric.norminfV(vector); // $ExceptType number + +numeric.norm1(threeDimensionalMatrix); // $ExpectType number +numeric.norm1V(vector); // $ExceptType number + +numeric.sup(threeDimensionalMatrix); // $ExpectType number +numeric.supV(vector); // $ExceptType number + +numeric.inf(threeDimensionalMatrix); // $ExpectType number +numeric.infV(vector); // $ExceptType number + +numeric.trunc(vector, 3); // $ExpectType number[] +numeric.truncVV(vector, vector); // $ExpectType number[] +numeric.truncVS(vector, 4); // $ExpectType number[] +numeric.truncSV(3, vector); // $ExpectType number[] + +numeric.inv(matrix); // $ExpectType number[][] +numeric.det(matrix); // $ExpectType number +numeric.transpose(matrix); // $ExpectType number[][] +numeric.negtranspose(matrix); // $ExpectType number[][] +numeric.random(vector); // $ExpectType NonScalar +numeric.norm2(threeDimensionalMatrix); // $ExpectType number +numeric.linspace(1, 3, 5); // $ExpectType number[] +numeric.getBlock(threeDimensionalMatrix, vector, vector); // $ExpectType number[][][] +const block: number[][][] = numeric.setBlock( + threeDimensionalMatrix, + vector, + vector, + threeDimensionalMatrix +); +numeric.blockMatrix(matrix); // $ExpectType number[][] +numeric.tensor(3, 5); // $ExpectType number +numeric.tensor(vector, vector); // $ExpectType number[][] + +const tensor = numeric.t(vector, vector); +tensor + .add(tensor) + .sub(tensor) + .mul(tensor) + .reciprocal() + .div(tensor) + .dot(tensor) + .transpose() + .transjugate() + .exp() + .conj() + .neg() + .sin() + .cos() + .abs() + .log() + .norm2() + .inv() + .get(vector) + .set(vector, tensor) + .getRow(2) + .setRow(2, tensor) + .getRows(10, 10) + .setRows(10, 10, tensor) + .getBlock(vector, vector) + .setBlock(vector, vector, tensor) + .rep(vector, tensor) + .diag(tensor) + .identity(3) + .getDiag() + .fft() + .ifft() + .eig(); + +numeric.house(vector); // $ExpectType number[] +numeric.toUpperHessenberg(matrix); // $ExpectType { H: number[][]; Q: number[][]; } +numeric.QRFrancis(matrix, 25); // $ExpectType { Q: number[][]; B: number[][]; } +numeric.eig(matrix); // $ExpectType { lambda: Tensor; E: Tensor; } + +numeric.ccsSparse(matrix); // $ExpectType [number[], number[], number[]] +numeric.ccsFull(sparseMatrix); // $ExpectType number[][] +numeric.ccsTSolve(sparseMatrix, vector, vector, vector, vector); // $ExpectType number[] +numeric.ccsDot(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +const lup = numeric.ccsLUP(sparseMatrix, 4); +numeric.ccsDim(sparseMatrix); // $ExpectType number[] +numeric.ccsGetBlock(sparseMatrix, vector, 3); // $ExpectType [number[], number[], number[]] +numeric.ccsLUPSolve(lup, sparseMatrix); // $ExpectType number[] +numeric.ccsScatter(sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsGather(sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsadd(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsadd(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsaddMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccssub(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccssub(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccssubMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsmul(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsmul(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsmulMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsdiv(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsdiv(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsdivMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsmod(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsmod(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsmodMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsand(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsand(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsandMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsor(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsor(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsorMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccseq(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccseq(2, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccseqMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] + +numeric.ccsneq(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsneq(2, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsneqMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] + +numeric.ccslt(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccslt(2, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsltMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] + +numeric.ccsgt(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsgt(2, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsgtMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] + +numeric.ccsleq(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsleq(2, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsleqMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] + +numeric.ccsgeq(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsgeq(2, sparseMatrix); // $ExpectType [number[], number[], boolean[]] +numeric.ccsgeqMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], boolean[]] + +numeric.ccsband(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsband(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsbandMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsbor(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsbor(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsborMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsbxor(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsbxor(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsbxorMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccslshift(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccslshift(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccslshiftMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsrshift(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsrshift(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsrshiftMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +numeric.ccsrrshift(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsrrshift(2, sparseMatrix); // $ExpectType [number[], number[], number[]] +numeric.ccsrrshiftMM(sparseMatrix, sparseMatrix); // $ExpectType [number[], number[], number[]] + +const lu = numeric.cLU(matrix); +numeric.cLUSolve(lu, vector); // $ExpectType number[] +numeric.cgrid(2, "L"); // $ExpectType number[][] +numeric.cdelsq(matrix); // $ExpectType number[][] +numeric.cdotmv(matrix, vector); // $ExpectType number[] + +const spline = numeric.spline(vector, matrix, "periodic", 3); +spline.diff().roots(); // $ExpectType number[] +spline.at(vector); // $ExpectType number | number[] + +numeric.uncmin((x: number[]) => 23, vector, 2, null, 3, () => undefined, { + Hinv: matrix +}); +numeric.gradient((x: number[]) => 44, vector); // $ExpectType number[] + +const dopri = numeric.dopri( + 1, + 1, + 1, + (x = 23, y = 44) => 44, + 2, + 3, + (x = 23, y = 44) => 44 +); +dopri.at(vector); // $ExpectType number[] | number[][] + +numeric.echelonize(matrix); // $ExpectType { I: number[][]; A: number[][]; P: number[]; } +numeric.solveLP(vector, matrix, vector, matrix, matrix, 3, 4); // $ExpectType { solution: number | number[]; message: string; iterations: number; } + +numeric.solveQP(matrix, vector, matrix, vector, 3, 44); // $ExpectType { solution: number[]; value: number[]; unconstrained_solution: number[]; iterations: number[]; iact: number[]; message: string; } + +numeric.svd(matrix); // $ExpectType { U: number[][]; S: number[]; V: number[][]; } diff --git a/types/numeric/tsconfig.json b/types/numeric/tsconfig.json new file mode 100644 index 0000000000..797af40d6b --- /dev/null +++ b/types/numeric/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "numeric-tests.ts" + ] +} diff --git a/types/numeric/tslint.json b/types/numeric/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/numeric/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/object-keys-mapping/index.d.ts b/types/object-keys-mapping/index.d.ts new file mode 100644 index 0000000000..f40ca48769 --- /dev/null +++ b/types/object-keys-mapping/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for object-keys-mapping 3.0 +// Project: https://github.com/coderhaoxin/object-keys-mapping#readme +// Definitions by: newraina +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export function trim(origin: object, ignore?: (v: any) => boolean): object; +export function trim(origin: ReadonlyArray, ignore?: (v: any) => boolean): object[]; + +export function toCamelcase(origin: object): object; +export function toCamelcase(origin: ReadonlyArray): object[]; + +export function reverseCamelcase(origin: object): object; +export function reverseCamelcase(origin: ReadonlyArray): object[]; + +export interface OperatorOptions { + camelcase?: boolean; + mapping?: object; +} + +export class Operator { + constructor(opts?: { camelcase?: boolean }); + + map(origin: object): object; + map(origin: ReadonlyArray): object[]; + + mapField(path: string): string; + + mapObject(origin: object, path: string): object; + + mapArray(origin: ReadonlyArray): object[]; +} diff --git a/types/object-keys-mapping/object-keys-mapping-tests.ts b/types/object-keys-mapping/object-keys-mapping-tests.ts new file mode 100644 index 0000000000..2235b1a48f --- /dev/null +++ b/types/object-keys-mapping/object-keys-mapping-tests.ts @@ -0,0 +1,11 @@ +import { trim, toCamelcase, reverseCamelcase, Operator } from 'object-keys-mapping'; + +trim({ name: '' }); + +toCamelcase({ will_be_camelcase: '' }); + +reverseCamelcase({ willBeUnderlined: '' }); + +const operator = new Operator({ camelcase: true }); + +operator.map({}); diff --git a/types/object-keys-mapping/tsconfig.json b/types/object-keys-mapping/tsconfig.json new file mode 100644 index 0000000000..398625df1d --- /dev/null +++ b/types/object-keys-mapping/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", + "object-keys-mapping-tests.ts" + ] +} diff --git a/types/object-keys-mapping/tslint.json b/types/object-keys-mapping/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/object-keys-mapping/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/parse5-html-rewriting-stream/index.d.ts b/types/parse5-html-rewriting-stream/index.d.ts new file mode 100644 index 0000000000..42e0ef9734 --- /dev/null +++ b/types/parse5-html-rewriting-stream/index.d.ts @@ -0,0 +1,80 @@ +// Type definitions for parse5-html-rewriting-stream 5.1 +// Project: https://github.com/inikulin/parse5/tree/master/packages/parse5-html-rewriting-stream +// Definitions by: Sam Li +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as parse5 from 'parse5-sax-parser'; +import * as stream from 'stream'; + +/** + * Streaming SAX-style HTML rewriter. A transform stream (which means you can + * pipe through it, see example). Rewriter uses raw source representation of + * tokens if they are not modified by the user, therefore resulting HTML is + * not affected by parser error-recovery mechanisms as in the classical + * parsing-serialization roundtrip. + */ +export default class RewritingStream extends stream.Transform { + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Raised when the rewriter encounters a start tag. + */ + on(type: 'startTag', + callback: (startTag: parse5.StartTagToken, rawHtml: string) => void): + this; + + /** + * Raised when rewriter encounters an end tag. + */ + on(type: 'endTag', + callback: (endTag: parse5.EndTagToken, rawHtml: string) => void): this; + + /** + * Raised when rewriter encounters a comment. + */ + on(type: 'comment', + callback: (comment: parse5.CommentToken, rawHtml: string) => void): this; + + /** + * Raised when rewriter encounters text content. + */ + on(type: 'text', + callback: (text: parse5.TextToken, rawHtml: string) => void): this; + + /** + * Raised when rewriter encounters a document type declaration. + */ + on(type: 'doctype', + callback: (doctype: parse5.DoctypeToken, rawHtml: string) => void): this; + + /** + * Emits serialized start tag token into the output stream. + */ + emitStartTag(startTag: parse5.StartTagToken): void; + + /** + * Emits serialized end tag token into the output stream. + */ + emitEndTag(endTag: parse5.EndTagToken): void; + + /** + * Emits serialized text token into the output stream. + */ + emitText(text: parse5.TextToken): void; + + /** + * Emits serialized comment token into the output stream. + */ + emitComment(text: parse5.CommentToken): void; + + /** + * Emits serialized document type token into the output stream. + */ + emitDoctype(text: parse5.DoctypeToken): void; + + /** + * Emits raw HTML string into the output stream. + */ + emitRaw(html: string): void; +} diff --git a/types/parse5-html-rewriting-stream/parse5-html-rewriting-stream-tests.ts b/types/parse5-html-rewriting-stream/parse5-html-rewriting-stream-tests.ts new file mode 100644 index 0000000000..f134e4807b --- /dev/null +++ b/types/parse5-html-rewriting-stream/parse5-html-rewriting-stream-tests.ts @@ -0,0 +1,10 @@ +import RewritingStream from 'parse5-html-rewriting-stream'; + +const rewritingStream = new RewritingStream(); +rewritingStream.on('startTag', (startTag, rawHtml) => { + startTag.tagName; // $ExpectType string + startTag.selfClosing; // $ExpectType boolean + rawHtml; // $ExpectType string + + rewritingStream.emitStartTag(startTag); // $ExpectType void +}); diff --git a/types/parse5-html-rewriting-stream/tsconfig.json b/types/parse5-html-rewriting-stream/tsconfig.json new file mode 100644 index 0000000000..604400ba20 --- /dev/null +++ b/types/parse5-html-rewriting-stream/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", + "parse5-html-rewriting-stream-tests.ts" + ] +} diff --git a/types/parse5-html-rewriting-stream/tslint.json b/types/parse5-html-rewriting-stream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/parse5-html-rewriting-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/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-currency-formatter/index.d.ts b/types/react-currency-formatter/index.d.ts new file mode 100644 index 0000000000..d0f8e217ad --- /dev/null +++ b/types/react-currency-formatter/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for react-currency-formatter 1.1 +// Project: https://github.com/xDae/react-currency-formatter; +// Definitions by: Yury Pastushenko +// Evgeniy Vasiliev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +interface CurrencyFormatterProps { + quantity: number; + currency?: string; + locale?: string; + pattern?: string; + decimal?: string; + group?: string; +} + +declare const reactCurrencyFormatter: React.ComponentClass; +export = reactCurrencyFormatter; diff --git a/types/react-currency-formatter/react-currency-formatter-tests.tsx b/types/react-currency-formatter/react-currency-formatter-tests.tsx new file mode 100644 index 0000000000..06cc4ec9a2 --- /dev/null +++ b/types/react-currency-formatter/react-currency-formatter-tests.tsx @@ -0,0 +1,13 @@ +import * as React from 'react'; +import * as CurrencyFormatter from 'react-currency-formatter'; + +interface Props { + price: number; + currency: string; +} + +const ProductionPrice: React.SFC = (props: Props) => ( + +); + +export default ProductionPrice; diff --git a/types/react-currency-formatter/tsconfig.json b/types/react-currency-formatter/tsconfig.json new file mode 100644 index 0000000000..2dee5017b3 --- /dev/null +++ b/types/react-currency-formatter/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-currency-formatter-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-currency-formatter/tslint.json b/types/react-currency-formatter/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-currency-formatter/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/react-global-configuration/index.d.ts b/types/react-global-configuration/index.d.ts new file mode 100644 index 0000000000..d2a4157720 --- /dev/null +++ b/types/react-global-configuration/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for react-global-configuration 1.3 +// Project: https://github.com/morenofa/react-global-configuration#readme +// Definitions by: Ryo Kikuchi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export interface Options { + freeze: boolean; + assign: boolean; +} + +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/react-global-configuration-tests.ts b/types/react-global-configuration/react-global-configuration-tests.ts new file mode 100644 index 0000000000..05cd15f95d --- /dev/null +++ b/types/react-global-configuration/react-global-configuration-tests.ts @@ -0,0 +1,25 @@ +import config from "react-global-configuration"; + +interface UserConfig { + a: number; + b: string; + c: { + ca: 123; + cb: 'ABC'; + }; +} + +config.set({ + a: 456, + b: "DEF", + c: { + ca: 123, + cb: 'ABC', + } +}); + +config.serialize(); + +const all = config.get(); // all: any +const a = config.get('a', 789); // a: number +const d = config.get('d'); // d: any diff --git a/types/react-global-configuration/tsconfig.json b/types/react-global-configuration/tsconfig.json new file mode 100644 index 0000000000..c75d7c7cce --- /dev/null +++ b/types/react-global-configuration/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true + }, + "files": [ + "index.d.ts", + "react-global-configuration-tests.ts" + ] +} diff --git a/types/react-global-configuration/tslint.json b/types/react-global-configuration/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-global-configuration/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-hammerjs/index.d.ts b/types/react-hammerjs/index.d.ts index e3bb4a826c..03f3f36f98 100644 --- a/types/react-hammerjs/index.d.ts +++ b/types/react-hammerjs/index.d.ts @@ -1,21 +1,30 @@ -// Type definitions for react-hammerjs 0.5 +// Type definitions for react-hammerjs 1.0 // Project: https://github.com/JedWatson/react-hammerjs#readme // Definitions by: Jason Unger +// Cecchi MacNaughton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import * as Hammer from 'hammerjs'; -import * as React from 'react'; +import * as Hammer from "hammerjs"; +import * as React from "react"; type Omit = Pick>; -type HammerOptionsWithRecognizers = Omit & { +type HammerOptionsWithRecognizers = Omit & { recognizers?: { [gesture: string]: RecognizerOptions }; }; declare namespace ReactHammer { interface ReactHammerProps { - direction?: number; + direction?: + | "DIRECTION_NONE" + | "DIRECTION_LEFT" + | "DIRECTION_RIGHT" + | "DIRECTION_UP" + | "DIRECTION_DOWN" + | "DIRECTION_HORIZONTAL" + | "DIRECTION_VERTICAL" + | "DIRECTION_ALL"; options?: HammerOptionsWithRecognizers; recognizeWith?: { [gesture: string]: Recognizer | string }; vertical?: boolean; diff --git a/types/react-hammerjs/v0/index.d.ts b/types/react-hammerjs/v0/index.d.ts new file mode 100644 index 0000000000..e3bb4a826c --- /dev/null +++ b/types/react-hammerjs/v0/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for react-hammerjs 0.5 +// Project: https://github.com/JedWatson/react-hammerjs#readme +// Definitions by: Jason Unger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as Hammer from 'hammerjs'; +import * as React from 'react'; + +type Omit = Pick>; + +type HammerOptionsWithRecognizers = Omit & { + recognizers?: { [gesture: string]: RecognizerOptions }; +}; + +declare namespace ReactHammer { + interface ReactHammerProps { + direction?: number; + options?: HammerOptionsWithRecognizers; + recognizeWith?: { [gesture: string]: Recognizer | string }; + vertical?: boolean; + action?: HammerListener; + onDoubleTap?: HammerListener; + onPan?: HammerListener; + onPanCancel?: HammerListener; + onPanEnd?: HammerListener; + onPanStart?: HammerListener; + onPinch?: HammerListener; + onPinchCancel?: HammerListener; + onPinchEnd?: HammerListener; + onPinchIn?: HammerListener; + onPinchStart?: HammerListener; + onPress?: HammerListener; + onPressUp?: HammerListener; + onRotate?: HammerListener; + onRotateCancel?: HammerListener; + onRotateEnd?: HammerListener; + onRotateMove?: HammerListener; + onRotateStart?: HammerListener; + onSwipe?: HammerListener; + onTap?: HammerListener; + } +} +declare const ReactHammer: React.ComponentClass; +export = ReactHammer; diff --git a/types/react-hammerjs/v0/react-hammerjs-tests.tsx b/types/react-hammerjs/v0/react-hammerjs-tests.tsx new file mode 100644 index 0000000000..7743cf3a4b --- /dev/null +++ b/types/react-hammerjs/v0/react-hammerjs-tests.tsx @@ -0,0 +1,17 @@ +import * as React from 'react'; +import Hammer from 'react-hammerjs'; + +class ReactHammer extends React.Component { + swipe: Hammer.ReactHammerProps['onSwipe'] = input => { + console.log(input.deltaX); + } + + render() { + const { children, ...props } = this.props; + return ( + + {children} + + ); + } +} diff --git a/types/react-hammerjs/v0/tsconfig.json b/types/react-hammerjs/v0/tsconfig.json new file mode 100644 index 0000000000..f8a95be3c6 --- /dev/null +++ b/types/react-hammerjs/v0/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": ["../../"], + "paths": { + "react-hammerjs": ["react-hammerjs/v0"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "esModuleInterop": true + }, + "files": ["index.d.ts", "react-hammerjs-tests.tsx"] +} diff --git a/types/react-hammerjs/v0/tslint.json b/types/react-hammerjs/v0/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-hammerjs/v0/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-lifecycle-component/index.d.ts b/types/react-lifecycle-component/index.d.ts new file mode 100644 index 0000000000..315d04f7fb --- /dev/null +++ b/types/react-lifecycle-component/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for react-lifecycle-component 2.0 +// Project: https://github.com/JamieDixon/react-lifecycle-component +// Definitions by: Alexander Fisher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentLifecycle, Component, ComponentClass } from 'react'; +import { Connect } from 'react-redux'; + +export interface LifecycleStateProps

{ + component: ComponentClass; +} + +export interface LifecycleDispatchProps

extends ComponentLifecycle {} + +export interface Props

extends LifecycleStateProps, LifecycleDispatchProps {} + +export class LifecycleComponent extends Component, any> {} + +export function applyLifecycle

( + component: ComponentClass, +): ComponentClass

>; + +export const connectWithLifecycle: Connect; diff --git a/types/react-lifecycle-component/package.json b/types/react-lifecycle-component/package.json new file mode 100644 index 0000000000..bb0e2b57d2 --- /dev/null +++ b/types/react-lifecycle-component/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "redux": "^4.0.0" + } +} \ No newline at end of file diff --git a/types/react-lifecycle-component/react-lifecycle-component-tests.tsx b/types/react-lifecycle-component/react-lifecycle-component-tests.tsx new file mode 100644 index 0000000000..6c4a7407d4 --- /dev/null +++ b/types/react-lifecycle-component/react-lifecycle-component-tests.tsx @@ -0,0 +1,98 @@ +import * as React from 'react'; +import { Dispatch } from 'redux'; +import { connect } from 'react-redux'; +import { + connectWithLifecycle, + LifecycleDispatchProps, + applyLifecycle, + LifecycleStateProps, + LifecycleComponent, +} from 'react-lifecycle-component'; + +interface State { + stateFoo: number; +} + +interface Props extends StateProps, DispatchProps { +} + +interface StateProps { + propsFoo: number; +} + +interface DispatchProps { + bar(): void; +} + +class ComponentFoo extends React.Component { + constructor(props: Props) { + super(props); + this.state = { + stateFoo: 0, + }; + } + render() { + return ( +

+
Props Foo: {this.props.propsFoo}
+
State Foo: {this.state.stateFoo}
+ +
+ ); + } +} + +type MapStateProps = StateProps & LifecycleStateProps; + +function mapStateToProps(): MapStateProps { + return { + component: ComponentFoo, + propsFoo: 8675309, + }; +} + +type MapDispatchProps = DispatchProps & LifecycleDispatchProps; + +function mapDispatchToProps(dispatch: Dispatch): MapDispatchProps { + return { + bar() { + dispatch({ type: 'Bar'}); + }, + componentWillMount() { + dispatch({ type: 'ComponentWillMount'}); + }, + componentDidMount() { + dispatch({ type: 'ComponentDidMount'}); + }, + componentWillUpdate(nextProps, nextState, nextContext) { + const fooIsEqual: boolean = nextProps.propsFoo === nextState.stateFoo; + const hasNextContext: boolean = !!nextContext; + dispatch({ type: 'ComponentWillUpdate'}); + }, + componentDidUpdate(nextProps, nextState, nextContext) { + const fooIsEqual: boolean = nextProps.propsFoo === nextState.stateFoo; + const hasNextContext: boolean = !!nextContext; + dispatch({ type: 'ComponentDidUpdate'}); + }, + componentWillReceiveProps(nextProps, nextContext) { + const fooIsGreaterThanZero: boolean = nextProps.propsFoo > 0; + const hasNextContext: boolean = !!nextContext; + dispatch({ type: 'ComponentWillReceiveProps'}); + }, + componentWillUnmount() { + dispatch({ type: 'ComponentWillUnmount'}); + }, + shouldComponentUpdate(nextProps, nextState, nextContext) { + const fooIsEqual: boolean = nextProps.propsFoo === nextState.stateFoo; + const hasNextContext: boolean = !!nextContext; + return !fooIsEqual; + }, + }; +} + +const connectWithLifecylceContainer = + connectWithLifecycle(mapStateToProps, mapDispatchToProps)(ComponentFoo); +const applyLifecycleContainer = + connect(mapStateToProps, mapDispatchToProps)(applyLifecycle(ComponentFoo)); +const lifecycleContainer = + connect(mapStateToProps, mapDispatchToProps)(LifecycleComponent); diff --git a/types/react-lifecycle-component/tsconfig.json b/types/react-lifecycle-component/tsconfig.json new file mode 100644 index 0000000000..d9aad16e53 --- /dev/null +++ b/types/react-lifecycle-component/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-lifecycle-component-tests.tsx" + ] +} diff --git a/types/react-lifecycle-component/tslint.json b/types/react-lifecycle-component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-lifecycle-component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index b52c4829f5..57a386ec14 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -600,7 +600,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 - +