From a6e137333db48fc3799208fac6620898439612cf Mon Sep 17 00:00:00 2001 From: Mick Lawitzke Date: Tue, 11 Sep 2018 00:59:05 +0200 Subject: [PATCH 01/74] Corrected interface for Recognizer (#28262) recognizeWith(), requireFailure(), dropRequireFailure(), dropRecognizeWith(): - Should not be declared twice - Should accept array of Recognizer, too --- types/hammerjs/index.d.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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; From 42032153394a5bf0b58c12a0a80ae9adfb9ac766 Mon Sep 17 00:00:00 2001 From: Cecchi MacNaughton Date: Mon, 10 Sep 2018 15:59:45 -0700 Subject: [PATCH 02/74] [react-hammerjs]: Update to v1.0 (#28508) --- types/react-hammerjs/index.d.ts | 19 +++++--- types/react-hammerjs/v0/index.d.ts | 45 +++++++++++++++++++ .../v0/react-hammerjs-tests.tsx | 17 +++++++ types/react-hammerjs/v0/tsconfig.json | 21 +++++++++ types/react-hammerjs/v0/tslint.json | 1 + 5 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 types/react-hammerjs/v0/index.d.ts create mode 100644 types/react-hammerjs/v0/react-hammerjs-tests.tsx create mode 100644 types/react-hammerjs/v0/tsconfig.json create mode 100644 types/react-hammerjs/v0/tslint.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" } From 83ab8585ca8ca5ab664f10f3644e2550c5a6cddb Mon Sep 17 00:00:00 2001 From: Dario Blanco Date: Tue, 11 Sep 2018 01:02:20 +0200 Subject: [PATCH 03/74] Add type definitions for twilio-video 2.0 (#28588) * Create basic twilio-video 2.0 types * Fix indentation in tests --- types/twilio-video/index.d.ts | 522 +++++++++++++++++++++++ types/twilio-video/tsconfig.json | 23 + types/twilio-video/tslint.json | 1 + types/twilio-video/twilio-video-tests.ts | 45 ++ 4 files changed, 591 insertions(+) create mode 100644 types/twilio-video/index.d.ts create mode 100644 types/twilio-video/tsconfig.json create mode 100644 types/twilio-video/tslint.json create mode 100644 types/twilio-video/twilio-video-tests.ts diff --git a/types/twilio-video/index.d.ts b/types/twilio-video/index.d.ts new file mode 100644 index 0000000000..cc65da2c2c --- /dev/null +++ b/types/twilio-video/index.d.ts @@ -0,0 +1,522 @@ +// Type definitions for twilio-video 2.0 +// Project: https://twilio.com/video +// Definitions by: MindDoc , Darío Blanco +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { EventEmitter } from 'events'; + +/** + * Classes + */ +export class AccessTokenExpiredError extends TwilioError { + code: 20104; + message: 'Access Token expired or expiration date invalid'; +} +export class AccessTokenGrantsInvalidError extends TwilioError { + code: 20106; + message: 'Invalid Access Token grants'; +} +export class AccessTokenHeaderInvalidError extends TwilioError { + code: 20102; + message: 'Invalid Access Token header'; +} +export class AccessTokenIssuerInvalidError extends TwilioError { + code: 20103; + message: 'Invalid Access Token issuer/subject'; +} +export class AccessTokenNotYetValidError extends TwilioError { + code: 20105; + message: 'Access Token not yet valid'; +} +export class AccessTokenSignatureInvalidError extends TwilioError { + code: 20107; + message: 'Invalid Access Token signature'; +} +export class AudioTrack extends Track { + isStarted: boolean; + isEnabled: boolean; + kind: 'audio'; + mediaStreamTrack: MediaStreamTrack; + + attach(element?: HTMLMediaElement | string): HTMLMediaElement; + detach(element?: HTMLMediaElement | string): HTMLMediaElement[]; +} +export class ConfigurationAcquireFailedError extends TwilioError { + code: 53500; + message: 'Unable to acquire configuration'; +} +export class ConfigurationAcquireTurnFailedError extends TwilioError { + code: 53501; + message: 'Unable to acquire TURN credentials'; +} +export class LocalAudioTrack extends AudioTrack { + constructor(mediaStreamTrack: MediaStreamTrack, options?: LocalTrackOptions); + + id: Track.ID; + isStopped: boolean; + + disable(): LocalAudioTrack; + enable(enabled?: boolean): LocalAudioTrack; + stop(): LocalAudioTrack; +} +export class LocalAudioTrackPublication extends LocalTrackPublication { + kind: 'audio'; + track: LocalAudioTrack; + + unpublish(): LocalAudioTrackPublication; +} +export class LocalAudioTrackStats extends LocalTrackStats { + audioLevel: AudioLevel | null; + jitter: number | null; +} +export class LocalDataTrack extends Track { + constructor(options?: LocalDataTrackOptions); + + id: Track.ID; + kind: 'data'; + maxPacketLifeTime: number | null; + maxRetransmits: number | null; + ordered: boolean; + reliable: boolean; + + send(data: string | Blob | ArrayBuffer | ArrayBufferView): void; +} +export class LocalDataTrackPublication extends LocalTrackPublication { + kind: 'data'; + track: LocalDataTrack; + + unpublish(): LocalDataTrackPublication; +} +export class LocalParticipant extends Participant { + audioTracks: Map; + dataTracks: Map; + tracks: Map; + videoTracks: Map; + + publishTrack(localTrack: LocalTrack): Promise; + publishTrack( + mediaStreamTrack: MediaStreamTrack, options?: LocalTrackOptions, + ): Promise; + publishTracks( + tracks: LocalTrack[] | MediaStreamTrack[], + ): Promise; + setParameters(encodingParameters?: EncodingParameters | null): LocalParticipant; +} +export class LocalTrackPublication extends TrackPublication { + isTrackEnabled: boolean; + kind: Track.Kind; + track: LocalTrack; + + unpublish(): LocalTrackPublication; +} +export class LocalTrackStats extends TrackStats { + bytesSent: number | null; + packetsSent: number | null; + roundTripTime: number | null; +} +export class LocalVideoTrack extends VideoTrack { + constructor(mediaStreamTrack: MediaStreamTrack, options?: LocalTrackOptions); + + id: Track.ID; + isStopped: boolean; + + disable(): LocalVideoTrack; + enable(enabled?: boolean): LocalVideoTrack; + stop(): LocalVideoTrack; +} +export class LocalVideoTrackPublication extends LocalTrackPublication { + kind: 'video'; + track: LocalVideoTrack; + + unpublish(): LocalVideoTrackPublication; +} +export class LocalVideoTrackStats extends LocalTrackStats { + captureDimensions: VideoTrack.Dimensions | null; + dimensions: VideoTrack.Dimensions | null; + captureFrameRate: number | null; + frameRate: number | null; +} +export class MediaClientLocalDescFailedError extends TwilioError { + code: 53400; + message: 'Client is unable to create or apply a local media description'; +} +export class MediaClientRemoteDescFailedError extends TwilioError { + code: 53402; + message: 'Client is unable to apply a remote media description'; +} +export class MediaConnectionError extends TwilioError { + code: 53405; + message: 'Media connection failed'; +} +export class MediaNoSupportedCodecError extends TwilioError { + code: 53404; + message: 'No supported codec'; +} +export class MediaServerLocalDescFailedError extends TwilioError { + code: 53401; + message: 'Server is unable to create or apply a local media description'; +} +export class MediaServerRemoteDescFailedError extends TwilioError { + code: 53403; + message: 'Server is unable to apply a remote media description'; +} +export namespace Participant { + type Identity = string; + type SID = string; +} +export class Participant extends EventEmitter { + audioTracks: Map; + dataTracks: Map; + identity: Participant.Identity; + networkQualityLEvel: NetworkQualityLevel | null; + sid: Participant.SID; + state: string; + tracks: Map; + videoTracks: Map; +} +export class ParticipantDuplicateIdentityError extends TwilioError { + code: 53205; + message: 'Participant disconnected because of duplicate identity'; +} +export class ParticipantIdentityCharsInvalidError extends TwilioError { + code: 53202; + message: 'Participant identity contains invalid characters'; +} +export class ParticipantIdentityInvalidError extends TwilioError { + code: 53200; + message: 'Participant identity is invalid'; +} +export class ParticipantIdentityTooLongError extends TwilioError { + code: 53201; + message: 'Participant identity is too long'; +} +export class ParticipantMaxTracksExceededError extends TwilioError { + code: 53203; + message: 'Participant has too many Tracks'; +} +export class ParticipantNotFoundError extends TwilioError { + code: 53204; + message: 'Participant not found'; +} +export class RemoteAudioTrack extends AudioTrack { + sid: Track.SID; +} +export class RemoteAudioTrackPublication extends RemoteTrackPublication { + kind: 'audio'; + track: RemoteAudioTrack | null; +} +export class RemoteAudioTrackStats extends RemoteTrackStats { + audioLevel: AudioLevel | null; + jitter: number | null; +} +export class RemoteDataTrack extends Track { + isEnabled: boolean; + isSubscribed: boolean; + kind: 'data'; + maxPacketLifeTime: number | null; + maxRetransmits: number | null; + ordered: boolean; + reliable: boolean; + sid: Track.SID; +} +export class RemoteDataTrackPublication extends RemoteTrackPublication { + kind: 'data'; + track: RemoteDataTrack | null; +} +export class RemoteParticipant extends Participant { + audioTracks: Map; + dataTracks: Map; + tracks: Map; + videoTracks: Map; +} +export class RemoteTrackPublication extends TrackPublication { + isSubscribed: boolean; + isTrackEnabled: boolean; + kind: Track.Kind; + track: RemoteTrack | null; +} +export class RemoteTrackStats { + bytesReceived: number | null; + packetsReceived: number | null; +} +export class RemoteVideoTrack extends VideoTrack { + sid: Track.SID; +} +export class RemoteVideoTrackPublication extends RemoteTrackPublication { + kind: 'video'; + track: RemoteVideoTrack | null; +} +export class RemoteVideoTrackStats extends RemoteTrackStats { + dimensions: VideoTrack.Dimensions | null; + frameRate: number | null; +} +export namespace Room { + type SID = string; +} +export class Room extends EventEmitter { + dominantSpeaker: RemoteParticipant | null; + isRecording: boolean; + localParticipant: LocalParticipant; + name: string; + participants: Map; + sid: Room.SID; + state: string; + + disconnect(): Room; + getStats(): Promise; +} +export class RoomCompletedError extends TwilioError { + code: 53118; + message: 'Room completed'; +} +export class RoomConnectFailedError extends TwilioError { + code: 53104; + message: 'Unable to connect to Room'; +} +export class RoomCreateFailedError extends TwilioError { + code: 53103; + message: 'Unable to create Room'; +} +export class RoomInvalidParametersError extends TwilioError { + code: 53114; + message: 'Room creation parameter(s) incompatible with the Room type'; +} +export class RoomMaxParticipantsExceededError extends TwilioError { + code: 53105; + message: 'Room contains too many Participants'; +} +export class RoomMaxParticipantsOutOfRangeError extends TwilioError { + code: 53107; + message: 'MaxParticipants is out of range'; +} +export class RoomMediaRegionInvalidError extends TwilioError { + code: 53115; + message: 'MediaRegion is invalid'; +} +export class RoomMediaRegionUnavailableError extends TwilioError { + code: 53116; + message: 'There are no media servers available in the MediaRegion'; +} +export class RoomNameCharsInvalidError extends TwilioError { + code: 53102; + message: 'Room name contains invalid characters'; +} +export class RoomNameInvalidError extends TwilioError { + code: 53100; + message: 'Room name is invalid'; +} +export class RoomNameTooLongError extends TwilioError { + code: 53101; + message: 'Room name is too long'; +} +export class RoomNotFoundError extends TwilioError { + code: 53106; + message: 'Room not found'; +} +export class RoomRoomExistsError extends TwilioError { + code: 53113; + message: 'Room exists'; +} +export class RoomStatusCallbackInvalidError extends TwilioError { + code: 53111; + message: 'StatusCallback is invalid'; +} +export class RoomStatusCallbackMethodInvalidError extends TwilioError { + code: 53110; + message: 'StatusCallbackMethod is invalid'; +} +export class RoomStatusInvalidError extends TwilioError { + code: 53112; + message: 'Status is invalid'; +} +export class RoomSubscriptionOperationNotSupportedError extends TwilioError { + code: 53117; + message: 'The subscription operation requested is not supported for the Room type'; +} +export class RoomTimeoutOutOfRangeError extends TwilioError { + code: 53109; + message: 'Timeout is out of range'; +} +export class RoomTypeInvalidError extends TwilioError { + code: 53108; + message: 'RoomType is not valid'; +} +export class SignalingConnectionDisconnectedError extends TwilioError { + code: 53001; + message: 'Signaling connection disconnected'; +} +export class SignalingConnectionError extends TwilioError { + code: 53000; + message: 'Signaling connection error'; +} +export class SignalingConnectionTimeoutError extends TwilioError { + code: 53002; + message: 'Signaling connection timed out'; +} +export class SignalingIncomingMessageInvalidError extends TwilioError { + code: 53003; + message: 'Client received an invalid signaling message'; +} +export class SignalingOutgoingMessageInvalidError extends TwilioError { + code: 53004; + message: 'Client sent an invalid signaling message'; +} +export class StatsReport { + peerConnectionId: string; + localAudioTrackStats: LocalAudioTrackStats[]; + localVideoTrackStats: LocalVideoTrackStats[]; + remoteAudioTrackStats: RemoteAudioTrackStats[]; + remoteVideoTrackStats: RemoteVideoTrackStats[]; +} +export namespace Track { + type Kind = 'audio' | 'video' | 'data'; + type ID = string; + type SID = string; +} +export class Track extends EventEmitter { + kind: Track.Kind; + name: string; +} +export class TrackInvalidError extends TwilioError { + code: 53300; + message: 'Track is invalid'; +} +export class TrackNameCharsInvalidError extends TwilioError { + code: 53303; + message: 'Track name contains invalid characters'; +} +export class TrackNameInvalidError extends TwilioError { + code: 53301; + message: 'Track name is invalid'; +} +export class TrackNameIsDuplicatedError extends TwilioError { + code: 53304; + message: 'Track name is duplicated'; +} +export class TrackNameTooLongError extends TwilioError { + code: 53302; + message: 'Track name is too long'; +} +export class TrackPublication { + trackName: string; + trackSid: Track.SID; +} +export class TrackServerTrackCapacityReachedError extends TwilioError { + code: 53305; + message: 'The server has reached capacity and cannot fulfill this request.'; +} +export class TrackStats { + trackId: Track.ID; + trackSid: Track.SID; + timestamp: number; + ssrc: string; + packetsLost: number | null; + codec: string | null; +} +export class TwilioError extends Error { + code: number; + toString(): string; +} +export namespace VideoTrack { + interface Dimensions { + width: number | null; + height: number | null; + } +} +export class VideoTrack extends Track { + isStarted: boolean; + isEnabled: boolean; + dimensions: VideoTrack.Dimensions; + kind: 'video'; + mediaStreamTrack: MediaStreamTrack; + + attach(element?: HTMLMediaElement | string): HTMLVideoElement; + detach(element?: HTMLMediaElement | string): HTMLMediaElement[]; +} + +/** + * Global (https://media.twiliocdn.com/sdk/js/video/releases/2.0.0-beta1/docs/global.html) + */ +export const version: string; + +/** Members */ +export type AudioCodec = 'isac' | 'opus' | 'PCMA' | 'PCMU'; +export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off'; +export type VideoCodec = 'H264' | 'VP8' | 'VP9'; + +/** Methods */ +export function connect(token: string, options?: ConnectOptions): Promise; +export function createLocalAudioTrack(options?: CreateLocalTrackOptions): Promise; +export function createLocalTracks(options?: CreateLocalTracksOptions): Promise; +export function createLocalVideoTrack(options?: CreateLocalTrackOptions): Promise; +export function isSupported(): boolean; +export function rewriteLocalTrackIds(room: Room, trackStats: LocalTrackStats[]): LocalTrackStats[]; + +/** Type Definitions */ +export type AudioLevel = number; +export type AudioTrackPublication = LocalAudioTrackPublication | RemoteAudioTrackPublication; +export interface ConnectOptions { + abortOnIceServersTimeout?: boolean; + audio?: boolean | CreateLocalTrackOptions; + iceServers?: RTCIceServer[]; + iceServersTimeout?: number; + iceTransportPolicy?: RTCIceTransportPolicy; + insights?: boolean; + maxAudioBitRate?: number | null; + maxVideoBitRate?: number | null; + name?: string | null; + preferredAudioCodecs?: AudioCodec[]; + preferredVideoCodecs?: VideoCodec[] | VideoCodecSettings[]; + logLevel?: LogLevel | LogLevels; + tracks?: LocalTrack[] | MediaStreamTrack[]; + video?: boolean | CreateLocalTrackOptions; +} +export interface CreateLocalTrackOptions { + logLevel: LogLevel | LogLevels; + name?: string; + workaroundWebKitBug180748?: boolean; // Lol +} +export interface CreateLocalTracksOptions { + audio?: boolean | CreateLocalTrackOptions; + logLevel?: LogLevel | LogLevels; + video?: boolean | CreateLocalTrackOptions; +} +export type DataTrack = LocalDataTrack | RemoteDataTrack; +export type DataTrackPublication = LocalDataTrackPublication | RemoteDataTrackPublication; +export interface EncodingParameters { + maxAudioBitrate?: number | null; + maxVideoBitrate?: number | null; +} +export interface LocalDataTrackOptions { + maxPacketLifeTime?: number | null; + maxRetransmits?: number | null; + ordered?: boolean; +} +export type LocalTrack = LocalAudioTrack | LocalVideoTrack | LocalDataTrack; +export interface LocalTrackOptions { + logLevel: LogLevel | LogLevels; + name?: string; +} +export interface LogLevels { + default: LogLevel; + media: LogLevel; + signaling: LogLevel; + webrtc: LogLevel; +} +export type NetworkQualityLevel = number; +export type RemoteTrack = RemoteAudioTrack | RemoteVideoTrack | RemoteDataTrack; +export interface RemoteTrackPublicationOptions { + logLevel: LogLevel | LogLevels; +} +export interface TrackPublicationOptions { + logLevel: LogLevel | LogLevels; +} +export interface VideoCodecSettings { + codec: VideoCodec; +} +export type VideoTrackPublication = LocalVideoTrackPublication | RemoteVideoTrackPublication; +export interface VP8CodecSettings { + name: VideoCodec; + simulcast?: boolean; +} diff --git a/types/twilio-video/tsconfig.json b/types/twilio-video/tsconfig.json new file mode 100644 index 0000000000..763a8aad1b --- /dev/null +++ b/types/twilio-video/tsconfig.json @@ -0,0 +1,23 @@ +{ + "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", + "twilio-video-tests.ts" + ] +} diff --git a/types/twilio-video/tslint.json b/types/twilio-video/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/twilio-video/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/twilio-video/twilio-video-tests.ts b/types/twilio-video/twilio-video-tests.ts new file mode 100644 index 0000000000..b5cfe43e01 --- /dev/null +++ b/types/twilio-video/twilio-video-tests.ts @@ -0,0 +1,45 @@ +import * as Video from 'twilio-video'; + +// Examples taken from https://twilio.github.io/twilio-video/ (v2.x) + +Video.connect('$TOKEN', { name: 'room-name' }).then(room => { + room.participants.forEach(participantConnected); + room.on('participantConnected', participantConnected); + room.on('participantDisconnected', participantDisconnected); + room.once('disconnected', error => room.participants.forEach(participantDisconnected)); +}); + +function participantConnected(participant: Video.Participant) { + participant.on('trackSubscribed', trackSubscribed); + participant.on('trackUnsubscribed', trackUnsubscribed); + + participant.tracks.forEach(publication => { + const remotePublication = publication as Video.RemoteTrackPublication; + if (remotePublication.isSubscribed) { + trackSubscribed(remotePublication.track as Video.VideoTrack | Video.AudioTrack); + } + }); +} + +function participantDisconnected(participant: Video.Participant) { + participant.tracks.forEach((publication) => { + const remotePublication = publication as Video.RemoteTrackPublication; + if (remotePublication.isSubscribed) { + const { track } = remotePublication; + if (track) trackUnsubscribed(track as Video.AudioTrack | Video.VideoTrack); + } + }); +} + +function trackSubscribed(track: Video.VideoTrack | Video.AudioTrack) { + const media = track.attach(); + insertDomElement(media); +} + +function trackUnsubscribed(track: Video.VideoTrack | Video.AudioTrack) { + track.detach().forEach(element => element.remove()); +} + +function insertDomElement(element: any) { + // Do something with the dom element +} From 9dc89875c4ac60f3013294ab04c6da71f431877d Mon Sep 17 00:00:00 2001 From: maple Date: Tue, 11 Sep 2018 07:04:04 +0800 Subject: [PATCH 04/74] Create Type Definitions for google-translate-api (#28589) * Create Type Definitions for google-translate-api * Add semicolons to google-translate-api --- .../google-translate-api-tests.ts | 3 +++ types/google-translate-api/index.d.ts | 27 +++++++++++++++++++ types/google-translate-api/tsconfig.json | 16 +++++++++++ types/google-translate-api/tslint.json | 6 +++++ 4 files changed, 52 insertions(+) create mode 100644 types/google-translate-api/google-translate-api-tests.ts create mode 100644 types/google-translate-api/index.d.ts create mode 100644 types/google-translate-api/tsconfig.json create mode 100644 types/google-translate-api/tslint.json 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 + } +} From 64eaf72fec97afd4c43007d812738a39c399f641 Mon Sep 17 00:00:00 2001 From: pastushenkoy Date: Tue, 11 Sep 2018 02:05:59 +0300 Subject: [PATCH 05/74] Type definitions for "react-currency-formatter" (#28623) * Type definitions for react-currency-formatter added. * Format change according to linter * Added author. --- types/react-currency-formatter/index.d.ts | 20 +++++++++++++++ .../react-currency-formatter-tests.tsx | 13 ++++++++++ types/react-currency-formatter/tsconfig.json | 25 +++++++++++++++++++ types/react-currency-formatter/tslint.json | 3 +++ 4 files changed, 61 insertions(+) create mode 100644 types/react-currency-formatter/index.d.ts create mode 100644 types/react-currency-formatter/react-currency-formatter-tests.tsx create mode 100644 types/react-currency-formatter/tsconfig.json create mode 100644 types/react-currency-formatter/tslint.json 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" +} From a60fadd78209c2d901143796c527552410d6a837 Mon Sep 17 00:00:00 2001 From: eduhenke Date: Mon, 10 Sep 2018 20:10:14 -0300 Subject: [PATCH 06/74] Add typings to bip32 (#28607) --- types/bip32/bip32-tests.ts | 9 +++++ types/bip32/index.d.ts | 67 ++++++++++++++++++++++++++++++++++++++ types/bip32/tsconfig.json | 23 +++++++++++++ types/bip32/tslint.json | 1 + 4 files changed, 100 insertions(+) create mode 100644 types/bip32/bip32-tests.ts create mode 100644 types/bip32/index.d.ts create mode 100644 types/bip32/tsconfig.json create mode 100644 types/bip32/tslint.json 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" } From 2b9558d869801e3af89fa9b9490c93e2fce2750e Mon Sep 17 00:00:00 2001 From: Boye Borg Date: Tue, 11 Sep 2018 01:10:37 +0200 Subject: [PATCH 07/74] Type definitions for "typography.js" (#28625) * autogenerate files * add strictFunctionTypes * create type definitions for typography.js * add type tests * use pascal case instead of camel case --- types/typography/index.d.ts | 60 ++++++++++++++++++++++++++++ types/typography/tsconfig.json | 23 +++++++++++ types/typography/tslint.json | 1 + types/typography/typography-tests.ts | 12 ++++++ 4 files changed, 96 insertions(+) create mode 100644 types/typography/index.d.ts create mode 100644 types/typography/tsconfig.json create mode 100644 types/typography/tslint.json create mode 100644 types/typography/typography-tests.ts diff --git a/types/typography/index.d.ts b/types/typography/index.d.ts new file mode 100644 index 0000000000..2c5be43583 --- /dev/null +++ b/types/typography/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for typography 0.16 +// Project: https://github.com/KyleAMathews/typography.js +// Definitions by: Boye +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface BaseLine { + fontSize: string; + lineHeight: string; +} + +export interface VerticalRhythm { + rhythm: (value: number) => string; + scale: (value: number) => object; + adjustFontSizeTo: (value?: number | string) => object; + linesForFontSize: (fontSize: number) => number; + establishBaseline: () => BaseLine; +} + +export interface GoogleFont { + name: string; + styles: string[]; +} + +export interface TypographyOptions { + baseFontSize?: string; + baseLineHeight?: number; + scaleRatio?: number; + googleFonts?: GoogleFont[]; + headerFontFamily?: string[]; + bodyFontFamily?: string[]; + headerColor?: string; + bodyColor?: string; + headerWeight?: number | string; + bodyWeight?: number | string; + boldWeight?: number | string; + blockMarginBottom?: number; + includeNormalize?: boolean; + overrideStyles?: ( + VerticalRhythm: VerticalRhythm, + options: TypographyOptions, + styles: any + ) => object; + overrideThemeStyles?: ( + VerticalRhythm: VerticalRhythm, + options: TypographyOptions, + styles: any + ) => object; + plugins?: any[]; +} + +declare class Typography { + constructor(opts: TypographyOptions); + options: TypographyOptions; + createStyles(): string; + toJSON(): object; + injectStyles(): void; +} + +export default Typography; diff --git a/types/typography/tsconfig.json b/types/typography/tsconfig.json new file mode 100644 index 0000000000..cebfdd1e2b --- /dev/null +++ b/types/typography/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", + "typography-tests.ts" + ] +} diff --git a/types/typography/tslint.json b/types/typography/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/typography/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/typography/typography-tests.ts b/types/typography/typography-tests.ts new file mode 100644 index 0000000000..5b004d2eae --- /dev/null +++ b/types/typography/typography-tests.ts @@ -0,0 +1,12 @@ +import Typography from 'typography'; + +const typography = new Typography({ + baseFontSize: '18px', + baseLineHeight: 1.45, + headerFontFamily: ['Avenir Next', 'Helvetica Neue', 'Segoe UI', 'Helvetica', 'Arial', 'sans-serif'], + bodyFontFamily: ['Georgia', 'serif'] +}); + +typography.createStyles(); // $ExpectType string +typography.toJSON(); // $ExpectType object +typography.options; // $ExpectType TypographyOptions From 8c4d56142744e4a83998b82c90de7cdb9831f06f Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Tue, 11 Sep 2018 01:38:11 +0200 Subject: [PATCH 08/74] Add types for jest-plugin-set (#28712) --- types/jest-plugin-set/index.d.ts | 6 +++++ .../jest-plugin-set/jest-plugin-set-tests.ts | 1 + types/jest-plugin-set/tsconfig.json | 24 +++++++++++++++++++ types/jest-plugin-set/tslint.json | 3 +++ 4 files changed, 34 insertions(+) create mode 100644 types/jest-plugin-set/index.d.ts create mode 100644 types/jest-plugin-set/jest-plugin-set-tests.ts create mode 100644 types/jest-plugin-set/tsconfig.json create mode 100644 types/jest-plugin-set/tslint.json 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/types/jest-plugin-set/tslint.json b/types/jest-plugin-set/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/jest-plugin-set/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From cbe40f534ccd5bd9708984274626b30ce5eee316 Mon Sep 17 00:00:00 2001 From: Gordey Doronin Date: Tue, 11 Sep 2018 06:40:42 +0700 Subject: [PATCH 09/74] Add typings for [node-resque] library. (#28678) --- types/node-resque/index.d.ts | 133 +++++++++++++++++++++++++ types/node-resque/node-resque-tests.ts | 72 +++++++++++++ types/node-resque/tsconfig.json | 23 +++++ types/node-resque/tslint.json | 3 + 4 files changed, 231 insertions(+) create mode 100644 types/node-resque/index.d.ts create mode 100644 types/node-resque/node-resque-tests.ts create mode 100644 types/node-resque/tsconfig.json create mode 100644 types/node-resque/tslint.json diff --git a/types/node-resque/index.d.ts b/types/node-resque/index.d.ts new file mode 100644 index 0000000000..208c2d29a3 --- /dev/null +++ b/types/node-resque/index.d.ts @@ -0,0 +1,133 @@ +// Type definitions for node-resque 5.4 +// Project: http://github.com/taskrabbit/node-resque +// Definitions by: Gordey Doronin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; + +export interface ConnectionOptions { + pkg?: string; + host?: string; + port?: number; + database?: number; + namespace?: string; + looping?: boolean; + options?: any; +} + +export class Connection extends 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 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 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 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" +} From ab3385dc529bde35c8af6ae726c3ef7743dcbecd Mon Sep 17 00:00:00 2001 From: Mike North Date: Mon, 10 Sep 2018 16:42:16 -0700 Subject: [PATCH 10/74] [@types/ember__utils] refactor types out of @types/ember, more tests (#28680) * [@types/ember__utils] refactor types out of @types/ember, add additional tests * fix: enforce strict function types --- types/ember__utils/ember__utils-tests.ts | 163 +++++++++++++++++++++++ types/ember__utils/index.d.ts | 16 +++ types/ember__utils/tsconfig.json | 28 ++++ types/ember__utils/tslint.json | 30 +++++ 4 files changed, 237 insertions(+) create mode 100644 types/ember__utils/ember__utils-tests.ts create mode 100644 types/ember__utils/index.d.ts create mode 100644 types/ember__utils/tsconfig.json create mode 100644 types/ember__utils/tslint.json diff --git a/types/ember__utils/ember__utils-tests.ts b/types/ember__utils/ember__utils-tests.ts new file mode 100644 index 0000000000..d93e2a1ec7 --- /dev/null +++ b/types/ember__utils/ember__utils-tests.ts @@ -0,0 +1,163 @@ +import { + compare, + isBlank, + isEmpty, + isEqual, + isNone, + isPresent, + tryInvoke, + typeOf +} from '@ember/utils'; + +(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 +})(); 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 + } +} From 3aa09e4e523bc7f4ed729245c649a4011243cbee Mon Sep 17 00:00:00 2001 From: Art Date: Tue, 11 Sep 2018 00:45:09 +0100 Subject: [PATCH 11/74] Add gulp-sequence types (#28673) * Add gulp-sequence types * Reordered definitions Auto-generated definitions now appear at the bottom --- types/gulp-sequence/gulp-sequence-tests.ts | 70 ++++ types/gulp-sequence/index.d.ts | 391 +++++++++++++++++++++ types/gulp-sequence/tsconfig.json | 23 ++ types/gulp-sequence/tslint.json | 1 + 4 files changed, 485 insertions(+) create mode 100644 types/gulp-sequence/gulp-sequence-tests.ts create mode 100644 types/gulp-sequence/index.d.ts create mode 100644 types/gulp-sequence/tsconfig.json create mode 100644 types/gulp-sequence/tslint.json 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" } From a7a32c674021f615c253c31d79c83d635133434d Mon Sep 17 00:00:00 2001 From: Sam Li Date: Mon, 10 Sep 2018 16:48:29 -0700 Subject: [PATCH 12/74] Add typings for parse5-html-rewriting-stream (#28660) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If adding a new definition: - [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. --- types/parse5-html-rewriting-stream/index.d.ts | 80 +++++++++++++++++++ .../parse5-html-rewriting-stream-tests.ts | 10 +++ .../tsconfig.json | 23 ++++++ .../parse5-html-rewriting-stream/tslint.json | 1 + 4 files changed, 114 insertions(+) create mode 100644 types/parse5-html-rewriting-stream/index.d.ts create mode 100644 types/parse5-html-rewriting-stream/parse5-html-rewriting-stream-tests.ts create mode 100644 types/parse5-html-rewriting-stream/tsconfig.json create mode 100644 types/parse5-html-rewriting-stream/tslint.json 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" } From 7a6975097c0144b4df3a93fc4d8719791ae23460 Mon Sep 17 00:00:00 2001 From: newraina Date: Tue, 11 Sep 2018 07:49:00 +0800 Subject: [PATCH 13/74] add object-keys-mapping (#28664) --- types/object-keys-mapping/index.d.ts | 32 +++++++++++++++++++ .../object-keys-mapping-tests.ts | 11 +++++++ types/object-keys-mapping/tsconfig.json | 23 +++++++++++++ types/object-keys-mapping/tslint.json | 1 + 4 files changed, 67 insertions(+) create mode 100644 types/object-keys-mapping/index.d.ts create mode 100644 types/object-keys-mapping/object-keys-mapping-tests.ts create mode 100644 types/object-keys-mapping/tsconfig.json create mode 100644 types/object-keys-mapping/tslint.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" } From b443752450e73432b20b5736ef2f89f064540609 Mon Sep 17 00:00:00 2001 From: S McDowall Date: Mon, 10 Sep 2018 19:49:41 -0400 Subject: [PATCH 14/74] Add types for koa-requestid (#28676) Simple interface for the koa-requestid Middleware. Please fill in this template. - [x ] Use a meaningful title for the pull request. Include the name of the package modified. - [x ] Test the change in your own code. (Compile and run.) - [x ] Add or edit tests to reflect the change. (Run with `npm test`.) - [x ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [ x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If adding a new definition: - [x ] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [ x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. --- types/koa-requestid/index.d.ts | 15 ++++++++++++++ types/koa-requestid/koa-requestid-tests.ts | 10 ++++++++++ types/koa-requestid/tsconfig.json | 23 ++++++++++++++++++++++ types/koa-requestid/tslint.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/koa-requestid/index.d.ts create mode 100644 types/koa-requestid/koa-requestid-tests.ts create mode 100644 types/koa-requestid/tsconfig.json create mode 100644 types/koa-requestid/tslint.json 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" } From c58c60d89797e949a697d8b574cfde70c4002ec7 Mon Sep 17 00:00:00 2001 From: bfrengley <37278140+bfrengley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:52:06 +1200 Subject: [PATCH 15/74] [@types/when] Restore parameterless when.resolve() and allow (#28593) parameterless when() --- types/when/index.d.ts | 2 ++ types/when/when-tests.ts | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/types/when/index.d.ts b/types/when/index.d.ts index 117c929cbe..b1f76056b8 100644 --- a/types/when/index.d.ts +++ b/types/when/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Derek Cicerone , Wim Looman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare function When(): When.Promise; declare function When(promiseOrValue: T | When.Promise | When.Thenable): When.Promise; declare function When(promiseOrValue: T | When.Promise | When.Thenable, transform: (val: T) => U): When.Promise; @@ -231,6 +232,7 @@ declare namespace When { * - fulfilled with promiseOrValue's value after it is fulfilled * - rejected with promiseOrValue's reason after it is rejected */ + function resolve(): Promise; function resolve(promiseOrValue: T | Promise | Thenable): Promise; interface Deferred { diff --git a/types/when/when-tests.ts b/types/when/when-tests.ts index 416758aadb..0b5ceff183 100644 --- a/types/when/when-tests.ts +++ b/types/when/when-tests.ts @@ -32,6 +32,7 @@ class Data implements IData { var promise: when.Promise; var promise2: when.Promise; +var emptyPromise: when.Promise; var foreign = new ForeignPromise(1); var promiseOrValue = 1 as number | when.Promise; var error = new Error("boom!"); @@ -42,6 +43,10 @@ var native: Promise; * Core * * * * * * * */ +/* when() */ + +emptyPromise = when(); + /* when(x) */ promise = when(1); @@ -202,6 +207,10 @@ when.unfold(function (x) { promise = when.promise(resolve => resolve(5)); promise = when.promise((resolve, reject) => reject(error)); +/* when.resolve() */ + +emptyPromise = when.resolve(); + /* when.resolve(x) */ promise = when.resolve(1); From e4e063b8bd2242643550cdb256e4b43196750dbc Mon Sep 17 00:00:00 2001 From: ly-cultureiq <40173025+ly-cultureiq@users.noreply.github.com> Date: Mon, 10 Sep 2018 19:59:11 -0400 Subject: [PATCH 16/74] d3.cloud.layout -> d3-cloud (#28650) --- .../d3.cloud.layout-tests.ts => d3-cloud/d3-cloud-tests.ts} | 0 types/{d3.cloud.layout => d3-cloud}/index.d.ts | 0 types/{d3.cloud.layout => d3-cloud}/tsconfig.json | 2 +- types/{d3.cloud.layout => d3-cloud}/tslint.json | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename types/{d3.cloud.layout/d3.cloud.layout-tests.ts => d3-cloud/d3-cloud-tests.ts} (100%) rename types/{d3.cloud.layout => d3-cloud}/index.d.ts (100%) rename types/{d3.cloud.layout => d3-cloud}/tsconfig.json (94%) rename types/{d3.cloud.layout => d3-cloud}/tslint.json (100%) 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 From 7f376606df1905ef486cfd6f252e41bfb969dcf1 Mon Sep 17 00:00:00 2001 From: Henri Normak Date: Tue, 11 Sep 2018 03:03:32 +0300 Subject: [PATCH 17/74] feat: add definitions for react-sparklines (#28640) --- types/react-sparklines/index.d.ts | 77 +++++++++++++++++++ .../react-sparklines-tests.tsx | 39 ++++++++++ types/react-sparklines/tsconfig.json | 24 ++++++ types/react-sparklines/tslint.json | 1 + 4 files changed, 141 insertions(+) create mode 100644 types/react-sparklines/index.d.ts create mode 100644 types/react-sparklines/react-sparklines-tests.tsx create mode 100644 types/react-sparklines/tsconfig.json create mode 100644 types/react-sparklines/tslint.json diff --git a/types/react-sparklines/index.d.ts b/types/react-sparklines/index.d.ts new file mode 100644 index 0000000000..bcc322eb90 --- /dev/null +++ b/types/react-sparklines/index.d.ts @@ -0,0 +1,77 @@ +// Type definitions for react-sparklines 1.7 +// Project: https://github.com/borisyankov/react-sparklines#readme +// Definitions by: Henri Normak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export interface Point { + x: number; + y: number; +} + +export interface SparklinesProps { + data?: number[]; + limit?: number; + width?: number; + height?: number; + svgWidth?: React.SVGAttributes['width']; + svgHeight?: React.SVGAttributes['height']; + preserveAspectRatio?: React.SVGAttributes['preserveAspectRatio']; + margin?: number; + min?: number; + max?: number; + style?: React.SVGAttributes['style']; +} +export class Sparklines extends React.PureComponent {} + +export interface SparklinesBarsProps { + points?: Point[]; + height?: number; + style?: React.SVGAttributes['style']; + barWidth?: number; + margin?: number; + onMouseMove?: (p: Point, event: React.MouseEvent) => void; +} +export class SparklinesBars extends React.Component {} + +export interface SparklinesCurveProps { + color?: React.SVGAttributes['color']; + style?: React.SVGAttributes['style']; +} +export class SparklinesCurve extends React.Component {} + +export interface SparklinesLineProps { + color?: React.SVGAttributes['color']; + style?: React.SVGAttributes['style']; + onMouseMove?: (event: 'enter' | 'click', value: number, point: Point) => void; +} +export class SparklinesLine extends React.Component {} + +export interface SparklinesNormalBandProps { + style?: React.SVGAttributes['style']; +} +export class SparklinesNormalBand extends React.Component {} + +export interface SparklinesReferenceLineProps { + type?: 'max' | 'min' | 'mean' | 'avg' | 'median' | 'custom'; + value?: number; + style?: React.SVGAttributes['style']; +} +export class SparklinesReferenceLine extends React.Component {} + +export interface SparklinesSpotsProps { + size?: number; + style?: React.SVGAttributes['style']; + spotColors?: { [change: string]: string }; +} +export class SparklinesSpots extends React.Component {} + +export interface SparklinesTextProps { + text?: string; + point?: Point; + fontSize?: number; + fontFamily?: string; +} +export class SparklinesText extends React.Component {} diff --git a/types/react-sparklines/react-sparklines-tests.tsx b/types/react-sparklines/react-sparklines-tests.tsx new file mode 100644 index 0000000000..4069cd9733 --- /dev/null +++ b/types/react-sparklines/react-sparklines-tests.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { + Sparklines, + SparklinesLine, + SparklinesCurve, + SparklinesBars, + SparklinesReferenceLine, + SparklinesNormalBand, + SparklinesSpots, + SparklinesText, +} from 'react-sparklines'; + +class SparklinesDefaultTest extends React.Component { + render() { + return ( + + + + + + + + + + ); + } +} + +class SparklinesRegularTest extends React.Component { + render() { + return ( + + + + + + ); + } +} diff --git a/types/react-sparklines/tsconfig.json b/types/react-sparklines/tsconfig.json new file mode 100644 index 0000000000..a03ec22d0e --- /dev/null +++ b/types/react-sparklines/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "react-sparklines-tests.tsx" + ] +} diff --git a/types/react-sparklines/tslint.json b/types/react-sparklines/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-sparklines/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8a155514f4154d8b2b22bc55db7c297bc1cd031f Mon Sep 17 00:00:00 2001 From: Alexander Fisher Date: Mon, 10 Sep 2018 20:04:18 -0400 Subject: [PATCH 18/74] Add types for react-lifecycle-component (#28635) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If adding a new definition: - [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. --- types/react-lifecycle-component/index.d.ts | 24 +++++ types/react-lifecycle-component/package.json | 6 ++ .../react-lifecycle-component-tests.tsx | 98 +++++++++++++++++++ types/react-lifecycle-component/tsconfig.json | 25 +++++ types/react-lifecycle-component/tslint.json | 1 + 5 files changed, 154 insertions(+) create mode 100644 types/react-lifecycle-component/index.d.ts create mode 100644 types/react-lifecycle-component/package.json create mode 100644 types/react-lifecycle-component/react-lifecycle-component-tests.tsx create mode 100644 types/react-lifecycle-component/tsconfig.json create mode 100644 types/react-lifecycle-component/tslint.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" } From a177a87c7d738da8fa0c6e9144fa04780d4f5f75 Mon Sep 17 00:00:00 2001 From: Ryokik Date: Tue, 11 Sep 2018 09:07:22 +0900 Subject: [PATCH 19/74] Add type definition for react-native-navbar (#28746) --- types/react-global-configuration/index.d.ts | 19 ++++++++++++++ .../react-global-configuration-tests.ts | 25 +++++++++++++++++++ .../react-global-configuration/tsconfig.json | 23 +++++++++++++++++ types/react-global-configuration/tslint.json | 1 + 4 files changed, 68 insertions(+) create mode 100644 types/react-global-configuration/index.d.ts create mode 100644 types/react-global-configuration/react-global-configuration-tests.ts create mode 100644 types/react-global-configuration/tsconfig.json create mode 100644 types/react-global-configuration/tslint.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..30ce772f10 --- /dev/null +++ b/types/react-global-configuration/index.d.ts @@ -0,0 +1,19 @@ +// 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; +} + +declare namespace ReactGlobalConfiguration { + function set(newConfiguration: any, newOptions?: Options): void; + function get(key?: string): any; + function get(key: string, fallbackValue: Value): Value; + function serialize(): string; +} + +export default ReactGlobalConfiguration; 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..d55b74d8f8 --- /dev/null +++ b/types/react-global-configuration/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", + "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" } From 6b5a69b2ca91a9f0902da09d5335c3ffcb96de5c Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Mon, 10 Sep 2018 18:30:04 -0700 Subject: [PATCH 20/74] directory should be optional here (#28659) --- types/megajs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From 2a2f49e0d0e7adfae9782f64fd76a88f93f52647 Mon Sep 17 00:00:00 2001 From: tup1tsa Date: Tue, 11 Sep 2018 04:36:01 +0300 Subject: [PATCH 21/74] definitions for numeric (#28714) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If adding a new definition: - [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. --- types/numeric/index.d.ts | 1199 ++++++++++++++++++++++++++++++++ types/numeric/numeric-tests.ts | 630 +++++++++++++++++ types/numeric/tsconfig.json | 23 + types/numeric/tslint.json | 3 + 4 files changed, 1855 insertions(+) create mode 100644 types/numeric/index.d.ts create mode 100644 types/numeric/numeric-tests.ts create mode 100644 types/numeric/tsconfig.json create mode 100644 types/numeric/tslint.json 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" +} From 59f25426d5628f0931b2860c36c7779467e2371e Mon Sep 17 00:00:00 2001 From: Mike North Date: Mon, 10 Sep 2018 18:47:45 -0700 Subject: [PATCH 22/74] [ember] refine types for Ember.tryInvoke (#28693) * [ember] refine types for Ember.tryInvoke * [ember] tryInvoke as three function heads --- types/ember/index.d.ts | 23 ++++++++++++++++++++++- types/ember/test/utils.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index fe784dae8b..3ff82919dc 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -28,6 +28,20 @@ declare module 'ember' { // Get an alias to the global Array type to use in inner scope below. type GlobalArray = T[]; + // 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; /** * Deconstructs computed properties into the types which would be returned by `.get()`. */ @@ -3320,7 +3334,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/utils.ts b/types/ember/test/utils.ts index 9ddc2b361e..2a769dc2dc 100755 --- a/types/ember/test/utils.ts +++ b/types/ember/test/utils.ts @@ -99,3 +99,31 @@ 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 +} From b5a595ff4f791ccbe0b1082e6ebf2cd7f25f7571 Mon Sep 17 00:00:00 2001 From: Mike North Date: Mon, 10 Sep 2018 18:48:15 -0700 Subject: [PATCH 23/74] [ember] @ember/string prototype extensions, additional tests and fixes (#28695) * [ember] @ember/string prototype extensions, additional tests and fixes * [ember] @ember/string w/ prototype extensions - test fixes --- types/ember/index.d.ts | 13 +++++++++- types/ember/test/string-ext.ts | 28 ++++++++++++++++++++++ types/ember/test/string.ts | 36 ++++++++++++++++++++++++++++ types/ember/tsconfig.json | 44 ++++++++++++++++++---------------- 4 files changed, 99 insertions(+), 22 deletions(-) create mode 100644 types/ember/test/string-ext.ts create mode 100644 types/ember/test/string.ts diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 3ff82919dc..cee4ebc780 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -324,6 +324,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. */ @@ -2453,7 +2464,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[]; } 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/tsconfig.json b/types/ember/tsconfig.json index 29f20bcc44..74ec227219 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -21,39 +21,41 @@ "files": [ "index.d.ts", "test/lib/assert.ts", - "test/application.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/create-negative.ts", + "test/create.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" ] } From 664bd2ccfa2e3543c65deb8e754a06e1cbfb827c Mon Sep 17 00:00:00 2001 From: Ben Hodgson Date: Tue, 11 Sep 2018 03:26:50 +0100 Subject: [PATCH 24/74] [cookie-session] Add missing sameSite type. name value is optional (defaults to session). (#28624) --- types/cookie-session/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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). */ From 648f7536f67823b9f894ffa1a18eb2616d7be491 Mon Sep 17 00:00:00 2001 From: Benedict Etzel Date: Tue, 11 Sep 2018 17:13:27 +0200 Subject: [PATCH 25/74] [twitch-ext] Minor fixes and Bits (#28784) * twitch-ext: Add missing popout flag to client query parameters * twitch-ext: Add feature flags * twitch-ext: Add bits --- types/twitch-ext/index.d.ts | 173 +++++++++++++++++++++++++++ types/twitch-ext/twitch-ext-tests.ts | 50 ++++++++ 2 files changed, 223 insertions(+) diff --git a/types/twitch-ext/index.d.ts b/types/twitch-ext/index.d.ts index 87bad1958d..81bc3d3643 100644 --- a/types/twitch-ext/index.d.ts +++ b/types/twitch-ext/index.d.ts @@ -29,6 +29,16 @@ interface TwitchExt { */ actions: TwitchExtActions; + /** + * @see https://dev.twitch.tv/docs/extensions/reference/#twitch-extension-feature-flags + */ + features: TwitchExtFeatures; + + /** + * @see https://dev.twitch.tv/docs/extensions/bits/#javascript-helper + */ + bits: TwitchExtBits; + /** * Helper methods for the Twitch Extension rig. * @see https://github.com/twitchdev/developer-rig @@ -160,6 +170,164 @@ interface TwitchExtActions { requestIdShare(): void; } +interface TwitchExtFeatureFlags { + /** + * If this flag is true, you can send a chat message to the current channel using Send Extension Chat Message + * (subject to the authentication requirements documented for that endpoint). + */ + isChatEnabled: boolean; +} + +/** + * @see TwitchExt.features + */ +interface TwitchExtFeatures extends TwitchExtFeatureFlags { + /** + * This function enables you to receive real-time updates to changes of the features object. + * If this callback is invoked, you should re-check the Twitch.ext.features object for a change + * to any feature flag your extension cares about. + * + * @param callback The callback is called with an array of feature flags which were updated. + */ + onChanged( + callback: (changed: ReadonlyArray) => void + ): void; +} + +interface TwitchExtBitsProductCost { + /** + * Number of Bits required for the product. + */ + amount: string; + + /** + * Always the string "bits". Reserved for future use. + */ + type: "bits"; +} + +interface TwitchExtBitsProduct { + /** + * Cost object. + */ + cost: TwitchExtBitsProductCost; + + /** + * Registered display name for the SKU. + */ + displayName: string; + + /** + * This field is returned only for extension versions that are not in the Released state. + */ + inDevelopment?: boolean; + + /** + * Unique ID for the product. + */ + sku: string; +} + +interface TwitchExtBitsTransaction { + /** + * Display name of the user who executed the Bits in Extensions transaction. + */ + displayName: string; + + initiator: "CURRENT_USER" | "OTHER"; + + /** + * Full product object from getProducts call + */ + product: TwitchExtBitsProduct; + + /** + * ID of the transaction. + */ + transactionID: string; + + /** + * JWT containing the following transaction information in the payload. + * The JWT is a large, base64-encoded string. It can be verified using your developer secret. + */ + transactionReceipt: string; + + /** + * Twitch ID of the user who executed the transaction. + */ + userId: string; +} + +/** + * @see TwitchExt.bits + */ +interface TwitchExtBits { + /** + * This function returns a promise which resolves to an array of products available for Bits, + * for the extension, if the context supports Bits in Extensions actions. Otherwise, the + * promise rejects with an error; this can occur, for instance, if the extension is running in + * an older version of the developer rig or the mobile app, which does not support Bits in + * Extensions actions. + * + * @see https://dev.twitch.tv/docs/extensions/bits/#getproducts + */ + getProducts(): Promise>; + + /** + * This function takes a callback that is fired whenever a transaction is cancelled. + * @param callback The callback that is fired whenever a transaction is cancelled. + * + * @see https://dev.twitch.tv/docs/extensions/bits/#ontransactioncancelledcallback + */ + onTransactionCancelled(callback: () => void): void; + + /** + * This function registers a callback that is fired whenever a Bits in Extensions transaction + * is completed. + * @param callback The callback that is fired. + * + * @see https://dev.twitch.tv/docs/extensions/bits/#ontransactioncompletecallbacktransactionobject + */ + onTransactionComplete( + callback: (transaction: TwitchExtBitsTransaction) => void + ): void; + + /** + * This function sets the state of the extension helper, so it does not call live services for + * usage of Bits. Instead, it does a local loopback to the completion handler, after a fixed + * delay to simulate user approval and process latency. + * @param useLoopback Whether to use local looback. + * + * @see https://dev.twitch.tv/docs/extensions/bits/#setuseloopbackboolean + */ + setUseLoopback(useLoopback: boolean): void; + + /** + * Call this function when the viewer hovers over a product in your extension UI, to cause the + * Twitch UI to display a dialog showing the viewer’s Bits balance. + * The dialog displays for 1.5 seconds, unless your extension calls showBitsBalance again, in + * which case the 1.5-second timer resets. + * + * This is a “fire-and-forget” function: the extension developer does not need to tell Twitch + * when the viewer stops hovering over the product. + * + * On mobile, this function is ignored. + * + * @see https://dev.twitch.tv/docs/extensions/bits/#showbitsbalance + */ + showBitsBalance(): void; + + /** + * This function redeems a product with the specified SKU for the number of Bits specified in + * the catalog entry of that product. + * @param sku + * + * @see https://dev.twitch.tv/docs/extensions/bits/#usebitssku + * @see https://dev.twitch.tv/docs/extensions/bits/#exchanging-bits-for-a-product + */ + useBits(sku: string): void; +} + /** * The developer rig object as available under window.Twitch.ext.rig. * @@ -322,6 +490,11 @@ interface TwitchExtClientQueryParams { */ platform: "mobile" | "web"; + /** + * Indicates whether the extension is popped out. + */ + popout: "true" | "false"; + /** * The release state of the extension. */ diff --git a/types/twitch-ext/twitch-ext-tests.ts b/types/twitch-ext/twitch-ext-tests.ts index 0284e0191c..f6a70f86cb 100644 --- a/types/twitch-ext/twitch-ext-tests.ts +++ b/types/twitch-ext/twitch-ext-tests.ts @@ -36,5 +36,55 @@ window.Twitch.ext.actions.minimize(); window.Twitch.ext.actions.followChannel("hearthsim"); window.Twitch.ext.actions.requestIdShare(); +// Twitch Extension Feature flags +window.Twitch.ext.features.onChanged(changed => { + if (changed.indexOf("isChatEnabled") !== -1) { + if (window.Twitch.ext.features.isChatEnabled) { + console.log("Chat is now enabled"); + } + } +}); + +// Twitch Extension Bits +window.Twitch.ext.bits + .getProducts() + .then(products => { + console.log(`Got ${products.length} products`); + for (const product of products) { + console.log( + `Found product "${product.displayName}" with SKU ${product.sku}` + ); + console.log( + `Product costs ${product.cost.amount} ${product.cost.type}` + ); + if (typeof product.inDevelopment !== "undefined") { + if (product.inDevelopment) { + console.log("Product is in development"); + } else { + console.log("Product is not in development"); + } + } else { + console.log(""); + } + } + }) + .catch(error => { + console.error(`Got an error: ${error}`); + }); +window.Twitch.ext.bits.onTransactionCancelled(() => + console.log("Transaction cancelled") +); +window.Twitch.ext.bits.onTransactionComplete(transaction => { + console.log( + `${transaction.initiator} (${transaction.userId}) bought ${ + transaction.product.displayName + }` + ); + console.log(`Transaction id was ${transaction.transactionID}`); +}); +window.Twitch.ext.bits.setUseLoopback(true); +window.Twitch.ext.bits.showBitsBalance(); +window.Twitch.ext.bits.useBits("MY-PRODUCT"); + // Developer Rig window.Twitch.ext.rig.log("Hello, world!"); From a20e687b6d39073956c237bdfc9b820d90dfed40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miika=20H=C3=A4nninen?= Date: Tue, 11 Sep 2018 18:14:31 +0300 Subject: [PATCH 26/74] Ramda: accept ReadonlyArray in chain and flatten (#28779) * Ramda: accept ReadonlyArray in chain The return value of the `fn` parameter in chain is an input value for chain, so it should be a looser type than `[]` * Ramda: accept nested ReadonlyArrays in flatten --- types/ramda/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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' From 65beaf933024754e13ace2cff72cbd07462e2b05 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Tue, 11 Sep 2018 17:16:06 +0200 Subject: [PATCH 27/74] nodemailer: contentTransferEncoding and contentDisposition values (#28780) --- types/nodemailer/lib/mailer/index.d.ts | 4 ++-- types/nodemailer/nodemailer-tests.ts | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) 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/nodemailer-tests.ts b/types/nodemailer/nodemailer-tests.ts index 140b351c6b..c5d428a98e 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 From 074ace337241668dc25bd4c3896b61d9ba4fe769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Tue, 11 Sep 2018 17:16:19 +0200 Subject: [PATCH 28/74] react-navigation: Add params to state property (#28703) --- types/react-navigation/index.d.ts | 2 +- .../react-navigation-tests.tsx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) 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; } From 960458f95c71ed4304224b44810aeff4e640a2f8 Mon Sep 17 00:00:00 2001 From: Thomas Hasner Date: Tue, 11 Sep 2018 11:16:44 -0400 Subject: [PATCH 29/74] Remove myself as maintainer (#28772) --- types/react-redux/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 27d800484a..29845061f6 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -1,7 +1,6 @@ // Type definitions for react-redux 6.0.4 // Project: https://github.com/reduxjs/react-redux // Definitions by: Qubo , -// Thomas Hasner , // Kenzie Togami , // Curits Layne // Frank Tan From a9afdfa97d6eb943a944364ae866eafcdfbc8acf Mon Sep 17 00:00:00 2001 From: Alex Jerabek <38896772+AlexJerabek@users.noreply.github.com> Date: Tue, 11 Sep 2018 08:19:20 -0700 Subject: [PATCH 30/74] [office-js] Adding links to Excel conceptual topics and removing "relationship" term (#28771) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [ ] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). --- types/office-js/index.d.ts | 697 +++++++++++++++++++------------------ 1 file changed, 356 insertions(+), 341 deletions(-) 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. * From 95d036d4b6e41b7897042b029b0d1985fe9782e9 Mon Sep 17 00:00:00 2001 From: various89 Date: Tue, 11 Sep 2018 17:20:50 +0200 Subject: [PATCH 31/74] adds session and multi-document transactions to mongodb / mongoose (#28745) * adds sessions and multi-document transactions * avoid duplicate interfaces extends options of GridFSBucketWriteStream * adds type for options paramater of method withSession --- types/mongodb/index.d.ts | 220 ++++++++++++++++++++++++------- types/mongodb/mongodb-tests.ts | 112 +++++++++++++++- types/mongoose/index.d.ts | 108 ++++++++------- types/mongoose/mongoose-tests.ts | 61 +++++++++ 4 files changed, 407 insertions(+), 94 deletions(-) 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 From c812b16876f3a8dbd9f03b3d15bf63ce08b51cbb Mon Sep 17 00:00:00 2001 From: Gordey Doronin Date: Tue, 11 Sep 2018 22:23:03 +0700 Subject: [PATCH 32/74] [node-resque] Fix to not depend on `@types/events` npm package. (#28777) --- types/node-resque/index.d.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/types/node-resque/index.d.ts b/types/node-resque/index.d.ts index 208c2d29a3..4b09807ee5 100644 --- a/types/node-resque/index.d.ts +++ b/types/node-resque/index.d.ts @@ -5,8 +5,6 @@ /// -import { EventEmitter } from 'events'; - export interface ConnectionOptions { pkg?: string; host?: string; @@ -17,7 +15,7 @@ export interface ConnectionOptions { options?: any; } -export class Connection extends EventEmitter { +export class Connection extends NodeJS.EventEmitter { constructor(options: ConnectionOptions); connect(): Promise; @@ -38,7 +36,7 @@ export interface QueueOptions { connection?: ConnectionOptions; } -export class Queue extends EventEmitter { +export class Queue extends NodeJS.EventEmitter { constructor(options: QueueOptions, jobs?: JobsHash); connect(): Promise; @@ -60,7 +58,7 @@ export interface WorkerOptions { export type WorkerEvent = 'start' | 'end' | 'cleaning_worker' | 'poll' | 'ping' | 'job' | 'reEnqueue' | 'success' | 'failure' | 'error' | 'pause'; -export class Worker extends EventEmitter { +export class Worker extends NodeJS.EventEmitter { constructor(options: WorkerOptions, jobs?: JobsHash); connect(): Promise; @@ -100,7 +98,7 @@ export interface SchedulerOptions { export type SchedulerEvent = 'start' | 'end' | 'poll' | 'master' | 'cleanStuckWorker' | 'error' | 'workingTimestamp' | 'transferredJob'; -export class Scheduler extends EventEmitter { +export class Scheduler extends NodeJS.EventEmitter { constructor(options: SchedulerOptions, jobs?: JobsHash); connect(): Promise; From f439710d62397d2f86b263eed062670f80da715e Mon Sep 17 00:00:00 2001 From: Ryokik Date: Wed, 12 Sep 2018 00:24:35 +0900 Subject: [PATCH 33/74] Fix default export usage in my definition for react-global-configuration (#28775) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If adding a new definition: - [ ] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [ ] Create it with `dts-gen --dt`, not by basing it on an existing project. - [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. If changing an existing definition: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: **`react-global-configuration` is not changed. this is fixing mistake of my definition.** - [x] Increase the version number in the header if appropriate. - [x] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. If removing a declaration: - [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.) - [ ] Delete the package's directory. - [ ] Add it to `notNeededPackages.json`. --- types/react-global-configuration/index.d.ts | 12 ++++-------- types/react-global-configuration/tsconfig.json | 3 ++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/types/react-global-configuration/index.d.ts b/types/react-global-configuration/index.d.ts index 30ce772f10..d2a4157720 100644 --- a/types/react-global-configuration/index.d.ts +++ b/types/react-global-configuration/index.d.ts @@ -9,11 +9,7 @@ export interface Options { assign: boolean; } -declare namespace ReactGlobalConfiguration { - function set(newConfiguration: any, newOptions?: Options): void; - function get(key?: string): any; - function get(key: string, fallbackValue: Value): Value; - function serialize(): string; -} - -export default ReactGlobalConfiguration; +export function set(newConfiguration: any, newOptions?: Options): void; +export function get(key?: string): any; +export function get(key: string, fallbackValue: Value): Value; +export function serialize(): string; diff --git a/types/react-global-configuration/tsconfig.json b/types/react-global-configuration/tsconfig.json index d55b74d8f8..c75d7c7cce 100644 --- a/types/react-global-configuration/tsconfig.json +++ b/types/react-global-configuration/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true }, "files": [ "index.d.ts", From 822fafc157d3d2e1a8522ab4bfcdf9ee2ac1818d Mon Sep 17 00:00:00 2001 From: Buck Supergoose Date: Tue, 11 Sep 2018 16:26:48 +0100 Subject: [PATCH 34/74] Fix #28598 (#28668) Allow VRLayer left and right bounds to accept types of number[], Float32Array or null. --- types/webvr-api/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webvr-api/index.d.ts b/types/webvr-api/index.d.ts index 3d03a14d4b..a285d968b2 100644 --- a/types/webvr-api/index.d.ts +++ b/types/webvr-api/index.d.ts @@ -133,8 +133,8 @@ declare var VRDisplay: { }; interface VRLayer { - leftBounds?: number[] | null; - rightBounds?: number[] | null; + leftBounds?: number[] | Float32Array | null; + rightBounds?: number[] | Float32Array | null; source?: HTMLCanvasElement | null; } From b883a3573a577355036114e6071166d1dc2fa05c Mon Sep 17 00:00:00 2001 From: Florian Barbare Date: Tue, 11 Sep 2018 16:27:22 +0100 Subject: [PATCH 35/74] @types/payment Add formatCardNumber in the types (#28669) I wanna use the `formatCardNumber` function standalone but it is not defined in the types yet, so there we go. --- types/payment/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) 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 From bf29450ff919ddf3350e606e97343a2c0f0f5d30 Mon Sep 17 00:00:00 2001 From: David Pett Date: Tue, 11 Sep 2018 10:29:17 -0500 Subject: [PATCH 36/74] add 'sketch' and 'vr' as platforms to react-primitives (#28674) * add 'sketch' and 'vr' as platforms to react-primitives * Update index.d.ts * fixed lint warnings * added test --- types/react-primitives/index.d.ts | 13 +++++++++++-- types/react-primitives/react-primitives-tests.tsx | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/types/react-primitives/index.d.ts b/types/react-primitives/index.d.ts index 7d276c6a94..ff9917317a 100644 --- a/types/react-primitives/index.d.ts +++ b/types/react-primitives/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-primitives 0.6 // Project: https://github.com/lelandrichardson/react-primitives // Definitions by: Ahmed Ghoneim +// David Pett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -11,7 +12,7 @@ import { Easing, Image, PixelRatio, - Platform, + PlatformOSType as RNPlatformOSType, StyleSheet, Text, TouchableOpacityProps, @@ -20,13 +21,21 @@ import { export const Touchable: ComponentType; +// react-primitives also supports react-sketchapp and react-vr as platforms +export type PlatformOSType = RNPlatformOSType | 'sketch' | 'vr'; +export interface PlatformStatic { + OS: PlatformOSType; + Version: number | string; + select(specifics: { [platform in PlatformOSType | 'default']?: T }): T; +} +export const Platform: PlatformStatic; + export { Animated, Dimensions, Easing, Image, PixelRatio, - Platform, StyleSheet, Text, View diff --git a/types/react-primitives/react-primitives-tests.tsx b/types/react-primitives/react-primitives-tests.tsx index 68512f61c9..7fd45e132e 100644 --- a/types/react-primitives/react-primitives-tests.tsx +++ b/types/react-primitives/react-primitives-tests.tsx @@ -49,6 +49,9 @@ export default class Component extends React.Component<{}, State> { duration: 10000, easing: Easing.cubic }).start(); + if (Platform.OS === 'sketch') { + console.log('The Platform is sketch'); + } } render() { From 6d9d1c7a924548017fa3c23959c7dac4492c2e85 Mon Sep 17 00:00:00 2001 From: Armando Aguirre Date: Tue, 11 Sep 2018 09:49:40 -0700 Subject: [PATCH 37/74] Moved react-table-filter inside types folder (#28759) * Moved react-table-filder inside types folder * Moved react-table-filder inside types folder --- {react-table-filter => types/react-table-filter}/index.d.ts | 0 .../react-table-filter}/react-table-filter-tests.ts | 0 {react-table-filter => types/react-table-filter}/tsconfig.json | 0 {react-table-filter => types/react-table-filter}/tslint.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {react-table-filter => types/react-table-filter}/index.d.ts (100%) rename {react-table-filter => types/react-table-filter}/react-table-filter-tests.ts (100%) rename {react-table-filter => types/react-table-filter}/tsconfig.json (100%) rename {react-table-filter => types/react-table-filter}/tslint.json (100%) diff --git a/react-table-filter/index.d.ts b/types/react-table-filter/index.d.ts similarity index 100% rename from react-table-filter/index.d.ts rename to types/react-table-filter/index.d.ts diff --git a/react-table-filter/react-table-filter-tests.ts b/types/react-table-filter/react-table-filter-tests.ts similarity index 100% rename from react-table-filter/react-table-filter-tests.ts rename to types/react-table-filter/react-table-filter-tests.ts diff --git a/react-table-filter/tsconfig.json b/types/react-table-filter/tsconfig.json similarity index 100% rename from react-table-filter/tsconfig.json rename to types/react-table-filter/tsconfig.json diff --git a/react-table-filter/tslint.json b/types/react-table-filter/tslint.json similarity index 100% rename from react-table-filter/tslint.json rename to types/react-table-filter/tslint.json From 9f0266511c507b4602a5765de3baa300eca03475 Mon Sep 17 00:00:00 2001 From: Mike North Date: Tue, 11 Sep 2018 10:37:23 -0700 Subject: [PATCH 38/74] [react-table-filter] build fixes --- types/react-table-filter/index.d.ts | 12 ++++++------ types/react-table-filter/react-table-filter-tests.ts | 6 +++--- types/react-table-filter/tsconfig.json | 5 +++-- types/react-table-filter/tslint.json | 6 +++++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/types/react-table-filter/index.d.ts b/types/react-table-filter/index.d.ts index 8f9c50a26f..45660bf0e3 100644 --- a/types/react-table-filter/index.d.ts +++ b/types/react-table-filter/index.d.ts @@ -1,16 +1,16 @@ -// Type definitions for react-table-filter 1.0.0 +// Type definitions for react-table-filter 1.0 // Project: https://github.com/cheekujha/react-table-filter -// Definitions by: Gnanavel N +// 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; + rows: string | string[] | { [name: string]: boolean; }; + onFilterUpdate: (filteredArray: string[], currentFilters: any[]) => any[] | void; rowClass?: string; - initialFilters?: string | Array | { [name: string]: boolean; }; + initialFilters?: string | string[] | { [name: string]: boolean; }; } -export declare class TableFilter extends React.Component {} \ No newline at end of file +export class TableFilter extends React.Component {} diff --git a/types/react-table-filter/react-table-filter-tests.ts b/types/react-table-filter/react-table-filter-tests.ts index 051f694f75..579941ed97 100644 --- a/types/react-table-filter/react-table-filter-tests.ts +++ b/types/react-table-filter/react-table-filter-tests.ts @@ -5,14 +5,14 @@ import { TableFilter } from "react-table-filter"; interface TestTableFilterProps extends TableFilter {} class TestApp extends React.Component { - onFilterUpdate = (filteredArray: Array, currentFilters: any[]) => { + onFilterUpdate = (filteredArray: string[], currentFilters: any[]) => { console.log("Filtered Array: " + filteredArray); console.log("Current Filters: " + currentFilters); } render() { - return React.createElement(TableFilter, {onFilterUpdate: this.onFilterUpdate}); + return React.createElement(TableFilter, { onFilterUpdate: this.onFilterUpdate, rows: [] }); } } -ReactDOM.render(React.createElement(TestApp, {}), document.getElementById("test-app")); \ No newline at end of file +ReactDOM.render(React.createElement(TestApp, {}), document.getElementById("test-app")); diff --git a/types/react-table-filter/tsconfig.json b/types/react-table-filter/tsconfig.json index ca4a35b1cb..c00f8eafa6 100644 --- a/types/react-table-filter/tsconfig.json +++ b/types/react-table-filter/tsconfig.json @@ -1,11 +1,12 @@ { "files": [ - "index.d.ts" + "index.d.ts", + "react-table-filter-tests.ts" ], "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6","dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/react-table-filter/tslint.json b/types/react-table-filter/tslint.json index d88586e5bd..f45f88688c 100644 --- a/types/react-table-filter/tslint.json +++ b/types/react-table-filter/tslint.json @@ -1,3 +1,7 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "no-console": false + } } From ba72fc6a04179af656dccc0737dbb8142be82069 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 13 Sep 2018 09:42:07 -0700 Subject: [PATCH 39/74] updates `abstract-leveldown` to return its 'unnecessary generics' (#28827) --- .../abstract-leveldown-tests.ts | 4 ++ types/abstract-leveldown/index.d.ts | 39 ++++++++++++------- 2 files changed, 29 insertions(+), 14 deletions(-) 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; From 49e8daef6a369f8f0038af55c801e9109f1aafb6 Mon Sep 17 00:00:00 2001 From: Chris Redekop <32752154+repl-chris@users.noreply.github.com> Date: Thu, 13 Sep 2018 10:48:08 -0600 Subject: [PATCH 40/74] [aws-lambda] Fix challengeMetadata typos in cognito custom challenge (#28834) * Fix challengeMetadata typos * Fix type of challengeAnswer --- types/aws-lambda/aws-lambda-tests.ts | 6 +++--- types/aws-lambda/index.d.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 94575006ab..3e0ded1681 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 diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 35d0b1d7a6..093fd763dd 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -250,11 +250,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 +266,7 @@ export interface CognitoUserPoolTriggerEvent { failAuthentication?: boolean; publicChallengeParameters?: { [key: string]: string }; privateChallengeParameters?: { [key: string]: string }; - challengeMetaData?: string; + challengeMetadata?: string; answerCorrect?: boolean; }; } From 52636bbb16cc445f7d18c5b965af9dd12642bb73 Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:49:42 -0700 Subject: [PATCH 41/74] [ember] relax ObserverMethod property name arg (#28839) * [ember] failing test - relax ObserverMethod property name arg * [ember] relax ObserverMethod property name arg --- types/ember/index.d.ts | 2 +- types/ember__utils/ember__utils-tests.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index cee4ebc780..cbdba8919e 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -143,7 +143,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; diff --git a/types/ember__utils/ember__utils-tests.ts b/types/ember__utils/ember__utils-tests.ts index d93e2a1ec7..8b270f1bec 100644 --- a/types/ember__utils/ember__utils-tests.ts +++ b/types/ember__utils/ember__utils-tests.ts @@ -8,6 +8,7 @@ import { tryInvoke, typeOf } from '@ember/utils'; +import EmberObject from '@ember/object'; (function() { /** isNone */ @@ -161,3 +162,10 @@ import { isEmpty({ size: 1 }); // $ExpectType boolean isEmpty({ size: () => 0 }); // $ExpectType boolean })(); + +class Foo extends EmberObject.extend({ + abc: true, + bar() { return '123'; } +}) { + def: 'hello'; +} From 8b4c416e16b5e796e197feba6b2695da8b84b9c6 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Fri, 14 Sep 2018 00:50:32 +0800 Subject: [PATCH 42/74] [weixin-app] add more system info entries (#28840) --- types/weixin-app/index.d.ts | 16 ++++++++++++++++ types/weixin-app/weixin-app-tests.ts | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index 2b0a905afe..908ba026bd 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -1082,18 +1082,34 @@ declare namespace wx { // #region 设备API列表 // 设备-----系统信息 interface SystemInfo { + /** 手机品牌 */ + brand: string; /** 手机型号 */ model: string; /** 设备像素比 */ pixelRatio: number; + /** 屏幕宽度 */ + screenWidth: number; + /** 屏幕高度 */ + screenHeight: number; /** 窗口宽度 */ windowWidth: number; /** 窗口高度 */ windowHeight: number; + /** 状态栏的高度 */ + statusBarHeight: number; /** 微信设置的语言 */ language: string; /** 微信版本号 */ version: string; + /** 操作系统版本 */ + system: string; + /** 客户端平台 */ + platform: string; + /** 用户字体大小设置。以“我-设置-通用-字体大小”中的设置为准,单位 px。 */ + fontSizeSetting: number; + /** 客户端基础库版本 */ + SDKVersion: string; } interface GetSystemInfoOptions extends BaseOptions { /** 成功获取系统信息的回调 */ diff --git a/types/weixin-app/weixin-app-tests.ts b/types/weixin-app/weixin-app-tests.ts index 1daf4990fc..cacdeaee70 100644 --- a/types/weixin-app/weixin-app-tests.ts +++ b/types/weixin-app/weixin-app-tests.ts @@ -448,3 +448,24 @@ wx.request({ console.error(e); } }).abort(); + +wx.getSystemInfo({ + success(res) { + const { + brand, + pixelRatio, + platform, + windowHeight, + windowWidth, + screenHeight, + screenWidth, + statusBarHeight, + SDKVersion, + language, + model, + version, + fontSizeSetting, + system + } = res; + } +}); From 3765c60b75e3e137eb27a502473f80b58d86412b Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:51:45 -0700 Subject: [PATCH 43/74] [ember] refactor @ember/controller out into a separate module (#28842) * [ember] failing test - relax ObserverMethod property name arg * [ember] relax ObserverMethod property name arg * [ember] @ember/controller types refactored into their own package --- .../ember__controller-tests.ts | 11 ++++++++ types/ember__controller/index.d.ts | 15 ++++++++++ types/ember__controller/tsconfig.json | 28 +++++++++++++++++++ types/ember__controller/tslint.json | 4 +++ 4 files changed, 58 insertions(+) create mode 100644 types/ember__controller/ember__controller-tests.ts create mode 100644 types/ember__controller/index.d.ts create mode 100644 types/ember__controller/tsconfig.json create mode 100644 types/ember__controller/tslint.json 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": {} +} From 2609e62c2db9ebf5a543b0e9d51a2b946f28611c Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:52:16 -0700 Subject: [PATCH 44/74] [ember] refactor @ember/service out into a separate module (#28843) * [ember] failing test - relax ObserverMethod property name arg * [ember] relax ObserverMethod property name arg * [ember] @ember/service types refactored into their own package --- types/ember__service/ember__service-tests.ts | 38 ++++++++++++++++++++ types/ember__service/index.d.ts | 15 ++++++++ types/ember__service/tsconfig.json | 28 +++++++++++++++ types/ember__service/tslint.json | 4 +++ 4 files changed, 85 insertions(+) create mode 100644 types/ember__service/ember__service-tests.ts create mode 100644 types/ember__service/index.d.ts create mode 100644 types/ember__service/tsconfig.json create mode 100644 types/ember__service/tslint.json 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": {} +} From 488594c9b337174e95a112e1cb1455a0077033da Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:52:49 -0700 Subject: [PATCH 45/74] [ember] refactor @ember/routing types into their own package (#28844) * [ember] failing test - relax ObserverMethod property name arg * [ember] relax ObserverMethod property name arg * [ember] @ember/routing types refactored into their own package * Update index.d.ts --- types/ember__routing/auto-location.d.ts | 3 + types/ember__routing/hash-location.d.ts | 3 + types/ember__routing/history-location.d.ts | 3 + types/ember__routing/index.d.ts | 8 ++ types/ember__routing/link-component.d.ts | 3 + types/ember__routing/location.d.ts | 4 + types/ember__routing/none-location.d.ts | 3 + types/ember__routing/route.d.ts | 3 + types/ember__routing/router-service.d.ts | 3 + types/ember__routing/router.d.ts | 3 + types/ember__routing/test/lib/assert.ts | 5 + types/ember__routing/test/route.ts | 112 +++++++++++++++++++++ types/ember__routing/test/router.ts | 54 ++++++++++ types/ember__routing/tsconfig.json | 40 ++++++++ types/ember__routing/tslint.json | 4 + 15 files changed, 251 insertions(+) create mode 100644 types/ember__routing/auto-location.d.ts create mode 100644 types/ember__routing/hash-location.d.ts create mode 100644 types/ember__routing/history-location.d.ts create mode 100644 types/ember__routing/index.d.ts create mode 100644 types/ember__routing/link-component.d.ts create mode 100644 types/ember__routing/location.d.ts create mode 100644 types/ember__routing/none-location.d.ts create mode 100644 types/ember__routing/route.d.ts create mode 100644 types/ember__routing/router-service.d.ts create mode 100644 types/ember__routing/router.d.ts create mode 100755 types/ember__routing/test/lib/assert.ts create mode 100755 types/ember__routing/test/route.ts create mode 100755 types/ember__routing/test/router.ts create mode 100644 types/ember__routing/tsconfig.json create mode 100644 types/ember__routing/tslint.json 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": {} +} From a87e9d3ab8fb832e72de4413808108f9362fc824 Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:55:01 -0700 Subject: [PATCH 46/74] [ember] refactor @ember/engine types into their own package (#28847) * [ember] failing test - relax ObserverMethod property name arg * [ember] relax ObserverMethod property name arg * [ember] @ember/engine types refactored into their own package --- types/ember__engine/index.d.ts | 10 +++++ types/ember__engine/instance.d.ts | 3 ++ types/ember__engine/test/engine-instance.ts | 26 +++++++++++++ types/ember__engine/test/engine.ts | 41 +++++++++++++++++++++ types/ember__engine/tsconfig.json | 31 ++++++++++++++++ types/ember__engine/tslint.json | 4 ++ 6 files changed, 115 insertions(+) create mode 100644 types/ember__engine/index.d.ts create mode 100644 types/ember__engine/instance.d.ts create mode 100644 types/ember__engine/test/engine-instance.ts create mode 100755 types/ember__engine/test/engine.ts create mode 100644 types/ember__engine/tsconfig.json create mode 100644 types/ember__engine/tslint.json 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": {} +} From 856deff048ad9a824ddab109315caed7c6f0ea84 Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:55:31 -0700 Subject: [PATCH 47/74] [ember] refactor @ember/component types into their own package (#28845) * [ember] failing test - relax ObserverMethod property name arg * [ember] relax ObserverMethod property name arg * [ember] @ember/component types refactored into their own package --- types/ember__component/checkbox.d.ts | 3 + types/ember__component/helper.d.ts | 17 +++ types/ember__component/index.d.ts | 9 ++ types/ember__component/test/component.ts | 123 ++++++++++++++++++++++ types/ember__component/test/helper.ts | 25 +++++ types/ember__component/test/lib/assert.ts | 5 + types/ember__component/text-area.d.ts | 3 + types/ember__component/text-field.d.ts | 3 + types/ember__component/tsconfig.json | 35 ++++++ types/ember__component/tslint.json | 4 + 10 files changed, 227 insertions(+) create mode 100644 types/ember__component/checkbox.d.ts create mode 100644 types/ember__component/helper.d.ts create mode 100644 types/ember__component/index.d.ts create mode 100644 types/ember__component/test/component.ts create mode 100644 types/ember__component/test/helper.ts create mode 100755 types/ember__component/test/lib/assert.ts create mode 100644 types/ember__component/text-area.d.ts create mode 100644 types/ember__component/text-field.d.ts create mode 100644 types/ember__component/tsconfig.json create mode 100644 types/ember__component/tslint.json 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": {} +} From 992b5b5f11f4c02fe18cc5b25d4b974e9314d7b0 Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 09:56:56 -0700 Subject: [PATCH 48/74] [ember] Refactor some private types into ghost modules (#28735) * [ember] refactor some private types into ghost modules * [ember] additional tests for low-level CP and Observable types * [ember] fix: add tests/core-object --- types/ember/-private-types/mixin.d.ts | 5 + types/ember/-private-types/object.d.ts | 28 +++ .../ember/-private-types/object/computed.d.ts | 34 +++ types/ember/-private-types/utils.d.ts | 14 ++ types/ember/index.d.ts | 73 +------ types/ember/test/access-modifier.ts | 7 + types/ember/test/component.ts | 3 + types/ember/test/core-object.ts | 198 ++++++++++++++++++ types/ember/test/lib/assert.ts | 2 +- types/ember/test/private/computed-tests.ts | 82 ++++++++ types/ember/test/private/observable-tests.ts | 175 ++++++++++++++++ .../test/techniques/properties-from-this.ts | 62 ++++++ types/ember/tsconfig.json | 9 +- 13 files changed, 627 insertions(+), 65 deletions(-) create mode 100644 types/ember/-private-types/mixin.d.ts create mode 100644 types/ember/-private-types/object.d.ts create mode 100644 types/ember/-private-types/object/computed.d.ts create mode 100644 types/ember/-private-types/utils.d.ts create mode 100644 types/ember/test/core-object.ts create mode 100644 types/ember/test/private/computed-tests.ts create mode 100644 types/ember/test/private/observable-tests.ts create mode 100644 types/ember/test/techniques/properties-from-this.ts 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..3f297d97bf --- /dev/null +++ b/types/ember/-private-types/utils.d.ts @@ -0,0 +1,14 @@ +/** + * 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] }; diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index cbdba8919e..64785c3db9 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 } from 'ember/-private-types/utils'; + import { EmberClassArguments, EmberClassConstructor, EmberInstanceArguments } from 'ember/-private-types/object'; + // Capitalization is intentional: this makes it much easier to re-export RSVP on // the Ember namespace. import Rsvp from 'rsvp'; @@ -42,52 +52,6 @@ declare module 'ember' { : F extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => any ? [A, B, C, D, E] : never; - /** - * Deconstructs computed properties into the types which would be returned by `.get()`. - */ - type UnwrapComputedPropertyGetter = - T extends Ember.ComputedProperty ? U : - T; - type UnwrapComputedPropertyGetters = { - [P in keyof T]: UnwrapComputedPropertyGetter; - }; - - type UnwrapComputedPropertySetter = - T extends Ember.ComputedProperty ? U : - T; - type UnwrapComputedPropertySetters = { - [P in keyof T]: UnwrapComputedPropertySetter; - }; - - /** - * Check that any arguments to `create()` match the type's properties. - * - * Accept any additional properties and add merge them into the instance. - */ - type EmberInstanceArguments = Partial & { - [key: string]: any; - }; - - /** - * Accept any additional properties and add merge them into the prototype. - */ - interface EmberClassArguments { - [key: string]: any; - } - - /** - * Map type `T` to a plain object hash with the identity mapping. - * - * Discards any additional object identity like the ability to `new()` up the class. - * The `new()` capability is added back later by merging `EmberClassConstructor` - * - * Implementation is carefully chosen for the reasons described in - * https://github.com/typed-ember/ember-typings/pull/29 - */ - type Objectify = Readonly; - - type Fix = { [K in keyof T]: T[K] }; - /** * Ember.Object.extend(...) accepts any number of mixins or literals. */ @@ -104,23 +68,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; 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..74eb860360 --- /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: keyof this) {} + protected fooDidChangeProtected(obj: this, propName: keyof this) {} + 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, K>): 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: keyof this, value: any, rev: number) => void)): void; + removeObserver(key: any, target: any, method?: any): void { + throw new Error("Method not implemented."); + } + getWithDefault(key: K, defaultValue: UnwrapComputedPropertyGetter): UnwrapComputedPropertyGetter { + throw new Error("Method not implemented."); + } + incrementProperty(keyName: ExtractPropertyNamesOfType, increment?: number): number { + throw new Error("Method not implemented."); + } + decrementProperty(keyName: ExtractPropertyNamesOfType, decrement?: number): number { + throw new Error("Method not implemented."); + } + toggleProperty(keyName: ExtractPropertyNamesOfType): boolean { + throw new Error("Method not implemented."); + } + cacheFor(key: K): UnwrapComputedPropertyGetter | undefined { + throw new Error("Method not implemented."); + } +} +const o = new DemoObservable(); + +/** + * get + */ +assertType(o.get('foo')); // $ExpectType string +assertType<[boolean, boolean]>(o.get('bar')); // $ExpectType [boolean, boolean] +assertType(o.get('baz')); // $ExpectType number | undefined + +/** + * incrementProperty, decrementProperty + */ +assertType(o.incrementProperty('baz')); // $ExpectType number +assertType(o.decrementProperty('baz')); // $ExpectType number +assertType(o.incrementProperty('baz', 3)); // $ExpectType number +assertType(o.decrementProperty('baz', 12)); // $ExpectType number +// non-numeric property case +assertType(o.incrementProperty('bar')); // $ExpectError +assertType(o.decrementProperty('bar')); // $ExpectError +// empty case +assertType(o.incrementProperty()); // $ExpectError +assertType(o.decrementProperty()); // $ExpectError + +/** + * toggleProperty + */ +o.toggleProperty('isFoo'); // $ExpectType boolean +o.toggleProperty(); // $ExpectError + +/** + * getWithDefault + */ +assertType(o.getWithDefault('foo', 'zzz')); // $ExpectType string +assertType<[boolean, boolean]>(o.getWithDefault('bar', [false, false])); // $ExpectType [boolean, boolean] +assertType(o.getWithDefault('baz', 10)); // $ExpectType number | undefined +// improper arguments cases +assertType(o.getWithDefault('baz', '10')); // $ExpectError +assertType(o.getWithDefault('baz')); // $ExpectError +assertType(o.getWithDefault()); // $ExpectError + +/** + * getProperties + */ +// ('foo', 'bar') +assertType<{ foo: string, bar: [boolean, boolean] }>(o.getProperties('foo', 'bar')); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// ['foo', 'bar'] +assertType<{ foo: string, bar: [boolean, boolean] }>(o.getProperties(['foo', 'bar'])); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// empty cases +assertType<{}>(o.getProperties()); // $ExpectType {} +assertType<{}>(o.getProperties([])); // $ExpectType {} +// property that doesn't exist +assertType(o.getProperties('jeanShorts', 'foo')); // $ExpectError +assertType(o.getProperties(['foo', 'jeanShorts'])); // $ExpectError + +/** + * set + */ +assertType(o.set('foo', 'abc')); // $ExpectType string +assertType<[boolean, boolean]>(o.set('bar', [false, false])); // $ExpectType [boolean, boolean] +assertType(o.set('baz', undefined)); // $ExpectType number | undefined +assertType(o.set('baz', 10)); // $ExpectType number | undefined +// property that doesn't exist +assertType(o.set('jeanShorts', 10)); // $ExpectError + +/** + * setProperties + */ +assertType<{ foo: string, bar: [boolean, boolean] }>(o.setProperties({ foo: 'abc', bar: [true, true] })); // $ExpectType { foo: string; bar: [boolean, boolean]; } +// empty case +assertType<{}>(o.setProperties({})); // $ExpectType {} +// property that doesn't exist +assertType(o.setProperties({ jeanShorts: 'under the pants' })); // $ExpectError + +/** + * notifyPropertyChange + */ +assertType(o.notifyPropertyChange('foo')); // $ExpectType DemoObservable +assertType(o.notifyPropertyChange('jeanShorts')); // $ExpectError diff --git a/types/ember/test/techniques/properties-from-this.ts b/types/ember/test/techniques/properties-from-this.ts new file mode 100644 index 0000000000..eef58009c3 --- /dev/null +++ b/types/ember/test/techniques/properties-from-this.ts @@ -0,0 +1,62 @@ +/** + * These tests validate that the method of pulling property types off of this + * continues to work. We use this technique in the critical Observable interface + * that serves to implement a lot of Ember.CoreObject's functionality + */ + +class BoxedProperty { + __getType: Get; + __setType: Set; +} + +type UnboxGetProperty = T extends BoxedProperty ? V : T; +type UnboxSetProperty = T extends BoxedProperty ? V : T; + +class GetAndSet { + get(key: K): UnboxGetProperty { + return this[key] as any; + } + set(key: K, newVal: UnboxSetProperty): UnboxSetProperty { + const rawVal: UnboxSetProperty = this[key] as any; + if (rawVal instanceof BoxedProperty) { + rawVal.__setType = newVal; + } + this[key] = newVal as any; + return newVal; + } +} + +class Foo123 extends GetAndSet { + // tslint:disable-next-line:no-inferrable-types + a: number; + b: [boolean, boolean]; + c: string; + cpA!: BoxedProperty; + constructor() { + super(); + this.a = 1; + this.b = [true, false]; + this.c = 'hello'; + } +} + +let f = new Foo123(); + +f.get('a'); // $ExpectType number +f.set('a'); // $ExpectError +f.set('a', '1'); // $ExpectError +f.set('a', 1); // $ExpectType number + +f.get('b'); // $ExpectType [boolean, boolean] +f.set('b', 1); // $ExpectError +f.set('b', []); // $ExpectError +f.set('b', [true]); // $ExpectError +f.set('b', [false, true]); // $ExpectType [boolean, boolean] +f.set('b', [false, true, false]); // $ExpectError + +f.get('c'); // $ExpectType string +f.set('c', '1'); // $ExpectType string + +f.get('cpA'); // $ExpectType string +f.set('cpA', ['newValue']); // $ExpectError +f.set('cpA', 'newValue'); // $ExpectType string diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index 74ec227219..6619ea0e47 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -20,7 +20,14 @@ }, "files": [ "index.d.ts", + "-private-types/utils.d.ts", + "-private-types/mixin.d.ts", + "-private-types/object.d.ts", + "-private-types/object/computed.d.ts", "test/lib/assert.ts", + "test/private/computed-tests.ts", + "test/private/observable-tests.ts", + "test/techniques/properties-from-this.ts", "test/access-modifier.ts", "test/application-instance.ts", "test/application.ts", @@ -30,9 +37,9 @@ "test/component.ts", "test/computed.ts", "test/controller.ts", + "test/core-object.ts", "test/create-negative.ts", "test/create.ts", - "test/create.ts", "test/detect-instance.ts", "test/detect.ts", "test/ember-tests.ts", From ec674c55ce3677d1922e353088e385053d8b1d45 Mon Sep 17 00:00:00 2001 From: Trevor Behlman Date: Thu, 13 Sep 2018 12:57:40 -0400 Subject: [PATCH 49/74] [three] add newly required argument (#28765) r92 removed the ability to call Color.getHSL() without passing a target object to copy the results to. The `three` type package currently targets r92 but is missing a definition for this argument. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). - [x] Provide a URL to documentation or source code which provides context for the suggested changes: - https://threejs.org/docs/index.html#api/en/math/Color.getHSL - https://github.com/mrdoob/three.js/blob/r92/src/math/Color.js#L356 - [ ] Increase the version number in the header if appropriate. - [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. --- types/three/test/math/test_unit_math.ts | 4 ++-- types/three/three-core.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/three/test/math/test_unit_math.ts b/types/three/test/math/test_unit_math.ts index b6c536085f..30e8691843 100644 --- a/types/three/test/math/test_unit_math.ts +++ b/types/three/test/math/test_unit_math.ts @@ -755,7 +755,7 @@ declare function equal(a: T, b: T, desc?: string): void; test( "getHSL", function () { var c = new THREE.Color( 0x80ffff ); - var hsl = c.getHSL(); + var hsl = c.getHSL( { h: 0, s: 0, l: 0 } ); ok( hsl.h == 0.5, "hue: " + hsl.h ); ok( hsl.s == 1.0, "saturation: " + hsl.s ); @@ -765,7 +765,7 @@ declare function equal(a: T, b: T, desc?: string): void; test( "setHSL", function () { var c = new THREE.Color(); c.setHSL(0.75, 1.0, 0.25); - var hsl = c.getHSL(); + var hsl = c.getHSL( { h: 0, s: 0, l: 0 } ); ok( hsl.h == 0.75, "hue: " + hsl.h ); ok( hsl.s == 1.00, "saturation: " + hsl.s ); diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index e62638c151..51fbee2a54 100755 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -3369,7 +3369,7 @@ export class Color { */ getHexString(): string; - getHSL(): HSL; + getHSL(target: HSL): HSL; /** * Returns the value of this color in CSS context style. From 142b2f5a1bdda33b498df989cb29895b0fb45478 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 13 Sep 2018 12:25:51 -0700 Subject: [PATCH 50/74] one final update to env-paths (#28819) --- types/env-paths/env-paths-tests.ts | 2 ++ types/env-paths/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 { From cb47b761316173eec29bb21a91b714fecde6557b Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 13 Sep 2018 12:31:58 -0700 Subject: [PATCH 51/74] changes the type of next to be a `Promise` in `koa-convert` (#28826) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). If changing an existing definition: - [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> - [ ] Increase the version number in the header if appropriate. - [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. The 'Koa.Middleware' format is `(ctx: Context, next: () => Promise)` so I've updated the accepted type here to match up. --- types/koa-convert/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 3c5bd3938d63c3cac2fa6da864a7bcc11a019fe3 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 13 Sep 2018 12:33:21 -0700 Subject: [PATCH 52/74] corrects the input/output type of `encode` (#28822) --- types/wif/index.d.ts | 4 ++-- types/wif/wif-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/wif/index.d.ts b/types/wif/index.d.ts index 21b4175905..aa610851d2 100644 --- a/types/wif/index.d.ts +++ b/types/wif/index.d.ts @@ -21,7 +21,7 @@ export function encodeRaw( ): Buffer; export function encode( - version: number | WIFReturn, + version: number, privateKey: Buffer, compressed: boolean -): Buffer; +): string; diff --git a/types/wif/wif-tests.ts b/types/wif/wif-tests.ts index b833d7b1f5..c112df4270 100644 --- a/types/wif/wif-tests.ts +++ b/types/wif/wif-tests.ts @@ -12,5 +12,5 @@ wif.decode(testString, 0); // $ExpectType Buffer wif.encodeRaw(1, testBuffer, true); -// $ExpectType Buffer +// $ExpectType string wif.encode(1, testBuffer, true); From 63c9cf4b94b4eebb5c0254eddd7fa2d4d302691b Mon Sep 17 00:00:00 2001 From: Fernando Alex Helwanger Date: Thu, 13 Sep 2018 16:35:56 -0300 Subject: [PATCH 53/74] [expo] Add missing PictureOptions props (#28860) --- types/expo/expo-tests.tsx | 24 ++++++++++++++++++++++++ types/expo/index.d.ts | 3 +++ 2 files changed, 27 insertions(+) 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 { From 8ec73d20ae14822f30797ac0e12acf969a343c0a Mon Sep 17 00:00:00 2001 From: Mike North Date: Thu, 13 Sep 2018 12:48:55 -0700 Subject: [PATCH 54/74] [ember] refine Ember.assign and Ember.merge types (#28690) * ember - refine Ember.assign and Ember.merge types * [ember] merge & assign - more test cases and reasonable type constraints for Mix * kick CI --- types/ember/index.d.ts | 15 +++++++++++---- types/ember/test/utils.ts | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 64785c3db9..cdf1c3962b 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -52,6 +52,12 @@ declare module 'ember' { : F extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => any ? [A, B, C, D, E] : never; + + 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. */ @@ -3114,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. */ @@ -3263,9 +3269,10 @@ declare module 'ember' { * Copy properties from a source object to a target object. * @deprecated Use Object.assign */ - function assign(target: T, source: U): T & U; - function assign(target: T, source1: U, source2: V): T & U & V; - function assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + function assign(target: T, source: U): Mix; + function assign(target: T, source1: U, source2: V): Mix3; + function assign(target: T, source1: U, source2: V, source3: W): Mix4; + /** * Polyfill for Object.create * @deprecated Use Object.create diff --git a/types/ember/test/utils.ts b/types/ember/test/utils.ts index 2a769dc2dc..1c10cd6776 100755 --- a/types/ember/test/utils.ts +++ b/types/ember/test/utils.ts @@ -127,3 +127,24 @@ function testTryInvoke() { // Reversed arg types Ember.tryInvoke(new Foo(), 'add', ['4', 3]); // $ExpectType undefined } + +(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 +}()); From b03b25c2234953cf69185161e62f823edf84d9b5 Mon Sep 17 00:00:00 2001 From: Greg Miller Date: Thu, 13 Sep 2018 15:50:10 -0400 Subject: [PATCH 55/74] [three] fix gltf-exporter (#28743) * fix-gltf-exporter-import * add test * remove formatting changes from auto-format --- .../test/examples/exporters/gltf-exporter.ts | 511 ++++++++++++++++++ types/three/three-gltfexporter.d.ts | 4 +- types/three/tsconfig.json | 1 + 3 files changed, 513 insertions(+), 3 deletions(-) create mode 100644 types/three/test/examples/exporters/gltf-exporter.ts diff --git a/types/three/test/examples/exporters/gltf-exporter.ts b/types/three/test/examples/exporters/gltf-exporter.ts new file mode 100644 index 0000000000..2a6e6f508e --- /dev/null +++ b/types/three/test/examples/exporters/gltf-exporter.ts @@ -0,0 +1,511 @@ +() => { + var container: HTMLElement; + var camera: THREE.PerspectiveCamera, + material: THREE.MeshStandardMaterial, + object: THREE.Object3D, + scene1: THREE.Scene, + renderer: THREE.WebGLRenderer; + var gridHelper: THREE.GridHelper, + sphere: THREE.Object3D, + waltHead: THREE.Object3D; + + var gltfExporter = new THREE.GLTFExporter(); + + var options = { + trs: true, + onlyVisible: true, + truncateDrawRange: true, + binary: true, + forceIndices: true, + forcePowerOfTwoTextures: true + }; + // gltfExporter.parse( + // scene1, + // function(result) { + // if (result instanceof ArrayBuffer) { + // saveArrayBuffer(result, "scene.glb"); + // } else { + // var output = JSON.stringify(result, null, 2); + // console.log(output); + // saveString(output, "scene.gltf"); + // } + // }, + // options + // ); + + var link = document.createElement("a"); + link.style.display = "none"; + document.body.appendChild(link); // Firefox workaround, see #6594 + + // function save(blob, filename) { + // link.href = URL.createObjectURL(blob); + // link.download = filename; + // link.click(); + + // // URL.revokeObjectURL( url ); breaks Firefox... + // } + + // function saveString(text, filename) { + // save(new Blob([text], { type: "text/plain" }), filename); + // } + + // function saveArrayBuffer(buffer, filename) { + // save( + // new Blob([buffer], { type: "application/octet-stream" }), + // filename + // ); + // } + + if (!Detector.webgl) Detector.addGetWebGLMessage(); + + init(); + animate(); + + function init() { + container = document.createElement("div"); + document.body.appendChild(container); + + scene1 = new THREE.Scene(); + scene1.name = "Scene1"; + + // --------------------------------------------------------------------- + // Perspective Camera + // --------------------------------------------------------------------- + camera = new THREE.PerspectiveCamera( + 45, + window.innerWidth / window.innerHeight, + 1, + 2000 + ); + camera.position.set(600, 400, 0); + + camera.name = "PerspectiveCamera"; + scene1.add(camera); + + // --------------------------------------------------------------------- + // Ambient light + // --------------------------------------------------------------------- + var light = new THREE.AmbientLight(0xffffff, 0.2); + light.name = "AmbientLight"; + scene1.add(light); + + // --------------------------------------------------------------------- + // DirectLight + // --------------------------------------------------------------------- + light = new THREE.DirectionalLight(0xffffff, 1); + light.position.set(1, 1, 0); + light.name = "DirectionalLight"; + scene1.add(light); + + // --------------------------------------------------------------------- + // Grid + // --------------------------------------------------------------------- + gridHelper = new THREE.GridHelper(2000, 20); + gridHelper.position.y = -50; + gridHelper.name = "Grid"; + scene1.add(gridHelper); + + // --------------------------------------------------------------------- + // Axes + // --------------------------------------------------------------------- + var axes = new THREE.AxesHelper(500); + axes.name = "AxesHelper"; + scene1.add(axes); + + // --------------------------------------------------------------------- + // Simple geometry with basic material + // --------------------------------------------------------------------- + // Icosahedron + var mapGrid = new THREE.TextureLoader().load("textures/UV_Grid_Sm.jpg"); + mapGrid.wrapS = mapGrid.wrapT = THREE.RepeatWrapping; + var material = new THREE.MeshBasicMaterial({ + color: 0xffffff, + map: mapGrid + }); + + object = new THREE.Mesh(new THREE.IcosahedronGeometry(75, 0), material); + object.position.set(-200, 0, 200); + object.name = "Icosahedron"; + scene1.add(object); + + // Octahedron + material = new THREE.MeshBasicMaterial({ + color: 0x0000ff, + wireframe: true + }); + object = new THREE.Mesh(new THREE.OctahedronGeometry(75, 1), material); + object.position.set(0, 0, 200); + object.name = "Octahedron"; + scene1.add(object); + + // Tetrahedron + material = new THREE.MeshBasicMaterial({ + color: 0xff0000, + transparent: true, + opacity: 0.5 + }); + + object = new THREE.Mesh(new THREE.TetrahedronGeometry(75, 0), material); + object.position.set(200, 0, 200); + object.name = "Tetrahedron"; + scene1.add(object); + + // --------------------------------------------------------------------- + // Buffered geometry primitives + // --------------------------------------------------------------------- + // Sphere + sphere = new THREE.Mesh( + new THREE.SphereBufferGeometry(70, 10, 10), + new THREE.MeshStandardMaterial({ + color: 0xffff00, + metalness: 0.5, + roughness: 1.0, + flatShading: true + }) + ); + sphere.position.set(0, 0, 0); + sphere.name = "Sphere"; + scene1.add(sphere); + + // Cylinder + object = new THREE.Mesh( + new THREE.CylinderBufferGeometry(10, 80, 100), + new THREE.MeshStandardMaterial({ + color: 0xff00ff, + flatShading: true + }) + ); + object.position.set(200, 0, 0); + object.name = "Cylinder"; + scene1.add(object); + + // TorusKnot + object = new THREE.Mesh( + new THREE.TorusKnotGeometry(50, 15, 40, 10), + new THREE.MeshStandardMaterial({ + color: 0xff0000, + roughness: 1 + }) + ); + object.position.set(-200, 0, 0); + object.name = "Cylinder"; + scene1.add(object); + + // --------------------------------------------------------------------- + // Hierarchy + // --------------------------------------------------------------------- + var mapWood = new THREE.TextureLoader().load( + "textures/hardwood2_diffuse.jpg" + ); + + object = new THREE.Mesh( + new THREE.BoxBufferGeometry(40, 100, 100), + new THREE.MeshStandardMaterial({ + map: mapWood, + side: THREE.DoubleSide + }) + ); + object.position.set(-200, 0, 400); + object.name = "Cube"; + scene1.add(object); + + var object2 = new THREE.Mesh( + new THREE.BoxBufferGeometry(40, 40, 40, 2, 2, 2), + material + ); + object2.position.set(0, 0, 50); + object2.rotation.set(0, 45, 0); + object2.name = "SubCube"; + object.add(object2); + + // --------------------------------------------------------------------- + // Groups + // --------------------------------------------------------------------- + var group1 = new THREE.Group(); + group1.name = "Group"; + scene1.add(group1); + + var group2 = new THREE.Group(); + group2.name = "subGroup"; + group2.position.set(0, 50, 0); + group1.add(group2); + + object2 = new THREE.Mesh( + new THREE.BoxBufferGeometry(30, 30, 30), + material + ); + object2.name = "Cube in group"; + object2.position.set(0, 0, 400); + group2.add(object2); + + // --------------------------------------------------------------------- + // Triangle Strip + // --------------------------------------------------------------------- + var geometry = new THREE.BufferGeometry(); + var positions = new Float32Array([ + 0, + 0, + 0, + 0, + 80, + 0, + 80, + 0, + 0, + 80, + 80, + 0, + 80, + 0, + 80, + 80, + 80, + 80 + ]); + + var colors = new Float32Array([ + 1, + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 1 + ]); + + geometry.addAttribute( + "position", + new THREE.BufferAttribute(positions, 3) + ); + geometry.addAttribute("color", new THREE.BufferAttribute(colors, 3)); + object = new THREE.Mesh( + geometry, + new THREE.MeshBasicMaterial({ + side: THREE.DoubleSide, + vertexColors: THREE.VertexColors + }) + ); + object.position.set(140, -40, -250); + // object.setDrawMode(THREE.TriangleStripDrawMode); + object.name = "Custom buffered"; + object.userData = { data: "customdata", list: [1, 2, 3, 4] }; + + scene1.add(object); + + // --------------------------------------------------------------------- + // Line Strip + // --------------------------------------------------------------------- + var geometry = new THREE.BufferGeometry(); + var numPoints = 100; + var positions = new Float32Array(numPoints * 3); + + for (var i = 0; i < numPoints; i++) { + positions[i * 3] = i; + positions[i * 3 + 1] = Math.sin(i / 2) * 20; + positions[i * 3 + 2] = 0; + } + + geometry.addAttribute( + "position", + new THREE.BufferAttribute(positions, 3) + ); + object = new THREE.Line( + geometry, + new THREE.LineBasicMaterial({ color: 0xffff00 }) + ); + object.position.set(-50, 0, -200); + scene1.add(object); + + // --------------------------------------------------------------------- + // Buffer geometry truncated (DrawRange) + // --------------------------------------------------------------------- + var geometry = new THREE.BufferGeometry(); + var numElements = 6; + var outOfRange = 3; + + var positions = new Float32Array((numElements + outOfRange) * 3); + var colors = new Float32Array((numElements + outOfRange) * 3); + + positions.set([ + 0, + 0, + 0, + 0, + 80, + 0, + 80, + 0, + 0, + 80, + 0, + 0, + 0, + 80, + 0, + 80, + 80, + 0 + ]); + + colors.set([1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1]); + + geometry.addAttribute( + "position", + new THREE.BufferAttribute(positions, 3) + ); + geometry.addAttribute("color", new THREE.BufferAttribute(colors, 3)); + geometry.setDrawRange(0, numElements); + + object = new THREE.Mesh( + geometry, + new THREE.MeshBasicMaterial({ + side: THREE.DoubleSide, + vertexColors: THREE.VertexColors + }) + ); + object.name = "Custom buffered truncated"; + object.position.set(340, -40, -200); + + scene1.add(object); + + // --------------------------------------------------------------------- + // Points + // --------------------------------------------------------------------- + var numPoints = 100; + var pointsArray = new Float32Array(numPoints * 3); + for (var i = 0; i < numPoints; i++) { + pointsArray[3 * i] = -50 + Math.random() * 100; + pointsArray[3 * i + 1] = Math.random() * 100; + pointsArray[3 * i + 2] = -50 + Math.random() * 100; + } + + var pointsGeo = new THREE.BufferGeometry(); + pointsGeo.addAttribute( + "position", + new THREE.BufferAttribute(pointsArray, 3) + ); + + var pointsMaterial = new THREE.PointsMaterial({ + color: 0xffff00, + size: 5 + }); + var points = new THREE.Points(pointsGeo, pointsMaterial); + points.name = "Points"; + points.position.set(-200, 0, -200); + scene1.add(points); + + // --------------------------------------------------------------------- + // Ortho camera + // --------------------------------------------------------------------- + var cameraOrtho = new THREE.OrthographicCamera( + window.innerWidth / -2, + window.innerWidth / 2, + window.innerHeight / 2, + window.innerHeight / -2, + 0.1, + 10 + ); + scene1.add(cameraOrtho); + cameraOrtho.name = "OrthographicCamera"; + + material = new THREE.MeshLambertMaterial({ + color: 0xffff00, + side: THREE.DoubleSide + }); + + object = new THREE.Mesh( + new THREE.CircleGeometry(50, 20, 0, Math.PI * 2), + material + ); + object.position.set(200, 0, -400); + scene1.add(object); + + object = new THREE.Mesh( + new THREE.RingGeometry(10, 50, 20, 5, 0, Math.PI * 2), + material + ); + object.position.set(0, 0, -400); + scene1.add(object); + + object = new THREE.Mesh( + new THREE.CylinderGeometry(25, 75, 100, 40, 5), + material + ); + object.position.set(-200, 0, -400); + scene1.add(object); + + // --------------------------------------------------------------------- + // Big red box hidden just for testing `onlyVisible` option + // --------------------------------------------------------------------- + material = new THREE.MeshBasicMaterial({ + color: 0xff0000 + }); + object = new THREE.Mesh( + new THREE.BoxBufferGeometry(200, 200, 200), + material + ); + object.position.set(0, 0, 0); + object.name = "CubeHidden"; + object.visible = false; + scene1.add(object); + + // --------------------------------------------------------------------- + // + // + var loader = new THREE.OBJLoader(); + loader.load("models/obj/walt/WaltHead.obj", function(obj) { + waltHead = obj; + waltHead.scale.multiplyScalar(1.5); + waltHead.position.set(400, 0, 0); + scene1.add(waltHead); + }); + + // + + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setPixelRatio(window.devicePixelRatio); + renderer.setSize(window.innerWidth, window.innerHeight); + + container.appendChild(renderer.domElement); + + // + + window.addEventListener("resize", onWindowResize, false); + } + + function onWindowResize() { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + + renderer.setSize(window.innerWidth, window.innerHeight); + } + + // + + function animate() { + requestAnimationFrame(animate); + + render(); + } + + function render() { + var timer = Date.now() * 0.0001; + + camera.position.x = Math.cos(timer) * 800; + camera.position.z = Math.sin(timer) * 800; + + camera.lookAt(scene1.position); + renderer.render(scene1, camera); + } +}; diff --git a/types/three/three-gltfexporter.d.ts b/types/three/three-gltfexporter.d.ts index 2bdba480a7..454f491b20 100644 --- a/types/three/three-gltfexporter.d.ts +++ b/types/three/three-gltfexporter.d.ts @@ -1,9 +1,7 @@ -import { Object3D } from "three"; +import { Object3D } from "./three-core"; export class GLTFExporter { constructor(); parse(input: Object3D, onCompleted: (gltf: object) => void, options: object): null; - } - diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index ff443f85f7..6a403c7ed4 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -56,6 +56,7 @@ "test/examples/ctm/ctmloader.ts", "test/examples/octree.ts", "test/examples/loaders/webgl_loader_obj_mtl.ts", + "test/examples/exporters/gltf-exporter.ts", "test/webvr/webvr.ts" ] } From 89bf834e02e8f16e5603c1cbb1c4654b31999e56 Mon Sep 17 00:00:00 2001 From: Mathias Remshardt Date: Thu, 13 Sep 2018 21:52:34 +0200 Subject: [PATCH 56/74] * Adds onBlur and onFocus event handlers to Input component (#28724) --- types/react-onsenui/index.d.ts | 2 ++ types/react-onsenui/react-onsenui-tests.tsx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 - +