From 5b98aceaf1b756c021af76b43b7cabf9f16790aa Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Mon, 23 Apr 2018 13:28:24 -0400 Subject: [PATCH 01/74] Adding pointcloud type for Plotly scatter type and sizemax for Marker --- types/plotly.js/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 9fbbeaa92f..12fe6e8e39 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.35 +// Type definitions for plotly.js 1.36 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -6,6 +6,7 @@ // taoqf // Dadstart // Jared Szechy +// Drew Diamantoukos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -354,7 +355,7 @@ export type Color = string | Array | Array Date: Mon, 23 Apr 2018 13:38:15 -0400 Subject: [PATCH 02/74] Added xy field for ScatterData, which is used by pointcloud --- types/plotly.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 12fe6e8e39..6b405d3e53 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -359,6 +359,7 @@ export interface ScatterData { x: Datum[] | Datum[][]; y: Datum[] | Datum[][]; z: Datum[] | Datum[][] | Datum[][][]; + xy: Float32Array; xaxis: string; yaxis: string; text: string | string[]; From 96cc727dd738f5e44cb84c08aba0185bdfc06d98 Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Fri, 25 May 2018 14:39:25 -0400 Subject: [PATCH 03/74] Added colorbar and gradient types to ScatterMarker. Fixed cmax/cmin being boolean when they are numbers. Allowed colorscale to be array of arrays per spec. --- types/plotly.js/index.d.ts | 71 ++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index c4cd97b0ba..47ac596cca 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.37 +// Type definitions for plotly.js 1.38 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -411,10 +411,10 @@ export interface ScatterData { export interface ScatterMarker { symbol: string | string[]; // Drawing.symbolList color: Color | number[]; - colorscale: string | string[]; + colorscale: string | string[] | Array>; cauto: boolean; - cmax: boolean; - cmin: boolean; + cmax: number; + cmin: number; autocolorscale: boolean; reversescale: boolean; opacity: number | number[]; @@ -426,8 +426,67 @@ export interface ScatterMarker { sizemode: 'diameter' | 'area'; showscale: boolean; line: Partial; - colorbar: {}; // TODO - gradient: {}; // TODO + colorbar: { + thicknessmode: 'fraction' | 'pixels', + thickness: number, + lenmode: 'fraction' | 'pixels', + len: number, + x: number, + xanchor: 'left' | 'center' | 'right', + xpad: number, + y: number, + yanchor: 'top' | 'middle' | 'bottom', + ypad: number, + outlinecolor: Color, + outlinewidth: number, + bordercolor: Color, + borderwidth: Color, + bgcolor: Color, + tickmode: 'auto' | 'linear' | 'array', + nticks: number, + tick0: number | string, + dtick: number | string, + tickvals: Datum[] | Datum[][] | Datum[][][] | TypedArray, + ticktext: Datum[] | Datum[][] | Datum[][][] | TypedArray, + ticks: 'outside' | 'inside' | '', + ticklen: number, + tickwidth: number, + tickcolor: Color, + showticklabels: boolean, + tickfont: { + family: string, + size: number, + color: Color, + }, + tickangle: number, + tickformat: string, + tickformatstops: { + dtickrange: any[], + value: string, + }, + tickprefix: string, + showtickprefix: 'all' | 'first' | 'last' | 'none', + ticksuffix: string, + showticksuffix: 'all' | 'first' | 'last' | 'none', + separatethousands: boolean, + exponentformat: 'none' | 'e' | 'E' | 'power' | 'SI' | 'B', + showexponent: 'all' | 'first' | 'last' | 'none', + title: string, + titlefont: { + family: string, + size: number, + color: Color, + }, + titleside: 'right' | 'top' | 'bottom', + tickvalssrc: any, + ticktextsrc: any, + }; + gradient: { + type: 'radial' | 'horizontal' | 'vertical' | 'none', + color: Color, + typesrc: any, + colorsrc: any, + }; } export interface ScatterMarkerLine { From 4f1cbed8d7fb37e0bd203b3490d2686894c7e82f Mon Sep 17 00:00:00 2001 From: Atrahasis Date: Sat, 23 Jun 2018 13:02:39 +0200 Subject: [PATCH 04/74] [types/three]: Update Object3D based classes. --- types/three/index.d.ts | 1 + types/three/three-core.d.ts | 256 +++++++++++++++++-------------- types/three/three-lensflare.d.ts | 27 ++++ 3 files changed, 171 insertions(+), 113 deletions(-) create mode 100644 types/three/three-lensflare.d.ts diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 0e10f9caea..8a83de8cae 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -34,6 +34,7 @@ export * from "./three-examples"; export * from "./three-fbxloader"; export * from "./three-FirstPersonControls"; export * from "./three-gltfexporter"; +export * from "./three-lensflare"; export * from "./three-maskpass"; export * from "./three-mtlloader"; export * from "./three-objloader"; diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 67b3929cc2..7dbdf08bb2 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -451,13 +451,23 @@ export class Camera extends Object3D { */ projectionMatrix: Matrix4; + isCamera: true; + + copy(source: this, recursive?: boolean): this; + getWorldDirection(target: Vector3): Vector3; + updateMatrixWorld(force: boolean): void; + + clone(): Camera; + } export class CubeCamera extends Object3D { constructor(near?: number, far?: number, cubeResolution?: number); + type: "CubeCamera"; + renderTarget: WebGLRenderTargetCube; /** @@ -465,7 +475,7 @@ export class CubeCamera extends Object3D { */ updateCubeMap(renderer: Renderer, scene: Scene): void; - update(renderer: Renderer, scene: Scene): void; + update(renderer: WebGLRenderer, scene: Scene): void; } /** @@ -488,8 +498,12 @@ export class OrthographicCamera extends Camera { */ constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number); + type: "OrthographicCamera"; + + isOrthographicCamera: true; + zoom: number; - view: { + view: null | { enabled: boolean, fullWidth: number, fullHeight: number, @@ -556,6 +570,10 @@ export class PerspectiveCamera extends Camera { */ constructor(fov?: number, aspect?: number, near?: number, far?: number); + type: "PerspectiveCamera"; + + isPerspectiveCamera: true; + zoom: number; /** @@ -579,7 +597,7 @@ export class PerspectiveCamera extends Camera { far: number; focus: number; - view: { + view: null | { enabled: boolean, fullWidth: number, fullHeight: number, @@ -596,6 +614,7 @@ export class PerspectiveCamera extends Camera { getEffectiveFOV(): number; getFilmWidth(): number; getFilmHeight(): number; + /** * Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups. * For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this: @@ -651,6 +670,8 @@ export class PerspectiveCamera extends Camera { export class StereoCamera extends Camera { constructor(); + type: "StereoCamera"; + aspect: number; eyeSep: number; cameraL: PerspectiveCamera; @@ -1070,6 +1091,7 @@ export class DirectGeometry extends EventDispatcher { * @source src/core/EventDispatcher.js */ export class EventDispatcher { + /** * Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object. */ @@ -1552,7 +1574,7 @@ export class Object3D extends EventDispatcher { /** * Object's parent in the scene graph. */ - parent: Object3D; + parent: Object3D | null; /** * Array with object's children. @@ -1634,13 +1656,13 @@ export class Object3D extends EventDispatcher { /** * An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned. */ - userData: any; + userData: {[key: string]: any}; /** * Used to check whether this or derived classes are Object3Ds. Default is true. * You should not change this, as it is used internally for optimisation. */ - isObject3D: boolean; + isObject3D: true; /** * Calls before rendering object @@ -1654,9 +1676,7 @@ export class Object3D extends EventDispatcher { onAfterRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera, geometry: Geometry | BufferGeometry, material: Material, group: Group) => void; - /** - * - */ + static DefaultUp: Vector3; static DefaultMatrixAutoUpdate: boolean; @@ -1665,6 +1685,8 @@ export class Object3D extends EventDispatcher { */ applyMatrix(matrix: Matrix4): void; + applyQuaternion(quaternion: Quaternion): this; + /** * */ @@ -1690,56 +1712,56 @@ export class Object3D extends EventDispatcher { * @param axis A normalized vector in object space. * @param angle The angle in radians. */ - rotateOnAxis(axis: Vector3, angle: number): Object3D; + rotateOnAxis(axis: Vector3, angle: number): this; /** * Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent. * @param axis A normalized vector in object space. * @param angle The angle in radians. */ - rotateOnWorldAxis(axis: Vector3, angle: number): Object3D; + rotateOnWorldAxis(axis: Vector3, angle: number): this; /** * * @param angle */ - rotateX(angle: number): Object3D; + rotateX(angle: number): this; /** * * @param angle */ - rotateY(angle: number): Object3D; + rotateY(angle: number): this; /** * * @param angle */ - rotateZ(angle: number): Object3D; + rotateZ(angle: number): this; /** * @param axis A normalized vector in object space. * @param distance The distance to translate. */ - translateOnAxis(axis: Vector3, distance: number): Object3D; + translateOnAxis(axis: Vector3, distance: number): this; /** * Translates object along x axis by distance. * @param distance Distance. */ - translateX(distance: number): Object3D; + translateX(distance: number): this; /** * Translates object along y axis by distance. * @param distance Distance. */ - translateY(distance: number): Object3D; + translateY(distance: number): this; /** * Translates object along z axis by distance. * @param distance Distance. */ - translateZ(distance: number): Object3D; + translateZ(distance: number): this; /** * Updates the vector from local space to world space. @@ -1757,39 +1779,38 @@ export class Object3D extends EventDispatcher { * Rotates object to face point in space. * @param vector A world vector to look at. */ - lookAt(vector: Vector3): void; - lookAt(x: number, y: number, z: number): void; + lookAt(vector: Vector3 | number, y?: number, z?: number): void; /** * Adds object as child of this object. */ - add(...object: Object3D[]): void; + add(...object: Object3D[]): this; /** * Removes object as child of this object. */ - remove(...object: Object3D[]): void; + remove(...object: Object3D[]): this; /** - * Searches through the object's children and returns the first with a matching id, optionally recursive. + * Searches through the object's children and returns the first with a matching id. * @param id Unique number of the object instance */ - getObjectById(id: number): Object3D; + getObjectById(id: number): Object3D | undefined; /** - * Searches through the object's children and returns the first with a matching name, optionally recursive. + * Searches through the object's children and returns the first with a matching name. * @param name String to match to the children's Object3d.name property. */ - getObjectByName(name: string): Object3D; + getObjectByName(name: string): Object3D | undefined; - getObjectByProperty( name: string, value: string ): Object3D; + getObjectByProperty( name: string, value: string ): Object3D | undefined; getWorldPosition(target: Vector3): Vector3; getWorldQuaternion(target: Quaternion): Quaternion; getWorldScale(target: Vector3): Vector3; getWorldDirection(target: Vector3): Vector3; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; traverse(callback: (object: Object3D) => any): void; @@ -1809,7 +1830,7 @@ export class Object3D extends EventDispatcher { toJSON(meta?: { geometries: any, materials: any, textures: any, images: any }): any; - clone(recursive?: boolean): this; + clone(recursive?: boolean): Object3D; /** * @@ -1821,11 +1842,11 @@ export class Object3D extends EventDispatcher { export interface Intersection { distance: number; - distanceToRay: number; + distanceToRay?: number; point: Vector3; - index: number; - face: Face3; - faceIndex: number; + index?: number; + face?: Face3 | null; + faceIndex?: number; object: Object3D; } @@ -5148,20 +5169,26 @@ export class QuaternionLinearInterpolant extends Interpolant { export class Bone extends Object3D { constructor(); + isBone: true; + type: "Bone"; } export class Group extends Object3D { constructor(); + type: "Group"; + isGroup: true; } export class LOD extends Object3D { constructor(); - levels: any[]; + type: "LOD"; + + levels: {distance: number, object: Object3D}[]; addLevel(object: Object3D, distance?: number): void; getObjectForDistance(distance: number): Object3D; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; update(camera: Camera): void; toJSON(meta: any): any; @@ -5171,32 +5198,6 @@ export class LOD extends Object3D { objects: any[]; } -export interface LensFlareProperty { - texture: Texture; // Texture - size: number; // size in pixels (-1 = use texture.width) - distance: number; // distance (0-1) from light source (0=at light source) - x: number; - y: number; - z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back - scale: number; // scale - rotation: number; // rotation - opacity: number; // opacity - color: Color; // color - blending: Blending; -} - -export class LensFlare extends Object3D { - constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); - - lensFlares: LensFlareProperty[]; - positionScreen: Vector3; - customUpdateCallback: (object: LensFlare) => void; - - add(object: Object3D): void; - add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; - updateLensFlares(): void; -} - export class Line extends Object3D { constructor( geometry?: Geometry | BufferGeometry, @@ -5205,10 +5206,14 @@ export class Line extends Object3D { ); geometry: Geometry|BufferGeometry; - material: Material; // LineDashedMaterial or LineBasicMaterial or ShaderMaterial + material: LineBasicMaterial | LineDashedMaterial | ShaderMaterial; + + type: "Line"; + isLine: true; computeLineDistances(): this; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + clone(): Line; } /** @@ -5228,20 +5233,24 @@ export class LineSegments extends Line { ); } +type MeshMaterial = MeshBasicMaterial | MeshLambertMaterial | MeshPhongMaterial | MeshDepthMaterial | MeshStandardMaterial | MeshPhysicalMaterial | MeshNormalMaterial | MeshFaceMaterial | ShaderMaterial; + export class Mesh extends Object3D { - constructor(geometry?: Geometry | BufferGeometry, material?: Material | Material[]); + constructor(geometry?: Geometry | BufferGeometry, material?: MeshMaterial | MeshMaterial[]); geometry: Geometry|BufferGeometry; - material: Material | Material[]; + material: MeshMaterial | MeshMaterial[]; drawMode: TrianglesDrawModes; morphTargetInfluences?: number[]; morphTargetDictionary?: { [key: string]: number; }; - isMesh: boolean; + isMesh: true; + type: "Mesh"; setDrawMode(drawMode: TrianglesDrawModes): void; updateMorphTargets(): void; - getMorphTargetIndexByName(name: string): number; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + copy(source: this, recursive?: boolean): this; + clone(): Mesh; } /** @@ -5257,9 +5266,12 @@ export class Points extends Object3D { */ constructor( geometry?: Geometry | BufferGeometry, - material?: Material + material?: PointsMaterial | ShaderMaterial ); + type: "Points"; + isPoints: true; + /** * An instance of Geometry or BufferGeometry, where each vertex designates the position of a particle in the system. */ @@ -5268,9 +5280,11 @@ export class Points extends Object3D { /** * An instance of Material, defining the object's appearance. Default is a PointsMaterial with randomised colour. */ - material: Material; + material: PointsMaterial | ShaderMaterial; - raycast(raycaster: Raycaster, intersects: any): void; + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + + clone(): Points; } /** @@ -5326,10 +5340,15 @@ export class SkinnedMesh extends Mesh { export class Sprite extends Object3D { constructor(material?: Material); - geometry: BufferGeometry; - material: SpriteMaterial; + type: "Sprite"; + isSprite: true; - raycast(raycaster: Raycaster, intersects: any): void; + material: SpriteMaterial; + center: Vector2; + + raycast(raycaster: Raycaster, intersects: Intersection[]): void; + clone(): Sprite; + copy(source: this, recursive?: boolean): this; } /** @@ -6362,13 +6381,6 @@ export class WebGLStencilBuffer { reset(): void; } -// Renderers / WebGL / Plugins ///////////////////////////////////////////////////////////////////// -export class LensFlarePlugin { - constructor(renderer: WebGLRenderer, flares: any[]); - - render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; -} - export class SpritePlugin { constructor(renderer: WebGLRenderer, sprites: any[]); @@ -6383,6 +6395,8 @@ export class SpritePlugin { export class Scene extends Object3D { constructor(); + type: "Scene"; + /** * A fog instance defining the type of fog that affects everything rendered in the scene. Default is null. */ @@ -6393,8 +6407,9 @@ export class Scene extends Object3D { */ overrideMaterial: Material | null; autoUpdate: boolean; - background: any; + background: null | Color | Texture; + copy(source: this, recursive?: boolean): this; toJSON(meta?: any): any; } @@ -6643,38 +6658,42 @@ export namespace ShapeUtils { export class Audio extends Object3D { constructor(listener: AudioListener); + type: "Audio"; - type: string; context: AudioContext; - source: AudioBufferSourceNode; gain: GainNode; autoplay: boolean; + buffer: null | Audio; + loop: boolean; startTime: number; + offset: number; playbackRate: number; - hasPlaybackControl: boolean; isPlaying: boolean; + hasPlaybackControl: boolean; sourceType: string; + source: AudioBufferSourceNode; filters: any[]; getOutput(): GainNode; - setNodeSource(audioNode: AudioBufferSourceNode): Audio; - setBuffer(audioBuffer: AudioBuffer): Audio; - play(): Audio; - pause(): Audio; - stop(): Audio; - connect(): Audio; - disconnect(): Audio; - getFilters(): any[]; - setFilter(value: any[]): Audio; - getFilter(): any; - setFilter(filter: any): Audio; - setPlaybackRate(value: number): Audio; - getPlaybackRate(): number; + setNodeSource(audioNode: AudioBufferSourceNode): this; + setMediaElementSource(mediaElement: MediaElementAudioSourceNode): this; + setBuffer(audioBuffer: AudioBuffer): this; + play(): this; onEnded(): void; + pause(): this; + stop(): this; + connect(): this; + disconnect(): this; + getFilters(): any[]; + setFilter(value: any[]): this; + getFilter(): any; + setFilter(filter: any): this; + setPlaybackRate(value: number): this; + getPlaybackRate(): number; getLoop(): boolean; setLoop(value: boolean): void; getVolume(): number; - setVolume(value: number): Audio; + setVolume(value: number): this; /** * @deprecated Use {@link AudioLoader} instead. */ @@ -6727,9 +6746,10 @@ export class PositionalAudio extends Audio { export class AudioListener extends Object3D { constructor(); - type: string; + type: "AudioListener"; context: AudioContext; gain: GainNode; + filter: null | any; getInput(): GainNode; removeFilter(): void; @@ -6737,6 +6757,7 @@ export class AudioListener extends Object3D { getFilter(): any; setMasterVolume(value: number): void; getMasterVolume(): number; + updateMatrixWorld(force?: boolean): void; } // Extras / Core ///////////////////////////////////////////////////////////////////// @@ -7498,7 +7519,7 @@ export class ArrowHelper extends Object3D { setDirection(dir: Vector3): void; setLength(length: number, headLength?: number, headWidth?: number): void; - setColor(hex: number): void; + setColor(color: Color): void; } export class AxesHelper extends LineSegments { @@ -7533,11 +7554,14 @@ export class CameraHelper extends LineSegments { } export class DirectionalLightHelper extends Object3D { - constructor(light: Light, size?: number, color?: Color | string | number); + constructor(light: DirectionalLight, size?: number, color?: Color | string | number); - light: Light; + light: DirectionalLight; lightPlane: Line; - color: Color | string | number; + targetPlane: Line; + color: Color | string | number | undefined; + matrix: Matrix4; + matrixAutoUpdate: boolean; dispose(): void; update(): void; @@ -7568,22 +7592,26 @@ export class GridHelper extends LineSegments { } export class HemisphereLightHelper extends Object3D { - constructor(light: Light, sphereSize: number); + constructor(light: HemisphereLight, size: number, color?: Color | number | string); - light: Light; - colors: Color[]; - lightSphere: Mesh; + light: HemisphereLight; + matrix: Matrix4; + matrixAutoUpdate: boolean; + material: MeshBasicMaterial; + + color: Color | string | number | undefined; dispose(): void; update(): void; } export class PointLightHelper extends Object3D { - constructor(light: Light, sphereSize?: number, color?: Color | string | number); + constructor(light: PointLight, sphereSize?: number, color?: Color | string | number); - light: Light; - sphereSize: number; - color: Color | string | number; + light: PointLight; + color: Color | string | number | undefined; + matrix: Matrix4; + matrixAutoUpdate: boolean; dispose(): void; update(): void; @@ -7603,7 +7631,9 @@ export class SpotLightHelper extends Object3D { constructor(light: Light, color?: Color | string | number); light: Light; - color: Color | string | number; + matrix: Matrix4; + matrixAutoUpdate: boolean; + color: Color | string | number | undefined; dispose(): void; update(): void; diff --git a/types/three/three-lensflare.d.ts b/types/three/three-lensflare.d.ts new file mode 100644 index 0000000000..f9a0967099 --- /dev/null +++ b/types/three/three-lensflare.d.ts @@ -0,0 +1,27 @@ +import {Mesh, Camera, Scene, WebGLRenderer, Blending, Vector3, Color, Shader, Texture, BufferGeometry} from "./three-core"; + +export class LensFlare extends Mesh { + + constructor(); + + type: 'LensFlare'; + frustumCulled: false; + renderOrder: number; + + addElement(element: LensFlareElement): this; + onBeforeRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera) => void; + dispose(): void; + + isLensflare: true; + +} + +export class LensFlareElement { + constructor(texture: Texture, size?: number, distance?: number, color?: Color); + texture: Texture; + size: number; + distance: number; + color: Color; + static Shader: Shader; + static Geometry: BufferGeometry +} From 981b19dcd0b25d1ce5a321a65122652e864f01e5 Mon Sep 17 00:00:00 2001 From: Atrahasis Date: Sat, 23 Jun 2018 13:22:23 +0200 Subject: [PATCH 05/74] Dispatch Object3D updates in physijs and update examples. --- types/physijs/index.d.ts | 4 +-- types/three/test/canvas/canvas_materials.ts | 6 ++-- types/three/test/webgl/webgl_lensflares.ts | 39 ++------------------- 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/types/physijs/index.d.ts b/types/physijs/index.d.ts index 86ea3b9f38..79698c4697 100644 --- a/types/physijs/index.d.ts +++ b/types/physijs/index.d.ts @@ -143,8 +143,8 @@ declare namespace Physijs { onSimulationResume():void; removeConstraint(constraint:Constraint):void; execute(cmd:string, params:any):void; - add(object:THREE.Object3D):void; - remove(object:THREE.Object3D):void; + add(object:THREE.Object3D):this; + remove(object:THREE.Object3D):this; setFixedTimeStep(fixedTimeStep:number):void; setGravity(gravity:THREE.Vector3):void; simulate(timeStep?:number, maxSubSteps?:number):boolean; diff --git a/types/three/test/canvas/canvas_materials.ts b/types/three/test/canvas/canvas_materials.ts index 9af83aff5d..dd0ebbf601 100644 --- a/types/three/test/canvas/canvas_materials.ts +++ b/types/three/test/canvas/canvas_materials.ts @@ -45,7 +45,9 @@ var geometry2 = new THREE.SphereGeometry(100, 14, 7); - var materials: THREE.Material[] = [ + type MeshMaterial = THREE.MeshBasicMaterial | THREE.MeshFaceMaterial | THREE.MeshLambertMaterial | THREE.MeshDepthMaterial | THREE.MeshNormalMaterial; + + var materials: MeshMaterial[] = [ new THREE.MeshBasicMaterial({ color: 0x00ffff, wireframe: true, side: THREE.DoubleSide }), new THREE.MeshBasicMaterial({ color: 0xff0000, blending: THREE.AdditiveBlending }), @@ -199,4 +201,4 @@ } -} \ No newline at end of file +} diff --git a/types/three/test/webgl/webgl_lensflares.ts b/types/three/test/webgl/webgl_lensflares.ts index 1d42762571..e07329e539 100644 --- a/types/three/test/webgl/webgl_lensflares.ts +++ b/types/three/test/webgl/webgl_lensflares.ts @@ -99,18 +99,11 @@ var flareColor = new THREE.Color(0xffffff); flareColor.setHSL(h, s, l + 0.5); - var lensFlare = new THREE.LensFlare(textureFlare0, 700, 0.0, THREE.AdditiveBlending, flareColor); + var lensFlare = new THREE.LensFlare(); - lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending); - lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending); - lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending); + lensFlare.addElement(new THREE.LensFlareElement(textureFlare2, 512, 0.0)); + lensFlare.addElement(new THREE.LensFlareElement(textureFlare3, 512, 0.0)); - lensFlare.add(textureFlare3, 60, 0.6, THREE.AdditiveBlending); - lensFlare.add(textureFlare3, 70, 0.7, THREE.AdditiveBlending); - lensFlare.add(textureFlare3, 120, 0.9, THREE.AdditiveBlending); - lensFlare.add(textureFlare3, 70, 1.0, THREE.AdditiveBlending); - - lensFlare.customUpdateCallback = lensFlareUpdateCallback; lensFlare.position.copy(light.position); scene.add(lensFlare); @@ -143,32 +136,6 @@ // - function lensFlareUpdateCallback(object: THREE.LensFlare) { - - var f: number, fl = object.lensFlares.length; - var flare: THREE.LensFlareProperty; - var vecX = -object.positionScreen.x * 2; - var vecY = -object.positionScreen.y * 2; - - - for (f = 0; f < fl; f++) { - - flare = object.lensFlares[f]; - - flare.x = object.positionScreen.x + vecX * flare.distance; - flare.y = object.positionScreen.y + vecY * flare.distance; - - flare.rotation = 0; - - } - - object.lensFlares[2].y += 0.025; - object.lensFlares[3].rotation = object.positionScreen.x * 0.5 + THREE.Math.degToRad(45); - - } - - // - function onWindowResize(event: Event) { renderer.setSize(window.innerWidth, window.innerHeight); From bb9654d431a3af234437bb1087b60590c8b2ab32 Mon Sep 17 00:00:00 2001 From: Spencer Elliott Date: Sat, 23 Jun 2018 12:48:14 -0700 Subject: [PATCH 06/74] Make tapable HookInterceptor fields optional Remove the `name` field, which is unused. --- types/tapable/index.d.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/types/tapable/index.d.ts b/types/tapable/index.d.ts index 7fd0e6f08d..14d7cf9587 100644 --- a/types/tapable/index.d.ts +++ b/types/tapable/index.d.ts @@ -247,7 +247,7 @@ export interface Tap { export class Hook { constructor(...args: any[]); taps: any[]; - interceptors: any[]; + interceptors: HookInterceptor[]; call: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any; promise:(arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => Promise; callAsync: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any; @@ -271,12 +271,11 @@ export class AsyncSeriesBailHook extends Hook extends Hook {} export class HookInterceptor { - call: (...args: any[]) => void; - loop: (...args: any[]) => void; - tap: (tap: Tap) => void; - register: (tap: Tap) => Tap | undefined; - context: boolean; - name: string; + call?: (...args: any[]) => void; + loop?: (...args: any[]) => void; + tap?: (tap: Tap) => void; + register?: (tap: Tap) => Tap | undefined; + context?: boolean; } /** A HookMap is a helper class for a Map with Hooks */ From a3a2238ecf3884ed77ddeee597c9e100847ef73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Roucheray?= Date: Sun, 24 Jun 2018 20:35:28 +0200 Subject: [PATCH 07/74] Increase the definition surface of videojs types --- types/video.js/index.d.ts | 64 +++++++++++++++++++++++--------- types/video.js/video.js-tests.ts | 23 ++++++++++-- 2 files changed, 66 insertions(+), 21 deletions(-) diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index 5ba14c022d..de0c2ad543 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -6,6 +6,7 @@ // Christoph Wagner // Gio Freitas // Grzegorz Błaszczyk +// Stéphane Roucheray // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // The Video.js API allows you to interact with the video through @@ -19,6 +20,7 @@ export as namespace videojs; declare namespace videojs { const getComponent: typeof Component.getComponent; const registerComponent: typeof Component.registerComponent; + const getPlugin: typeof Plugin.getPlugin; interface PlayerOptions { techOrder?: string[]; @@ -53,15 +55,27 @@ declare namespace videojs { height: number; } - class Component { + class EventTarget { + addEventListener(type: string | string[], callback: (eventObject: Event) => void): void; + dispatchEvent(event: string | Event | { [key: string]: any }): void; + off(type?: string | string[], callback?: (eventObject: Event) => void): void; + on(type: string | string[], callback: (eventObject: Event) => void): void; + one(type: string | string[], callback: (eventObject: Event) => void): void; + removeEventListener(type?: string | string[], callback?: (eventObject: Event) => void): void; + trigger(event: string | Event | { [key: string]: any }): void; + } + + class Component extends EventTarget { constructor(player: Player, options: any); - static getComponent(name: 'Player'|'player'): typeof Player; - static getComponent(name: 'Component'|'component' | string): typeof Component; - static registerComponent(name: string, ComponentToRegister: typeof Component): typeof Component; + static getComponent(name: 'Player' | 'player'): Player; + static getComponent(name: 'Button' | 'button'): Button; + static getComponent(name: 'Component' | 'component' | string): Component; + static registerComponent(name: string, ComponentToRegister: Component): Component; - $(selector: string, context?: string|Element): Element; - $$(selector: string, context?: string|Element): NodeList; + $(selector: string, context?: string | Element): Element; + $$(selector: string, context?: string | Element): NodeList; + addChild(child: string | Component, optionsopt?: any, indexopt?: number): Component; addClass(classToAdd: string): void; blur(): void; cancelAnimationFrame(id: number): number; @@ -70,31 +84,28 @@ declare namespace videojs { clearTimeout(timeoutId: number): number; contentEl(): Element; createEl(tagNameopt?: string, properties?: any, attributes?: any): Element; - currentDimension(widthOrHeight: 'width'|'height'): number; + currentDimension(widthOrHeight: 'width' | 'height'): number; currentDimensions(): Dimensions; currentHeight(): number; currentWidth(): number; - dimension(widthOrHeight: 'width'|'height'): number; - dimension(widthOrHeight: 'width'|'height', num: string|number, skipListenersopt?: boolean): void; - dimensions(width: string|number, height: string|number): void; + dimension(widthOrHeight: 'width' | 'height'): number; + dimension(widthOrHeight: 'width' | 'height', num: string | number, skipListenersopt?: boolean): void; + dimensions(width: string | number, height: string | number): void; dispose(): void; el(): Element; enableTouchActivity(): void; focus(): void; - getAttribute(attribute: string): string|null; - getChild(name: string): Component|undefined; - getChildById(id: string): Component|undefined; + getAttribute(attribute: string): string | null; + getChild(name: string): Component | undefined; + getChildById(id: string): Component | undefined; hasClass(classToCheck: string): boolean; - height(): number|string; - height(num: number|string, skipListeners?: boolean): void; + height(): number | string; + height(num: number | string, skipListeners?: boolean): void; hide(): void; id(): string; initChildren(): void; localize(key: string, tokens?: string[], defaultValue?: string): string; name(): string; - off(eventName?: string, callback?: (eventObject: Event) => void): void; - on(eventName: string, callback: (eventObject: Event) => void): void; - one(eventName: string, callback: (eventObject: Event) => void): void; options(obj: any): any; player(): Player; ready(callback: (this: this) => void): this; @@ -112,6 +123,11 @@ declare namespace videojs { width(num: number, skipListeners?: number): void; } + class Button extends Component { + controlText(textopt?: string, elopt?: Element): string; + createControlTextEl(elopt: Element): Element; + } + class Player extends Component { autoplay(value?: boolean): string; addRemoteTextTrack(options: {}, manualCleanup?: boolean): HTMLTrackElement; @@ -144,6 +160,18 @@ declare namespace videojs { width(num: number): void; } + class Plugin { + static deregisterPlugin(name: string): void; + static getPlugin(name: string): Plugin; + static getPlugins(namesopt?: string[]): { [key: string]: Plugin }; + static getPluginVersion(name: string): string; + static isBasic(plugin: Plugin | (() => void)): boolean; + static registerPlugin(name: string, plugin: Plugin | (() => void)): void; + dispose(): void; + getEventHash(hashopt: any): any; + version(): string; + } + namespace dom { function appendContent(element: Element, content: any): Element; } diff --git a/types/video.js/video.js-tests.ts b/types/video.js/video.js-tests.ts index 287b804e14..68a138f433 100644 --- a/types/video.js/video.js-tests.ts +++ b/types/video.js/video.js-tests.ts @@ -14,9 +14,9 @@ videojs("example_video_1").ready(function() { this.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }); this.src([ - { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, - { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, - { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } + { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, + { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, + { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } ]); const whereYouAt: number = this.currentTime(); @@ -79,3 +79,20 @@ function testEvents(myPlayer: videojs.Player) { // Removes all listeners. myPlayer.off(); } + +function testComponents() { + let component = videojs.getComponent('Component'); + component = videojs.Component.getComponent('Component'); + + const button = videojs.getComponent('Button'); + button.controlText('Button Text'); + const player = videojs.getComponent('Player'); + player.play(); +} + +function testPlugin() { + let plugin = videojs.getPlugin('plugin_name'); + plugin = videojs.getPlugin('plugin_name'); + + plugin.dispose(); +} From d762c0b513d1c428f31b9cba0d392d185a0feb24 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 25 Jun 2018 08:51:29 +0200 Subject: [PATCH 08/74] Make constructor argument optional --- types/webpack-sources/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack-sources/index.d.ts b/types/webpack-sources/index.d.ts index 7eecb45c60..49ee96f8c7 100644 --- a/types/webpack-sources/index.d.ts +++ b/types/webpack-sources/index.d.ts @@ -154,7 +154,7 @@ export class ReplaceSource extends Source implements SourceAndMapMixin { _name: string; replacements: any[][]; - constructor(source: Source, name: string); + constructor(source: Source, name?: string); replace(start: number, end: number, newValue: string): void; From 5172762f69853c34755aa3734cd23d78e9fd3412 Mon Sep 17 00:00:00 2001 From: David Gasperoni Date: Mon, 25 Jun 2018 12:49:43 +0200 Subject: [PATCH 09/74] Specific declarations in PreparedStatement>execute The execute methods of PreparedStatement object lacked the specific return types. Before they simply returned void, now the adhere to the IProcedureResult interface. --- types/mssql/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index 272abb5e39..5910cd2b00 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -311,8 +311,10 @@ export declare class PreparedStatement extends events.EventEmitter { public output(name: string, type: (() => ISqlType) | ISqlType): PreparedStatement; public prepare(statement?: string): Promise; public prepare(statement?: string, callback?: (err?: Error) => void): PreparedStatement; - public execute(values: Object): Promise; - public execute(values: Object, callback: (err?: Error) => void): Request; + public execute(values: Object): Promise>; + public execute(values: Object): Promise>; + public execute(values: Object, callback: (err?: Error, result?: IProcedureResult) => void): Request; + public execute(values: Object, callback: (err?: Error, result?: IProcedureResult) => void): Request; public unprepare(): Promise; public unprepare(callback: (err?: Error) => void): PreparedStatement; } From 93f9c528171ce61639f44af2cf9ab44978c4f966 Mon Sep 17 00:00:00 2001 From: David Gasperoni Date: Mon, 25 Jun 2018 13:03:08 +0200 Subject: [PATCH 10/74] Add contributor to definitions authors --- types/mssql/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index 5910cd2b00..109a515515 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -1,6 +1,12 @@ // Type definitions for mssql 4.0.5 // Project: https://www.npmjs.com/package/mssql -// Definitions by: COLSA Corporation , Ben Farr , Vitor Buzinaro , Matt Richardson , Jørgen Elgaard Larsen , Peter Keuter +// Definitions by: COLSA Corporation +// Ben Farr +// Vitor Buzinaro +// Matt Richardson +// Jørgen Elgaard Larsen +// Peter Keuter +// David Gasperoni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 883e0733c02153e5dc647571256a3d028ec2b08a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 13 Jun 2018 13:24:04 -0700 Subject: [PATCH 11/74] Fix module augmentation support for mocha --- types/mocha/index.d.ts | 512 +++++++++++++++---------- types/mocha/lib/interfaces/common.d.ts | 109 ------ types/mocha/lib/ms.d.ts | 17 - types/mocha/tsconfig.json | 2 - 4 files changed, 320 insertions(+), 320 deletions(-) delete mode 100644 types/mocha/lib/interfaces/common.d.ts delete mode 100644 types/mocha/lib/ms.d.ts diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index 5f0aa3baf6..8708c8902b 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -9,9 +9,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -export = Mocha; -export as namespace Mocha; - /** * Mocha API * @@ -2623,234 +2620,365 @@ declare namespace Mocha { // #endregion } -declare global { - // #region Test interface augmentations +// #region Test interface augmentations - /** - * Triggers root suite execution. - * - * - _Only available if flag --delay is passed into Mocha._ - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#runWithSuite - */ - function run(): void; +/** + * Triggers root suite execution. + * + * - _Only available if flag --delay is passed into Mocha._ + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#runWithSuite + */ +declare function run(): void; - /** - * Execute before running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#before - */ - var before: Mocha.HookFunction; +/** + * Execute before running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#before + */ +declare var before: Mocha.HookFunction; - /** - * Execute before running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#before - */ - var suiteSetup: Mocha.HookFunction; +/** + * Execute before running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#before + */ +declare var suiteSetup: Mocha.HookFunction; - /** - * Execute after running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#after - */ - var after: Mocha.HookFunction; +/** + * Execute after running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#after + */ +declare var after: Mocha.HookFunction; - /** - * Execute after running tests. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#after - */ - var suiteTeardown: Mocha.HookFunction; +/** + * Execute after running tests. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#after + */ +declare var suiteTeardown: Mocha.HookFunction; - /** - * Execute before each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#beforeEach - */ - var beforeEach: Mocha.HookFunction; +/** + * Execute before each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#beforeEach + */ +declare var beforeEach: Mocha.HookFunction; - /** - * Execute before each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#beforeEach - */ - var setup: Mocha.HookFunction; +/** + * Execute before each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#beforeEach + */ +declare var setup: Mocha.HookFunction; - /** - * Execute after each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#afterEach - */ - var afterEach: Mocha.HookFunction; +/** + * Execute after each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#afterEach + */ +declare var afterEach: Mocha.HookFunction; - /** - * Execute after each test case. - * - * - _Only available when invoked via the mocha CLI._ - * - * @see https://mochajs.org/api/global.html#afterEach - */ - var teardown: Mocha.HookFunction; +/** + * Execute after each test case. + * + * - _Only available when invoked via the mocha CLI._ + * + * @see https://mochajs.org/api/global.html#afterEach + */ +declare var teardown: Mocha.HookFunction; - /** - * Describe a "suite" containing nested suites and tests. - * - * - _Only available when invoked via the mocha CLI._ - */ - var describe: Mocha.SuiteFunction; +/** + * Describe a "suite" containing nested suites and tests. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var describe: Mocha.SuiteFunction; - /** - * Describe a "suite" containing nested suites and tests. - * - * - _Only available when invoked via the mocha CLI._ - */ - var context: Mocha.SuiteFunction; +/** + * Describe a "suite" containing nested suites and tests. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var context: Mocha.SuiteFunction; - /** - * Describe a "suite" containing nested suites and tests. - * - * - _Only available when invoked via the mocha CLI._ - */ - var suite: Mocha.SuiteFunction; +/** + * Describe a "suite" containing nested suites and tests. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var suite: Mocha.SuiteFunction; - /** - * Pending suite. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xdescribe: Mocha.PendingSuiteFunction; +/** + * Pending suite. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xdescribe: Mocha.PendingSuiteFunction; - /** - * Pending suite. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xcontext: Mocha.PendingSuiteFunction; +/** + * Pending suite. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xcontext: Mocha.PendingSuiteFunction; - /** - * Describes a test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var it: Mocha.TestFunction; +/** + * Describes a test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var it: Mocha.TestFunction; - /** - * Describes a test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var specify: Mocha.TestFunction; +/** + * Describes a test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var specify: Mocha.TestFunction; - /** - * Describes a test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var test: Mocha.TestFunction; +/** + * Describes a test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var test: Mocha.TestFunction; - /** - * Describes a pending test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xit: Mocha.PendingTestFunction; +/** + * Describes a pending test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xit: Mocha.PendingTestFunction; - /** - * Describes a pending test case. - * - * - _Only available when invoked via the mocha CLI._ - */ - var xspecify: Mocha.PendingTestFunction; +/** + * Describes a pending test case. + * + * - _Only available when invoked via the mocha CLI._ + */ +declare var xspecify: Mocha.PendingTestFunction; - // #endregion Test interface augmentations +// #endregion Test interface augmentations - // #region Reporter augmentations +// #region Reporter augmentations - // Forward declaration for `HTMLLIElement` from lib.dom.d.ts. - // Required by Mocha.reporters.HTML. - // NOTE: Mocha *must not* have a direct dependency on DOM types. +// Forward declaration for `HTMLLIElement` from lib.dom.d.ts. +// Required by Mocha.reporters.HTML. +// NOTE: Mocha *must not* have a direct dependency on DOM types. +// tslint:disable-next-line no-empty-interface +interface HTMLLIElement { } + +// Augments the DOM `Window` object when lib.dom.d.ts is loaded. +// tslint:disable-next-line no-empty-interface +interface Window extends Mocha.MochaGlobals { } + +declare namespace NodeJS { + // Forward declaration for `NodeJS.EventEmitter` from node.d.ts. + // Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite. + // NOTE: Mocha *must not* have a direct dependency on @types/node. // tslint:disable-next-line no-empty-interface - interface HTMLLIElement { } + interface EventEmitter { } - // Augments the DOM `Window` object when lib.dom.d.ts is loaded. + // Augments NodeJS's `global` object when node.d.ts is loaded // tslint:disable-next-line no-empty-interface - interface Window extends Mocha.MochaGlobals { } + interface Global extends Mocha.MochaGlobals { } +} - namespace NodeJS { - // Forward declaration for `NodeJS.EventEmitter` from node.d.ts. - // Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite. - // NOTE: Mocha *must not* have a direct dependency on @types/node. - // tslint:disable-next-line no-empty-interface - interface EventEmitter { } +// #endregion Reporter augmentations - // Augments NodeJS's `global` object when node.d.ts is loaded - // tslint:disable-next-line no-empty-interface - interface Global extends Mocha.MochaGlobals { } - } +// #region Browser augmentations - // #endregion Reporter augmentations - - // #region Browser augmentations +/** + * Mocha global. + * + * - _Only supported in the browser._ + */ +declare const mocha: BrowserMocha; +interface BrowserMocha extends Mocha { /** - * Mocha global. + * Function to allow assertion libraries to throw errors directly into mocha. + * This is useful when running tests in a browser because window.onerror will + * only receive the 'message' attribute of the Error. * * - _Only supported in the browser._ */ - const mocha: BrowserMocha; - - interface BrowserMocha extends Mocha { - /** - * Function to allow assertion libraries to throw errors directly into mocha. - * This is useful when running tests in a browser because window.onerror will - * only receive the 'message' attribute of the Error. - * - * - _Only supported in the browser._ - */ - throwError(err: any): never; - - /** - * Setup mocha with the given settings options. - * - * - _Only supported in the browser._ - */ - setup(opts?: Mocha.Interface | MochaSetupOptions): this; - } + throwError(err: any): never; /** - * Options to pass to `mocha.setup` in the browser. + * Setup mocha with the given settings options. + * + * - _Only supported in the browser._ */ - interface MochaSetupOptions extends Mocha.MochaOptions { - // TODO: This does not seem to be supported according to the source. Should it be removed? - require?: string[]; - fullTrace?: boolean; - } + setup(opts?: Mocha.Interface | MochaSetupOptions): this; +} + +/** + * Options to pass to `mocha.setup` in the browser. + */ +interface MochaSetupOptions extends Mocha.MochaOptions { + /** @deprecated This is not used by Mocha. Use `files` instead. */ + require?: string[]; + fullTrace?: boolean; +} + +// #endregion Browser augmentations + +// #region Deprecations + +/** @deprecated use `Mocha.Done` instead. */ +type MochaDone = Mocha.Done; + +/** @deprecated use `Mocha.ReporterConstructor` instead. */ +type ReporterConstructor = Mocha.ReporterConstructor; + +// #endregion Deprecations + +declare module "mocha" { + export = Mocha; +} + +declare module "mocha/lib/ms" { + export = milliseconds; + /** + * Parse the given `str` and return milliseconds. + * + * @see {@link https://mochajs.org/api/module-milliseconds.html} + * @see {@link https://mochajs.org/api/module-milliseconds.html#~parse} + */ + function milliseconds(val: string): number; + + /** + * Format for `ms`. + * + * @see {@link https://mochajs.org/api/module-milliseconds.html} + * @see {@link https://mochajs.org/api/module-milliseconds.html#~format} + */ + function milliseconds(val: number): string; +} + +declare module "mocha/lib/interfaces/common" { + export = common; + + function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions; + + namespace common { + interface CommonFunctions { + /** + * This is only present if flag --delay is passed into Mocha. It triggers + * root suite execution. + */ + runWithSuite(suite: Mocha.Suite): () => void; + + /** + * Execute before running tests. + */ + before(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute before running tests. + */ + before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after running tests. + */ + after(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after running tests. + */ + after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute before each test case. + */ + beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute before each test case. + */ + beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after each test case. + */ + afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; + + /** + * Execute after each test case. + */ + afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; + + suite: SuiteFunctions; + test: TestFunctions; + } + + interface CreateOptions { + /** Title of suite */ + title: string; + + /** Suite function */ + fn?: (this: Mocha.Suite) => void; + + /** Is suite pending? */ + pending?: boolean; + + /** Filepath where this Suite resides */ + file?: string; + + /** Is suite exclusive? */ + isOnly?: boolean; + } + + interface SuiteFunctions { + /** + * Create an exclusive Suite; convenience function + */ + only(opts: CreateOptions): Mocha.Suite; - // #endregion Browser augmentations + /** + * Create a Suite, but skip it; convenience function + */ + skip(opts: CreateOptions): Mocha.Suite; - // #region Deprecations + /** + * Creates a suite. + */ + create(opts: CreateOptions): Mocha.Suite; + } - /** @deprecated use `Mocha.Done` instead. */ - type MochaDone = Mocha.Done; + interface TestFunctions { + /** + * Exclusive test-case. + */ + only(mocha: Mocha, test: Mocha.Test): Mocha.Test; - /** @deprecated use `Mocha.ReporterConstructor` instead. */ - type ReporterConstructor = Mocha.ReporterConstructor; + /** + * Pending test case. + */ + skip(title: string): void; - // #endregion Deprecations + /** + * Number of retry attempts + */ + retries(n: number): void; + } + } } diff --git a/types/mocha/lib/interfaces/common.d.ts b/types/mocha/lib/interfaces/common.d.ts deleted file mode 100644 index 9756482354..0000000000 --- a/types/mocha/lib/interfaces/common.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import Mocha = require("../../"); - -export = common; - -declare function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions; - -declare namespace common { - interface CommonFunctions { - /** - * This is only present if flag --delay is passed into Mocha. It triggers - * root suite execution. - */ - runWithSuite(suite: Mocha.Suite): () => void; - - /** - * Execute before running tests. - */ - before(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute before running tests. - */ - before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after running tests. - */ - after(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after running tests. - */ - after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute before each test case. - */ - beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute before each test case. - */ - beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after each test case. - */ - afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void; - - /** - * Execute after each test case. - */ - afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void; - - suite: SuiteFunctions; - test: TestFunctions; - } - - interface CreateOptions { - /** Title of suite */ - title: string; - - /** Suite function */ - fn?: (this: Mocha.Suite) => void; - - /** Is suite pending? */ - pending?: boolean; - - /** Filepath where this Suite resides */ - file?: string; - - /** Is suite exclusive? */ - isOnly?: boolean; - } - - interface SuiteFunctions { - /** - * Create an exclusive Suite; convenience function - */ - only(opts: CreateOptions): Mocha.Suite; - - /** - * Create a Suite, but skip it; convenience function - */ - skip(opts: CreateOptions): Mocha.Suite; - - /** - * Creates a suite. - */ - create(opts: CreateOptions): Mocha.Suite; - } - - interface TestFunctions { - /** - * Exclusive test-case. - */ - only(mocha: Mocha, test: Mocha.Test): Mocha.Test; - - /** - * Pending test case. - */ - skip(title: string): void; - - /** - * Number of retry attempts - */ - retries(n: number): void; - } -} diff --git a/types/mocha/lib/ms.d.ts b/types/mocha/lib/ms.d.ts deleted file mode 100644 index 3b89a55fc5..0000000000 --- a/types/mocha/lib/ms.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export = milliseconds; - -/** - * Parse the given `str` and return milliseconds. - * - * @see {@link https://mochajs.org/api/module-milliseconds.html} - * @see {@link https://mochajs.org/api/module-milliseconds.html#~parse} - */ -declare function milliseconds(val: string): number; - -/** - * Format for `ms`. - * - * @see {@link https://mochajs.org/api/module-milliseconds.html} - * @see {@link https://mochajs.org/api/module-milliseconds.html#~format} - */ -declare function milliseconds(val: number): string; diff --git a/types/mocha/tsconfig.json b/types/mocha/tsconfig.json index f26091927f..6e88356fe4 100644 --- a/types/mocha/tsconfig.json +++ b/types/mocha/tsconfig.json @@ -19,8 +19,6 @@ }, "files": [ "index.d.ts", - "lib/ms.d.ts", - "lib/interfaces/common.d.ts", "mocha-tests.ts" ] } \ No newline at end of file From 1ffbaa945294da3ace273b721b004122910c42f9 Mon Sep 17 00:00:00 2001 From: Stephen Mathieson Date: Tue, 26 Jun 2018 16:50:09 -0400 Subject: [PATCH 12/74] add types for test-listen https://github.com/zeit/test-listen --- types/test-listen/index.d.ts | 15 +++++++++++++++ types/test-listen/test-listen-tests.ts | 25 +++++++++++++++++++++++++ types/test-listen/tsconfig.json | 23 +++++++++++++++++++++++ types/test-listen/tslint.json | 1 + 4 files changed, 64 insertions(+) create mode 100644 types/test-listen/index.d.ts create mode 100644 types/test-listen/test-listen-tests.ts create mode 100644 types/test-listen/tsconfig.json create mode 100644 types/test-listen/tslint.json diff --git a/types/test-listen/index.d.ts b/types/test-listen/index.d.ts new file mode 100644 index 0000000000..0bf7c00dd8 --- /dev/null +++ b/types/test-listen/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for test-listen 1.1 +// Project: https://github.com/zeit/test-listen +// Definitions by: Stephen Mathieson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Server } from "net"; + +declare function testListen(srv: Server, hostname?: string): Promise; + +declare namespace testListen {} + +export = testListen; diff --git a/types/test-listen/test-listen-tests.ts b/types/test-listen/test-listen-tests.ts new file mode 100644 index 0000000000..1161772e09 --- /dev/null +++ b/types/test-listen/test-listen-tests.ts @@ -0,0 +1,25 @@ +import * as http from 'http'; +import * as testListen from 'test-listen'; + +const test = async (): Promise => { + const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => { + res.write('hello'); + res.end(); + }); + + const addr = await testListen(server); + console.log(addr); +}; + +const testWithHostname = async (): Promise => { + const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => { + res.write('hello'); + res.end(); + }); + + const addr = await testListen(server, '127.0.0.1'); + console.log(addr); +}; + +test(); +testWithHostname(); diff --git a/types/test-listen/tsconfig.json b/types/test-listen/tsconfig.json new file mode 100644 index 0000000000..2a2d45987e --- /dev/null +++ b/types/test-listen/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", + "test-listen-tests.ts" + ] +} diff --git a/types/test-listen/tslint.json b/types/test-listen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/test-listen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f4d9372af74ab4c58202de9e67529092111c64f9 Mon Sep 17 00:00:00 2001 From: "d.rogozhny@gmail.com" Date: Wed, 27 Jun 2018 13:04:03 +0300 Subject: [PATCH 13/74] Add type declarations for mongodb-memory-server --- types/mongodb-memory-server/index.d.ts | 153 ++++++++++++++++++ .../mongodb-memory-server-tests.ts | 15 ++ types/mongodb-memory-server/tsconfig.json | 23 +++ types/mongodb-memory-server/tslint.json | 1 + 4 files changed, 192 insertions(+) create mode 100644 types/mongodb-memory-server/index.d.ts create mode 100644 types/mongodb-memory-server/mongodb-memory-server-tests.ts create mode 100644 types/mongodb-memory-server/tsconfig.json create mode 100644 types/mongodb-memory-server/tslint.json diff --git a/types/mongodb-memory-server/index.d.ts b/types/mongodb-memory-server/index.d.ts new file mode 100644 index 0000000000..41b072e484 --- /dev/null +++ b/types/mongodb-memory-server/index.d.ts @@ -0,0 +1,153 @@ +// Type definitions for mongodb-memory-server 1.8 +// Project: https://github.com/nodkz/mongodb-memory-server +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { ChildProcess } from "child_process"; + +import MongoMemoryServer = _MongoMemoryServer.MongoMemoryServer; +import MongoInstance = _MongoInstance.MongodbInstance; +import MongoBinary = _MongoBinary.MongoBinary; + +export default MongoMemoryServer; +export { MongoMemoryServer, MongoInstance, MongoBinary }; + +// exports from the ./util/MongoBinary.js.flow file +declare namespace _MongoBinary { + interface MongoBinaryCache { + [version: string]: string; + } + + interface MongoBinaryOpts { + version?: string; + downloadDir?: string; + platform?: string; + arch?: string; + debug?: boolean | ((...args: any[]) => any); + } + + // disable error for a class with all static functions, + // so the TypeScript declaration would map the implementation with flow types for easier support. + // tslint:disable-next-line:no-unnecessary-class + class MongoBinary { + static cache: MongoBinaryCache; + + static getPath(opts?: MongoBinaryOpts): Promise; + static hasValidBinPath(files: string[]): boolean; + } +} + +// exports from the ./util/MongoInstance.js.flow file +declare namespace _MongoInstance { + interface MongodOps { + // instance options + instance: { + port: number, + storageEngine?: string, + dbPath: string, + debug?: boolean | ((...args: any[]) => any), + }; + + // mongo binary options + binary?: _MongoBinary.MongoBinaryOpts; + + // child process spawn options + spawn?: { + cwd?: string, + env?: object, + argv0?: string, + stdio?: string | any[], + detached?: boolean, + uid?: number, + gid?: number, + shell?: boolean | string, + }; + + debug?: boolean | ((...args: any[]) => any); + } + + class MongodbInstance { + static childProcessList: ChildProcess[]; + + opts: MongodOps; + debug: ((...args: any[]) => any); + childProcess: ChildProcess; + killerProcess: ChildProcess; + instanceReady: ((...args: any[]) => any); + instanceFailed: ((...args: any[]) => any); + + static run(opts: MongodOps): Promise; + + constructor(opts: MongodOps); + + prepareCommandArgs(): string[]; + run(): Promise; + kill(): Promise; + getPid(): number | undefined; + _launchMongod(mongoBin: string): ChildProcess; + _launchKiller(parentPid: number, childPid: number): ChildProcess; + errorHandler(err: string): void; + closeHandler(code: number): void; + stderrHandler(message: string | Buffer): void; + stdoutHandler(message: string | Buffer): void; + } +} + +// exports from the MongoMemoryServer.js.flow file +declare namespace _MongoMemoryServer { + interface MongoMemoryServerOptsT { + instance: { + port?: number, + dbPath?: string, + dbName?: string, + storageEngine?: string, + debug?: boolean | ((...args: any[]) => any), + }; + binary: { + version?: string, + downloadDir?: string, + platform?: string, + arch?: string, + debug?: boolean | ((...args: any[]) => any), + }; + debug?: boolean; + spawn: any; + autoStart?: boolean; + } + + interface MongoInstanceDataT { + port: number; + dbPath: string; + dbName: string; + uri: string; + storageEngine: string; + instance: _MongoInstance.MongodbInstance; + childProcess: ChildProcess; + tmpDir?: { + name: string, + removeCallback: ((...args: any[]) => any), + }; + } + + class MongoMemoryServer { + isRunning: boolean; + runningInstance: Promise | undefined; + opts: MongoMemoryServerOptsT; + debug: ((...args: any[]) => any); + + constructor(opts?: Partial); + + start(): Promise; + _startUpInstance(): Promise; + stop(): Promise; + getInstanceData(): Promise; + getUri(otherDbName?: string | boolean): Promise; + getConnectionString(otherDbName?: string | boolean): Promise; + getPort(): Promise; + getDbPath(): Promise; + getDbName(): Promise; + } +} diff --git a/types/mongodb-memory-server/mongodb-memory-server-tests.ts b/types/mongodb-memory-server/mongodb-memory-server-tests.ts new file mode 100644 index 0000000000..62abb2651b --- /dev/null +++ b/types/mongodb-memory-server/mongodb-memory-server-tests.ts @@ -0,0 +1,15 @@ +import MongodbMemoryServer from 'mongodb-memory-server'; + +// Simple server start example from https://www.npmjs.com/package/mongodb-memory-server +async function simpleServerStart() { + const mongod = new MongodbMemoryServer(); + + const uri = await mongod.getConnectionString(); + const port = await mongod.getPort(); + const dbPath = await mongod.getDbPath(); + const dbName = await mongod.getDbName(); + + // you may stop mongod manually + mongod.stop(); + // or it will be stopped automatically when you exit from script +} diff --git a/types/mongodb-memory-server/tsconfig.json b/types/mongodb-memory-server/tsconfig.json new file mode 100644 index 0000000000..29046ccb01 --- /dev/null +++ b/types/mongodb-memory-server/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", + "mongodb-memory-server-tests.ts" + ] +} diff --git a/types/mongodb-memory-server/tslint.json b/types/mongodb-memory-server/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mongodb-memory-server/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b72ddac07b722413a43dba577019184e7b859317 Mon Sep 17 00:00:00 2001 From: Stephen Mathieson Date: Wed, 27 Jun 2018 10:09:05 -0400 Subject: [PATCH 14/74] remove empty namespace hack --- types/test-listen/index.d.ts | 2 -- types/test-listen/test-listen-tests.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/types/test-listen/index.d.ts b/types/test-listen/index.d.ts index 0bf7c00dd8..741ffa0695 100644 --- a/types/test-listen/index.d.ts +++ b/types/test-listen/index.d.ts @@ -10,6 +10,4 @@ import { Server } from "net"; declare function testListen(srv: Server, hostname?: string): Promise; -declare namespace testListen {} - export = testListen; diff --git a/types/test-listen/test-listen-tests.ts b/types/test-listen/test-listen-tests.ts index 1161772e09..c5bc189ee8 100644 --- a/types/test-listen/test-listen-tests.ts +++ b/types/test-listen/test-listen-tests.ts @@ -1,5 +1,5 @@ import * as http from 'http'; -import * as testListen from 'test-listen'; +import testListen = require('test-listen'); const test = async (): Promise => { const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => { From f6962ca7ea3dd2ecd51182aba1ad36f0289468de Mon Sep 17 00:00:00 2001 From: threesquared Date: Wed, 27 Jun 2018 15:54:29 +0100 Subject: [PATCH 15/74] Add definitions for triplesec --- types/triplesec/index.d.ts | 31 ++++++++++++++++++++++++++++++ types/triplesec/triplesec-tests.ts | 27 ++++++++++++++++++++++++++ types/triplesec/tsconfig.json | 22 +++++++++++++++++++++ types/triplesec/tslint.json | 1 + 4 files changed, 81 insertions(+) create mode 100644 types/triplesec/index.d.ts create mode 100644 types/triplesec/triplesec-tests.ts create mode 100644 types/triplesec/tsconfig.json create mode 100644 types/triplesec/tslint.json diff --git a/types/triplesec/index.d.ts b/types/triplesec/index.d.ts new file mode 100644 index 0000000000..afe0191d51 --- /dev/null +++ b/types/triplesec/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for triplesec 3.0 +// Project: https://github.com/keybase/triplesec +// Definitions by: Ben Speakman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface WordArray { + sigBytes: number; + words: number[]; + to_hex: () => string; +} + +export interface Arguments { + data: Buffer, + key: Buffer, + progress_hook?: (progress: Progress) => void; +} + +export interface Progress { + what: string; + i: number; + total: number; +} + +export function encrypt(arg: Arguments, cb: (err: Error | null, buff: Buffer | null) => void): void; +export function decrypt(arg: Arguments, cb: (err: Error | null, buff: Buffer | null) => void): void; + +export namespace prng { + export function generate(n: number, cb: (words: WordArray) => void): void; +} \ No newline at end of file diff --git a/types/triplesec/triplesec-tests.ts b/types/triplesec/triplesec-tests.ts new file mode 100644 index 0000000000..2f7037ed72 --- /dev/null +++ b/types/triplesec/triplesec-tests.ts @@ -0,0 +1,27 @@ +import * as triplesec from 'triplesec'; + +triplesec.encrypt({ + data: new Buffer('data'), + key: new Buffer('key') +}, (err, buff) => { + if (err === null) { + console.log(buff); + } else { + console.log(err); + } +}); + +triplesec.decrypt({ + data: new Buffer('data'), + key: new Buffer('key') +}, (err, buff) => { + if (err === null) { + console.log(buff); + } else { + console.log(err); + } +}); + +triplesec.prng.generate(24, words => { + console.log(words.to_hex()); // $ExpectType string +}); diff --git a/types/triplesec/tsconfig.json b/types/triplesec/tsconfig.json new file mode 100644 index 0000000000..adf3d9b2f7 --- /dev/null +++ b/types/triplesec/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "triplesec-tests.ts" + ] +} diff --git a/types/triplesec/tslint.json b/types/triplesec/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/triplesec/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 7e86b2925f6bb8fdb0d7cb6346e6bb8a5bf0021e Mon Sep 17 00:00:00 2001 From: Stephen Mathieson Date: Wed, 27 Jun 2018 11:18:43 -0400 Subject: [PATCH 16/74] trigger travis build From 1e4f8657edff0721b7aa97bf33ee191a25573e25 Mon Sep 17 00:00:00 2001 From: "d.rogozhny@gmail.com" Date: Wed, 27 Jun 2018 18:20:26 +0300 Subject: [PATCH 17/74] Set definitions by value --- types/mongodb-memory-server/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongodb-memory-server/index.d.ts b/types/mongodb-memory-server/index.d.ts index 41b072e484..bfb14ed97d 100644 --- a/types/mongodb-memory-server/index.d.ts +++ b/types/mongodb-memory-server/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for mongodb-memory-server 1.8 // Project: https://github.com/nodkz/mongodb-memory-server -// Definitions by: My Self +// Definitions by: Dmitry Rogozhny // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 From 255fe736371689c02a90ec454581e5347b92cd79 Mon Sep 17 00:00:00 2001 From: "d.rogozhny@gmail.com" Date: Wed, 27 Jun 2018 20:14:12 +0300 Subject: [PATCH 18/74] Trigger travis-ci build --- types/mongodb-memory-server/mongodb-memory-server-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongodb-memory-server/mongodb-memory-server-tests.ts b/types/mongodb-memory-server/mongodb-memory-server-tests.ts index 62abb2651b..4bb869011e 100644 --- a/types/mongodb-memory-server/mongodb-memory-server-tests.ts +++ b/types/mongodb-memory-server/mongodb-memory-server-tests.ts @@ -11,5 +11,5 @@ async function simpleServerStart() { // you may stop mongod manually mongod.stop(); - // or it will be stopped automatically when you exit from script + // or it will be stopped automatically when you exit from script. } From a8368993986b6e7f94fddf28b906b2a28d60ad15 Mon Sep 17 00:00:00 2001 From: Ben Speakman Date: Wed, 27 Jun 2018 18:26:29 +0100 Subject: [PATCH 19/74] Add strictFunctionTypes --- types/triplesec/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/triplesec/tsconfig.json b/types/triplesec/tsconfig.json index adf3d9b2f7..cf233cc7e0 100644 --- a/types/triplesec/tsconfig.json +++ b/types/triplesec/tsconfig.json @@ -6,6 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, + "strictFunctionTypes": true, "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ From 4ff486952ca69b9535a60584d89c06a2cb812c65 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 27 Jun 2018 11:03:09 -0700 Subject: [PATCH 20/74] Reorganiziong Item subclasses to be in alphabetical order --- types/office-js/index.d.ts | 1995 ++++++++++++++++++------------------ 1 file changed, 975 insertions(+), 1020 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 02093059e5..2bdb7b88e7 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -6386,6 +6386,160 @@ declare namespace Office { */ Subject } + /** + * The AppointmentForm namespace is used to access the currently selected appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
+ */ + interface AppointmentForm { + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + body: string; + /** + * Gets or sets the date and time that the appointment is to end. + * + * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * + * *Read mode* + * + * The end property returns a Date object. + * + * *Compose mode* + * + * The end property returns a Time object. + * + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + end: Date; + /** + * Gets or sets the location of an appointment. + * + * *Read mode* + * + * The location property returns a string that contains the location of the appointment. + * + * *Compose mode* + * + * The location property returns a Location object that provides methods that are used to get and set the location of the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + location: string; + /** + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * *Read mode* + * + * The optionalAttendees property returns an array that contains an EmailAddressDetails object for each optional attendee to the meeting. + * + * *Compose mode* + * + * The optionalAttendees property returns a Recipients object that provides methods to get or update the optional attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + optionalAttendees: string[] | EmailAddressDetails[]; + resources: string[]; + /** + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * *Read mode* + * + * The requiredAttendees property returns an array that contains an EmailAddressDetails object for each required attendee to the meeting. + * + * *Compose mode* + * + * The requiredAttendees property returns a Recipients object that provides methods to get or update the required attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + requiredAttendees: string[] | EmailAddressDetails[]; + /** + * Gets or sets the date and time that the appointment is to begin. + * + * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * + * *Read mode* + * + * The start property returns a Date object. + * + * *Compose mode* + * + * The start property returns a Time object. + * + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + start: Date; + /** + * Gets or sets the description that appears in the subject field of an item. + * + * The subject property gets or sets the entire subject of the item, as sent by the email server. + * + * *Read mode* + * + * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. + * + * *Compose mode* + * + * The subject property returns a Subject object that provides methods to get and set the subject. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + subject: string; + } /** * Represents an attachment on an item from the server. Read mode only. * @@ -7113,77 +7267,6 @@ declare namespace Office { * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface AppointmentCompose extends Appointment, ItemCompose { - /** - * Gets or sets the date and time that the appointment is to end. - * - * The end property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. - * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - end: Time; - /** - * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are used to get and set the location of the appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - location: Location; - /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - optionalAttendees: Recipients; - /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - requiredAttendees: Recipients; - /** - * Gets or sets the date and time that the appointment is to begin. - * - * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. - * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- */ - start: Time; - - // Repeated Item fields // - /** * Gets an object that provides methods for manipulating the body of an item. * @@ -7222,6 +7305,22 @@ declare namespace Office { * Note: This member is not supported in Outlook for iOS or Outlook for Android. */ dateTimeModifed: Date; + /** + * Gets or sets the date and time that the appointment is to end. + * + * The end property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ */ + end: Time; /** * Gets the type of item that an instance represents. * @@ -7236,6 +7335,18 @@ declare namespace Office { * Applicable Outlook modeAppointment Organizer */ itemType: Office.MailboxEnums.ItemType; + /** + * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are used to get and set the location of the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ */ + location: Location; /** * Gets the notification messages for an item. * @@ -7248,7 +7359,18 @@ declare namespace Office { * Applicable Outlook modeAppointment Organizer */ notificationMessages: NotificationMessages; - + /** + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ */ + optionalAttendees: Recipients; /** * Gets or sets the recurrence pattern of an appointment. * @@ -7269,7 +7391,18 @@ declare namespace Office { * @beta */ recurrence: Recurrence; - + /** + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees for a meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ */ + requiredAttendees: Recipients; /** * Gets the id of the series that an instance belongs to. * @@ -7290,124 +7423,23 @@ declare namespace Office { * @beta */ seriesId: string; - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] + * Gets or sets the date and time that the appointment is to begin. * - * @remarks - * - * + * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] * * @remarks * * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** + start: Time; + /** * Gets or sets the description that appears in the subject field of an item. * * The subject property gets or sets the entire subject of the item, as sent by the email server. @@ -7519,7 +7551,52 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; - + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -7622,7 +7699,6 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; - /** * Closes the current item that is being composed * @@ -7709,7 +7785,26 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; - /** + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; +/** * Removes an attachment from a message or appointment. * * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. @@ -7795,7 +7890,52 @@ declare namespace Office { * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; - + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -8007,6 +8147,7 @@ declare namespace Office { */ setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } + /** * The appointment attendee mode of {@link Office.Item | Office.context.mailbox.item}. * @@ -8014,93 +8155,21 @@ declare namespace Office { */ interface AppointmentRead extends Appointment, ItemRead { /** - * Gets the date and time that the appointment is to end. - * - * The end property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. - * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * Gets an array of attachments for the item. * * [Api set: Mailbox 1.0] * * @remarks - * + * * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * */ - end: Date; + attachments: AttachmentDetails[]; /** - * Gets the location of an appointment. - * - * The location property returns a string that contains the location of the appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - location: string; - /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to the meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - optionalAttendees: EmailAddressDetails[]; - /** - * Gets the email address of the meeting organizer for a specified meeting. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - organizer: EmailAddressDetails; - /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to the meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - requiredAttendees: EmailAddressDetails[]; - /** - * Gets the date and time that the appointment is to begin. - * - * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - start: Date; - - // Repeated Item Fields // - - /** * Gets an object that provides methods for manipulating the body of an item. * * [Api set: Mailbox 1.1] @@ -8138,6 +8207,74 @@ declare namespace Office { * Note: This member is not supported in Outlook for iOS or Outlook for Android. */ dateTimeModifed: Date; + /** + * Gets the date and time that the appointment is to end. + * + * The end property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + end: Date; + /** + * Gets the Exchange Web Services item class of the selected item. + * + * + * You can create custom message classes that extends a default message class, for example, a custom appointment message class IPM.Appointment.Contoso. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * + * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
TypeDescriptionItem Class
Appointment itemsThese are calendar items of the item class IPM.Appointment or IPM.Appointment.Occurence.IPM.Appointment,IPM.Appointment.Occurence
Message itemsThese include email messages that have the default message class IPM.Note, and meeting requests, responses, and cancellations, that use IPM.Schedule.Meeting as the base message class.IPM.Note,IPM.Schedule.Meeting.Request,IPM.Schedule.Meeting.Neg,IPM.Schedule.Meeting.Pos,IPM.Schedule.Meeting.Tent,IPM.Schedule.Meeting.Canceled
+ * + */ + itemClass: string; + /** + * Gets the Exchange Web Services item identifier for the current item. + * + * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + itemId: string; /** * Gets the type of item that an instance represents. * @@ -8152,6 +8289,34 @@ declare namespace Office { * Applicable Outlook modeAppointment Attendee */ itemType: Office.MailboxEnums.ItemType; + /** + * Gets the location of an appointment. + * + * The location property returns a string that contains the location of the appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + location: string; + /** + * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). + * + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + normalizedSubject: string; /** * Gets the notification messages for an item. * @@ -8164,7 +8329,32 @@ declare namespace Office { * Applicable Outlook modeAppointment Attendee */ notificationMessages: NotificationMessages; - + /** + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to the meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + optionalAttendees: EmailAddressDetails[]; + /** + * Gets the email address of the meeting organizer for a specified meeting. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + organizer: EmailAddressDetails; /** * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. * @@ -8185,7 +8375,34 @@ declare namespace Office { * @beta */ recurrence: Recurrence; - + /** + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. + * + * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to the meeting. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + requiredAttendees: EmailAddressDetails[]; + /** + * Gets the date and time that the appointment is to begin. + * + * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + start: Date; /** * Gets the id of the series that an instance belongs to. * @@ -8206,6 +8423,22 @@ declare namespace Office { * @beta */ seriesId: string; + /** + * Gets the description that appears in the subject field of an item. + * + * The subject property gets or sets the entire subject of the item, as sent by the email server. + * + * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ */ + subject: string; /** * Adds an event handler for a supported event. @@ -8254,173 +8487,6 @@ declare namespace Office { * @beta */ addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Gets an array of attachments for the item. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. - * - */ - attachments: AttachmentDetails[]; - /** - * Gets the Exchange Web Services item class of the selected item. - * - * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class IPM.Appointment.Contoso. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- * - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
TypeDescriptionItem Class
Appointment itemsThese are calendar items of the item class IPM.Appointment or IPM.Appointment.Occurence.IPM.Appointment,IPM.Appointment.Occurence
Message itemsThese include email messages that have the default message class IPM.Note, and meeting requests, responses, and cancellations, that use IPM.Schedule.Meeting as the base message class.IPM.Note,IPM.Schedule.Meeting.Request,IPM.Schedule.Meeting.Neg,IPM.Schedule.Meeting.Pos,IPM.Schedule.Meeting.Tent,IPM.Schedule.Meeting.Canceled
- * - */ - itemClass: string; - - /** - * Gets the Exchange Web Services item identifier for the current item. - * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. - * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - itemId: string; - /** - * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). - * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - normalizedSubject: string; - /** - * Gets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
- */ - subject: string; /** * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. * @@ -8687,161 +8753,72 @@ declare namespace Office { * Applicable Outlook modeAppointment Attendee */ getSelectedRegExMatches(): any; - } + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - /** - * The AppointmentForm namespace is used to access the currently selected appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
Applicable Outlook modeCompose or read
- */ - interface AppointmentForm { - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - body: string; - /** - * Gets or sets the date and time that the appointment is to end. - * - * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. - * - * *Read mode* - * - * The end property returns a Date object. - * - * *Compose mode* - * - * The end property returns a Time object. - * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - end: Date; - /** - * Gets or sets the location of an appointment. - * - * *Read mode* - * - * The location property returns a string that contains the location of the appointment. - * - * *Compose mode* - * - * The location property returns a Location object that provides methods that are used to get and set the location of the appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - location: string; - /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * *Read mode* - * - * The optionalAttendees property returns an array that contains an EmailAddressDetails object for each optional attendee to the meeting. - * - * *Compose mode* - * - * The optionalAttendees property returns a Recipients object that provides methods to get or update the optional attendees for a meeting. - * - * [Api set: Mailbox 1.0] + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] * * @remarks * * * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ * Applicable Outlook modeAppointment Attendee + * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta */ - optionalAttendees: string[] | EmailAddressDetails[]; - resources: string[]; - /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. - * - * *Read mode* - * - * The requiredAttendees property returns an array that contains an EmailAddressDetails object for each required attendee to the meeting. - * - * *Compose mode* - * - * The requiredAttendees property returns a Recipients object that provides methods to get or update the required attendees for a meeting. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - requiredAttendees: string[] | EmailAddressDetails[]; - /** - * Gets or sets the date and time that the appointment is to begin. - * - * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. - * - * *Read mode* - * - * The start property returns a Date object. - * - * *Compose mode* - * - * The start property returns a Time object. - * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - start: Date; - /** - * Gets or sets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * *Read mode* - * - * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. - * - * *Compose mode* - * - * The subject property returns a Subject object that provides methods to get and set the subject. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - subject: string; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Attendee
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -10094,6 +10071,18 @@ declare namespace Office { * Applicable Outlook modeMessage Compose */ bcc: Recipients; + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ */ + body: Body; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. * @@ -10108,53 +10097,6 @@ declare namespace Office { * Applicable Outlook modeMessage Compose */ cc: Recipients; - /** - * Gets the email address of the sender of a message. - * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. - * - * The from property returns a From object that provides a method to get the from value. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @beta - */ - from: From; - /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. - * - * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- */ - to: Recipients; - - // Repeated Item Fields // - - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- */ - body: Body; /** * Gets the date and time that an item was created. Read mode only. * @@ -10181,6 +10123,24 @@ declare namespace Office { * Note: This member is not supported in Outlook for iOS or Outlook for Android. */ dateTimeModifed: Date; + /** + * Gets the email address of the sender of a message. + * + * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * + * The from property returns a From object that provides a method to get the from value. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * + * @beta + */ + from: From; /** * Gets the type of item that an instance represents. * @@ -10207,7 +10167,6 @@ declare namespace Office { * Applicable Outlook modeMessage Compose */ notificationMessages: NotificationMessages; - /** * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. * @@ -10228,7 +10187,6 @@ declare namespace Office { * @beta */ recurrence: Recurrence; - /** * Gets the id of the series that an instance belongs to. * @@ -10249,124 +10207,7 @@ declare namespace Office { * @beta */ seriesId: string; - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** * Gets or sets the description that appears in the subject field of an item. * * The subject property gets or sets the entire subject of the item, as sent by the email server. @@ -10382,6 +10223,21 @@ declare namespace Office { * Applicable Outlook modeMessage Compose */ subject: Subject; + /** + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * + * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ */ + to: Recipients; + /** * Adds a file to a message or appointment as an attachment. * @@ -10478,7 +10334,52 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; - + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * @@ -10581,7 +10482,6 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; - /** * Closes the current item that is being composed * @@ -10668,6 +10568,25 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * @@ -10754,7 +10673,52 @@ declare namespace Office { * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; - + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Compose
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * @@ -10972,6 +10936,33 @@ declare namespace Office { * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface MessageRead extends Message, ItemRead { + /** + * Gets an array of attachments for the item. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * + */ + attachments: AttachmentDetails[]; + /** + * Gets an object that provides methods for manipulating the body of an item. + * + * [Api set: Mailbox 1.1] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ */ + body: Body; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. * @@ -10986,6 +10977,32 @@ declare namespace Office { * Applicable Outlook modeMessage Read */ cc: EmailAddressDetails[]; + /** + * Gets the date and time that an item was created. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ */ + dateTimeCreated: Date; + /** + * Gets the date and time that an item was last modified. Read mode only. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * Note: This member is not supported in Outlook for iOS or Outlook for Android. + */ + dateTimeModifed: Date; /** * Gets the email address of the sender of a message. * @@ -11016,277 +11033,6 @@ declare namespace Office { * Applicable Outlook modeMessage Read */ internetMessageId: string; - /** - * Gets the email address of the sender of an email message. - * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. - * - * Note: The recipientType property of the EmailAddressDetails object in the sender property is undefined. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - sender: EmailAddressDetails; - /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. - * - * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - to: EmailAddressDetails[]; - - // Repeated Item Fields // - - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - body: Body; - /** - * Gets the date and time that an item was created. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - dateTimeCreated: Date; - /** - * Gets the date and time that an item was last modified. Read mode only. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * Note: This member is not supported in Outlook for iOS or Outlook for Android. - */ - dateTimeModifed: Date; - /** - * Gets the type of item that an instance represents. - * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- */ - itemType: Office.MailboxEnums.ItemType; - /** - * Gets the notification messages for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
- */ - notificationMessages: NotificationMessages; - - /** - * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. - * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. - * - * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. - * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @beta - */ - recurrence: Recurrence; - - /** - * Gets the id of the series that an instance belongs to. - * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. - * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @beta - */ - seriesId: string; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * In addition to this signature, the method also has the following signature: - * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Adds an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * In addition to this signature, the method also has the following signature: - * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` - * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param options Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; - - /** - * Removes an event handler for a supported event. - * - * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * - * @beta - */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; - - /** - * Gets an array of attachments for the item. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
- * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. - * - */ - attachments: AttachmentDetails[]; /** * Gets the Exchange Web Services item class of the selected item. * @@ -11338,6 +11084,20 @@ declare namespace Office { * Applicable Outlook modeMessage Read */ itemId: string; + /** + * Gets the type of item that an instance represents. + * + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ */ + itemType: Office.MailboxEnums.ItemType; /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * @@ -11352,6 +11112,74 @@ declare namespace Office { * Applicable Outlook modeMessage Read */ normalizedSubject: string; + /** + * Gets the notification messages for an item. + * + * [Api set: Mailbox 1.3] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeCompose or read
+ */ + notificationMessages: NotificationMessages; + /** + * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * + * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. + * + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * @beta + */ + recurrence: Recurrence; + /** + * Gets the id of the series that an instance belongs to. + * + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * @beta + */ + seriesId: string; + /** + * Gets the email address of the sender of an email message. + * + * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * + * Note: The recipientType property of the EmailAddressDetails object in the sender property is undefined. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ */ + sender: EmailAddressDetails; /** * Gets the description that appears in the subject field of an item. * @@ -11368,6 +11196,68 @@ declare namespace Office { * Applicable Outlook modeMessage Read */ subject: string; + /** + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * + * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ */ + to: EmailAddressDetails[]; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * In addition to this signature, the method also has the following signature: + * + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + + /** + * Adds an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. * @@ -11635,6 +11525,71 @@ declare namespace Office { * Applicable Outlook modeMessage Read */ getSelectedRegExMatches(): any; + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * In addition to this signature, the method also has the following signature: + * + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param options Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an event handler for a supported event. + * + * Currently the only supported event type is Office.EventType.RecurrencePatternChanged, which is invoked when the user changes the recurrence pattern of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeMessage Read
+ * + * @param eventType The event that should invoke the handler. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * + * @beta + */ + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** From 78ac877851dff9b18e2a190c8dae554b5c61661a Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 27 Jun 2018 11:06:24 -0700 Subject: [PATCH 21/74] Fixing indentation --- types/office-js/index.d.ts | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 2bdb7b88e7..cb15dd864a 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -7785,26 +7785,26 @@ declare namespace Office { * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. - * - * [Api set: Mailbox 1.0] - * - * @remarks - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
- * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; -/** + /** + * Asynchronously loads custom properties for this add-in on the selected item. + * + * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
Applicable Outlook modeAppointment Organizer
+ * + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + */ + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + /** * Removes an attachment from a message or appointment. * * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. From dbfec6fbb96e8d3935778e797a019c5cb90ff3d1 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 27 Jun 2018 12:39:11 -0700 Subject: [PATCH 22/74] Workaround for lack of multi-level indenting --- types/office-js/index.d.ts | 63 ++++++++++++-------------------------- 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 4b6773e7f0..0cfb608457 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -2460,54 +2460,29 @@ declare namespace Office { * * The following application-specific actions apply when writing data to a selection. * - * - Word + * + * + * + * + * + * + * + * * - * - If there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion point as follows: + * + * + * + * + * + * + * * - * - If `data` is a string, the specified text is inserted. + * + * * - * - If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted. + * + *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf `data` is a string, the specified text is inserted.
If `data` is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If `data` is HTML, the specified HTML is inserted. (Important: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If `data` is Office Open XML, the specified XML is inserted.
If `data` is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified `data` following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf `data` is a string, the specified text is inserted as the value of the current cell.
If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of `data`, an error is returned.
If the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel OnlineIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel OnlineThe total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* - * - If `data` is HTML, the specified HTML is inserted. (Important: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data). - * - * - If `data` is Office Open XML, the specified XML is inserted. - * - * - If `data` is a base64 encoded image stream, the specified image is inserted. - * - * - If there is a selection, it will be replaced with the specified `data` following the same rules as above. - * - * - Insert images: Inserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio. - * - * - Excel - * - * - If a single cell is selected: - * - * - If `data` is a string, the specified text is inserted as the value of the current cell. - * - * - If `data` is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten. - * - * - If `data` is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten. - * - * - If multiple cells are selected and the shape does not match the shape of `data`, an error is returned. - * - * - If multiple cells are selected and the shape of the selection exactly matches the shape of `data`, the values of the selected cells are updated based on the values in `data`. - * - * - Insert images: Inserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cell(s). Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio. - * - * - In all other cases, an error is returned. - * - * - Excel Online - * - * - In addition to the behaviors described for Excel above, the following limits apply when writing data in Excel Online. - * - * - The total number of cells you can write to a worksheet with the `data` parameter can't exceed 20,000 in a single call to this method. - * - * - The number of formatting groups passed to the `cellFormat` parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells. - * - * - PowerPoint - * - * - Inserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio. - * * @param data The data to be set. Either a string or {@link Office.CoercionType} value, 2d array or TableData object. * * The possible CoercionTypes that can be used for the data parameter, or for the coercionType option, vary by host: From 6d006a150b56e8f94ee0473609e47befbbc8251f Mon Sep 17 00:00:00 2001 From: "d.rogozhny@gmail.com" Date: Wed, 27 Jun 2018 23:32:16 +0300 Subject: [PATCH 23/74] Trigger travis-ci build --- types/mongodb-memory-server/mongodb-memory-server-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongodb-memory-server/mongodb-memory-server-tests.ts b/types/mongodb-memory-server/mongodb-memory-server-tests.ts index 4bb869011e..62abb2651b 100644 --- a/types/mongodb-memory-server/mongodb-memory-server-tests.ts +++ b/types/mongodb-memory-server/mongodb-memory-server-tests.ts @@ -11,5 +11,5 @@ async function simpleServerStart() { // you may stop mongod manually mongod.stop(); - // or it will be stopped automatically when you exit from script. + // or it will be stopped automatically when you exit from script } From 750fa2973ba1b9849e061b6a085e6e7e6cbc848a Mon Sep 17 00:00:00 2001 From: Paul Price Date: Wed, 27 Jun 2018 15:23:48 -0600 Subject: [PATCH 24/74] Fixed typos in params for Image.fromUrl() Documentation and implementation didn't match up and I was unable to pass {crossOrigin: 'Anonymous' } as the 3rd argument. --- types/fabric/fabric-impl.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 07c1227706..4d01868b59 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1867,7 +1867,7 @@ export class Image { * @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument) * @param [imgOptions] Options object */ - static fromURL(url: string, callback?: (image: Image) => void, objObjects?: IObjectOptions): Image; + static fromURL(url: string, callback?: (image: Image) => void, imgOptions?: IImageOptions): Image; /** * Creates an instance of fabric.Image from its object representation * @param object Object to create an instance from From a5a806bcff0989e5f5a96bc59993b008a8b07651 Mon Sep 17 00:00:00 2001 From: Geoff Rich Date: Thu, 28 Jun 2018 07:37:14 +1000 Subject: [PATCH 25/74] Add array of streams option to run command. --- types/dockerode/index.d.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 188643dc28..3bbfa4e649 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -11,7 +11,6 @@ /// -import * as stream from 'stream'; import * as events from 'events'; declare namespace Dockerode { @@ -962,11 +961,11 @@ declare class Dockerode { pull(repoTag: string, options: {}, callback: Callback, auth?: {}): Dockerode.Image; pull(repoTag: string, options: {}, auth?: {}): Promise; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions?: {}, startOptions?: {}): Promise; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], startOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions?: {}, startOptions?: {}): Promise; swarmInit(options: {}, callback: Callback): void; swarmInit(options: {}): Promise; From 5fc1e8a77b4fb70a8fae846fa1c0cdb34c41395d Mon Sep 17 00:00:00 2001 From: Geoff Rich Date: Thu, 28 Jun 2018 07:40:22 +1000 Subject: [PATCH 26/74] Re-add import back in. --- types/dockerode/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 3bbfa4e649..5c1c1bfae6 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -11,6 +11,7 @@ /// +import * as stream from 'stream'; import * as events from 'events'; declare namespace Dockerode { From f8a1c98ea453a00c629d3e83f89e1bc9aee6d0a3 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 27 Jun 2018 14:53:08 -0700 Subject: [PATCH 27/74] Fixing TableBinding table --- types/office-js/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 4b6773e7f0..1b5dd5c192 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -3173,9 +3173,9 @@ declare namespace Office { * * * Office.Table.Headers - * + * Specifies only the header row. * - * + *
* * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel (Right-click > Format Cells or Home > Format > Format Cells). * From feadd371daf65f7959e75ffc028ee4690e229dc2 Mon Sep 17 00:00:00 2001 From: Kelvin Jin Date: Wed, 27 Jun 2018 10:59:42 -0700 Subject: [PATCH 28/74] [node] make crypto.randomFill[Sync] return type equal to first arg type --- types/node/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 2d0b97d932..8b3a21f882 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -5894,10 +5894,10 @@ declare module "crypto" { export function pseudoRandomBytes(size: number): Buffer; export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - export function randomFillSync(buffer: ArrayBufferView, offset?: number, size?: number): ArrayBufferView; - export function randomFill(buffer: ArrayBufferView, callback: (err: Error | null, buf: ArrayBufferView) => void): void; - export function randomFill(buffer: ArrayBufferView, offset: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void; - export function randomFill(buffer: ArrayBufferView, offset: number, size: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void; + export function randomFillSync(buffer: T, offset?: number, size?: number): T; + export function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + export function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + export function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; export interface RsaPublicKey { key: string; From 12c40169e904bddb6f0c0f7aff4364a534bf4da6 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Thu, 28 Jun 2018 10:59:20 +0800 Subject: [PATCH 29/74] update wepy: add page config for page component --- types/wepy/app.d.ts | 11 +++-------- types/wepy/page.d.ts | 14 +++++++++++++- types/wepy/wepy-tests.ts | 2 ++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/types/wepy/app.d.ts b/types/wepy/app.d.ts index 9389b0400f..17274c83b1 100644 --- a/types/wepy/app.d.ts +++ b/types/wepy/app.d.ts @@ -1,3 +1,5 @@ +import { PageConfig } from "./page"; + export interface AppConfig { appEvents?: string[]; pageEvents?: string[]; @@ -11,16 +13,9 @@ export interface AppConstructor { /* the supported add-ons */ export type AddOn = "requestfix" | "promisify"; -export interface WindowConfig { - backgroundTextStyle: string; - navigationBarBackgroundColor: string; - navigationBarTitleText: string; - navigationBarTextStyle: string; -} - export default class app { config: { - window: WindowConfig; + window: PageConfig; pages: string[]; }; $init(wepy: any, config: AppConfig): void; diff --git a/types/wepy/page.d.ts b/types/wepy/page.d.ts index 7655621106..d369802715 100644 --- a/types/wepy/page.d.ts +++ b/types/wepy/page.d.ts @@ -8,8 +8,20 @@ export interface PageConstructor { new (): page; } +export interface PageConfig { + navigationBarBackgroundColor?: string; + navigationBarTextStyle?: string; + navigationBarTitleText?: string; + backgroundColor?: string; + backgroundTextStyle?: string; + enablePullDownRefresh?: boolean; + disableScroll?: boolean; + onReachBottomDistance?: number; +} + export default class page extends component { - $preloadData: { [key: string]: any }; + config?: PageConfig; + $preloadData?: { [key: string]: any }; $init(wxpage: any, $parent: any): any; $route( type: "redirectTo" | "navigateTo", diff --git a/types/wepy/wepy-tests.ts b/types/wepy/wepy-tests.ts index d9794f6e8b..071eda0d9e 100644 --- a/types/wepy/wepy-tests.ts +++ b/types/wepy/wepy-tests.ts @@ -17,6 +17,8 @@ export class MyComponent extends wepy.component { titleClassName: "" }; + config = {}; + methods = {}; onLoad() { From f8cacb2021195a146047489e9d5de338f5166da5 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 28 Jun 2018 09:28:21 +0200 Subject: [PATCH 30/74] Update index.d.ts --- types/algoliasearch/lite/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index a567a917a8..acd2b30988 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -180,6 +180,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } interface BrowseResponse { cursor?: string; From 4b07dfcca0402ce1d80d4b1e2f8483a2753a116c Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 28 Jun 2018 09:28:52 +0200 Subject: [PATCH 31/74] Update index.d.ts --- types/algoliasearch/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index b2890573ce..5a49eaea18 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -764,6 +764,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } /** * Interface describing options available for gettings the logs From f094c618e862086668eeb6e07a6cc5c0e8370300 Mon Sep 17 00:00:00 2001 From: GP Date: Thu, 28 Jun 2018 13:20:40 +0530 Subject: [PATCH 32/74] Introduce URL as input for nock. --- types/nock/index.d.ts | 7 +++++-- types/nock/nock-tests.ts | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 90eae08189..afebacf1e5 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -1,17 +1,20 @@ -// Type definitions for nock v9.1.3 +// Type definitions for nock v9.3.3 // Project: https://github.com/node-nock/nock // Definitions by: bonnici // Horiuchi_H // afharo // Matt R. Wilson // Garanzha Dmitriy +// GP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +import { Url } from 'url'; + export = nock; -declare function nock(basePath: string | RegExp, options?: nock.Options): nock.Scope; +declare function nock(basePath: string | RegExp | Url, options?: nock.Options): nock.Scope; declare namespace nock { export function cleanAll(): void; diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 7ed4ecc25d..06f8458bcb 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -1,5 +1,6 @@ import nock = require('nock'); import * as fs from 'fs'; +import { URL } from 'url'; var scope: nock.Scope; var inst: nock.Interceptor; @@ -144,6 +145,11 @@ var couchdb = nock('http://myapp.iriscouch.com') email: 'pedro.teixeira@gmail.com' }); +// Using URL as input +var scope = nock(new URL('https://example.org/')) + .get('/resource') + .reply(200, 'url matched'); + // Specifying hostname var scope = nock('http://www.example.com') .get('/resource') From f6a902f8ce35e613908ecc06c6809ff2f28d45aa Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Thu, 28 Jun 2018 12:27:49 +0200 Subject: [PATCH 33/74] Improve module.filter() by allowing `$stateful` to be defined. --- types/angular/angular-tests.ts | 15 +++++++++++---- types/angular/index.d.ts | 13 +++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 1dff1a0451..3e67c88e67 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -214,11 +214,18 @@ mod.factory({ name1(foo: any) {}, name2: ['foo', (foo: any) => {}] }); -mod.filter('name', ($scope: ng.IScope) => {}); -mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]); +mod.filter('name', ($scope: ng.IScope) => () => {}); +mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]); mod.filter({ - name1(foo: any) {}, - name2: ['foo', (foo: any) => {}] + name1(foo: any) { return () => {}; }, + name2: ['foo', (foo: any) => () => {}], +}); +const customStatefulFilter: ng.FilterFunction<(s: string) => number> = (s) => 1; +mod.filter('name', () => customStatefulFilter); +mod.filter('name', ['$scope', () => customStatefulFilter]); +mod.filter({ + name1: () => customStatefulFilter, + name2: ['foo', () => customStatefulFilter], }); mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } })); mod.provider('name', TestProvider); diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 6b82a2bcb4..50d28a2dbb 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -250,8 +250,8 @@ declare namespace angular { */ factory(name: string, $getFn: Injectable): IModule; factory(object: {[name: string]: Injectable}): IModule; - filter(name: string, filterFactoryFunction: Injectable): IModule; - filter(object: {[name: string]: Injectable}): IModule; + filter(name: string, filterFactoryFunction: Injectable>): IModule; + filter(object: {[name: string]: Injectable>}): IModule; provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; provider(name: string, inlineAnnotatedConstructor: any[]): IModule; @@ -2237,4 +2237,13 @@ declare namespace angular { interface IHttpParamSerializer { (obj: Object): string; } + + type FilterFunction = { + /** + * By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** + * See https://docs.angularjs.org/guide/filter#stateful-filters + */ + $stateful?: boolean + } & Filter; + type FilterFactory = (...I: any[]) => FilterFunction; } From 17a57444f33da0471da73fae16e7d70600bf0c4e Mon Sep 17 00:00:00 2001 From: teevik Date: Thu, 28 Jun 2018 12:34:26 +0200 Subject: [PATCH 34/74] Change `autoHeightMin` and `autoHeightMax` to allow both number and string --- types/react-custom-scrollbars/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-custom-scrollbars/index.d.ts b/types/react-custom-scrollbars/index.d.ts index 7f60cc8a2a..f21ec7adba 100644 --- a/types/react-custom-scrollbars/index.d.ts +++ b/types/react-custom-scrollbars/index.d.ts @@ -44,8 +44,8 @@ declare module "react-custom-scrollbars" { universal?: boolean; autoHeight?: boolean; - autoHeightMin?: number; - autoHeightMax?: number; + autoHeightMin?: number | string; + autoHeightMax?: number | string; } export default class Scrollbars extends React.Component { From 10a3a77b5e63f3251c82ebe22d2b8c480f83f67f Mon Sep 17 00:00:00 2001 From: Thomas Chia Date: Thu, 28 Jun 2018 19:34:55 +0800 Subject: [PATCH 35/74] Add payment request to StripeProps Add test --- types/react-stripe-elements/index.d.ts | 2 +- .../react-stripe-elements-tests.tsx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index abc08cc3e1..27d124f78a 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -34,8 +34,8 @@ export namespace ReactStripeElements { interface StripeProps { createSource(sourceData?: SourceOptions): Promise; - createToken(options?: TokenOptions): Promise; + paymentRequest: stripe.Stripe['paymentRequest']; } interface InjectOptions { diff --git a/types/react-stripe-elements/react-stripe-elements-tests.tsx b/types/react-stripe-elements/react-stripe-elements-tests.tsx index 88b703b141..324f76aa4d 100644 --- a/types/react-stripe-elements/react-stripe-elements-tests.tsx +++ b/types/react-stripe-elements/react-stripe-elements-tests.tsx @@ -110,6 +110,22 @@ interface ComponentProps { class WrappedComponent extends React.Component< ComponentProps & InjectedStripeProps > { + constructor(props: ComponentProps & InjectedStripeProps) { + super(props); + // Test for paymentRequest + const paymentRequest = props.stripe && props.stripe.paymentRequest({ + country: 'US', + currency: 'usd', + total: { + label: 'Demo total', + amount: 1 + } + }); + if (paymentRequest) { + paymentRequest.on('token', ({complete, token, ...data}) => undefined); + paymentRequest.canMakePayment().then(res => undefined); + } + } onSubmit = () => { this.props.stripe! .createToken({ From 455ab41dbb61099cd5bd0dcd54a8aa601497e52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Thu, 28 Jun 2018 14:29:19 +0200 Subject: [PATCH 36/74] Adding a test that fails --- .../react-navigation/react-navigation-tests.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 38aa495240..5bdc0f400c 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -41,6 +41,7 @@ import { NavigationScreenComponent, NavigationContainerComponent, withNavigation, + withNavigationFocus, NavigationInjectedProps, } from 'react-navigation'; @@ -532,3 +533,19 @@ const BackButtonWithNavigation = withNavigation(MyBackButton); const BackButtonInstance = { const backButtonRef = ref; }} />; + +// Test withNavigationFocus + +interface MyFocusedComponentProps { expectsFocus: boolean; } +class MyFocusedComponent extends React.Component { + render() { + return