From 5b98aceaf1b756c021af76b43b7cabf9f16790aa Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Mon, 23 Apr 2018 13:28:24 -0400 Subject: [PATCH 001/346] 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 002/346] 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 003/346] 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 35b9eb280013180d88df46e60c796b36377a6bf0 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 19 Jun 2018 13:23:39 -0700 Subject: [PATCH 004/346] Added 'strict' to the 'assert' module. --- types/node/index.d.ts | 2 ++ types/node/node-tests.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index aed01dd504..60db045346 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -6356,6 +6356,8 @@ declare module "assert" { export function rejects(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; export function doesNotReject(block: Function | Promise, message?: string): Promise; export function doesNotReject(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; + + export var strict: typeof internal; } export = internal; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index d9fe6768f6..99cf5796bf 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -87,6 +87,8 @@ namespace assert_tests { assert.strictEqual(1, 1, "uses === comparator"); assert.throws(() => { throw new Error("a hammer at your face"); }, undefined, "DODGED IT"); + + assert.strict.strict.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); } } From de1ec36c49e65efe323bd072cc47b78a496dfb29 Mon Sep 17 00:00:00 2001 From: Cahya Pribadi <534150+ozylog@users.noreply.github.com> Date: Fri, 22 Jun 2018 16:54:26 +1200 Subject: [PATCH 005/346] Update index.d.ts based on hapi.js request object on actual module that params and payload are possible to be null when there is no value applied on it. ``` params: null, paramsArray: null, path: '/v1/Schemas', payload: null, ``` --- types/hapi/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index d8edc40685..26edb16926 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -424,7 +424,7 @@ export interface Request extends Podium { /** * An object where each key is a path parameter name with matching value as described in [Path parameters](https://github.com/hapijs/hapi/blob/master/API.md#path-parameters). */ - readonly params: Util.Dictionary; + readonly params: Util.Dictionary | null; /** * An array containing all the path params values in the order they appeared in the path. @@ -440,7 +440,7 @@ export interface Request extends Podium { * The request payload based on the route payload.output and payload.parse settings. * TODO check this typing and add references / links. */ - readonly payload: stream.Readable | Buffer | string | object; + readonly payload: stream.Readable | Buffer | string | object | null; /** * Plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. From 2724d2737baa7f9dc6e6ed939d814f3ff2b5c0c5 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Fri, 22 Jun 2018 13:49:59 -0400 Subject: [PATCH 006/346] Added missing grid functions, props & values --- types/styled-system/index.d.ts | 72 +++++++++++++++++++- types/styled-system/styled-system-tests.tsx | 74 ++++++++++++++++++++- 2 files changed, 144 insertions(+), 2 deletions(-) diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index 5fcc4973b1..d99382e5fd 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -5,6 +5,7 @@ // Justin Bennett // Christopher Pappas // Eloy Durán +// Matthieu Vachon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -409,7 +410,76 @@ export function flexBasis(...args: any[]): any; * Grid Layout */ -// TODO: Add grid values +export type GridGapValue = number | string; +export type ResponsiveGridGapValue = ResponsiveValue; + +export interface GridGapProps { + gridGap?: ResponsiveGridGapValue; +} + +export function gridGap(...args: any[]): any; + +export interface GridRowGapProps { + gridRowGap?: ResponsiveGridGapValue; +} + +export function gridRowGap(...args: any[]): any; + +export interface GridColumnGapProps { + gridColumnGap?: ResponsiveGridGapValue; +} + +export function gridColumnGap(...args: any[]): any; + +export type GridCellValue = string; +export type ResponsiveGridCellValue = ResponsiveValue; + +export interface GridColumnProps { + gridColumn?: ResponsiveGridCellValue; +} + +export function gridColumn(...args: any[]): any; + +export interface GridRowProps { + gridRow?: ResponsiveGridCellValue; +} + +export function gridRow(...args: any[]): any; + +export type GridAutoValue = string; + +export interface GridAutoFlowProps { + gridAutoFlow?: GridAutoValue; +} + +export function gridAutoFlow(...args: any[]): any; + +export interface GridAutoRowsProps { + gridAutoRows?: GridAutoValue; +} + +export function gridAutoRows(...args: any[]): any; + +export interface GridAutoColumnsProps { + gridAutoColumns?: GridAutoValue; +} + +export function gridAutoColumns(...args: any[]): any; + +export type GridTemplateValue = string; +export type ResponsiveGridTemplateValue = ResponsiveValue; + +export interface GridTemplatesRowsProps { + gridTemplateRows?: ResponsiveGridTemplateValue; +} + +export function gridTemplateRows(...args: any[]): any; + +export interface GridTemplatesColumnsProps { + gridTemplateColumns?: ResponsiveGridTemplateValue; +} + +export function gridTemplateColumns(...args: any[]): any; /** * Background diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index e58791662e..fa472f892a 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -92,7 +92,27 @@ import { active, ActiveProps, disabled, - DisabledProps + DisabledProps, + GridGapProps, + GridRowGapProps, + GridColumnGapProps, + GridRowProps, + GridColumnProps, + gridGap, + gridRowGap, + gridColumnGap, + gridRow, + gridColumn, + GridAutoFlowProps, + GridAutoColumnsProps, + GridAutoRowsProps, + GridTemplatesRowsProps, + GridTemplatesColumnsProps, + gridAutoFlow, + gridAutoRows, + gridAutoColumns, + gridTemplateColumns, + gridTemplateRows } from "styled-system"; interface BoxProps @@ -201,6 +221,30 @@ const Flex = styled.div.attrs({})` ${flexDirection}; `; +interface GridComponentProps + extends GridGapProps, + GridRowGapProps, + GridColumnGapProps, + GridRowProps, + GridColumnProps, + GridAutoFlowProps, + GridAutoColumnsProps, + GridAutoRowsProps, + GridTemplatesRowsProps, + GridTemplatesColumnsProps {} +const Grid = styled.div.attrs({})` + ${gridGap}; + ${gridRowGap}; + ${gridColumnGap}; + ${gridRow}; + ${gridColumn}; + ${gridAutoFlow}; + ${gridAutoRows}; + ${gridAutoColumns}; + ${gridTemplateRows}; + ${gridTemplateColumns}; +`; + const test = () => (
// width: 50% @@ -309,6 +353,34 @@ const test = () => ( // flexDirection (responsive) + // gridGap + + + // gridRowGap + + + // gridColumnGap + + + // gridRow + + // gridColumn + + // gridAutoFlow + + + // gridAutoRows + + + // gridAutoColumns + + + // gridTemplateRows + + + // gridTemplateColumns + + // flex (responsive) // justifySelf (responsive) From 4f1cbed8d7fb37e0bd203b3490d2686894c7e82f Mon Sep 17 00:00:00 2001 From: Atrahasis Date: Sat, 23 Jun 2018 13:02:39 +0200 Subject: [PATCH 007/346] [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 008/346] 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 009/346] 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 7aebf649630aab1a319de457c98c97f9f6d689af Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Sun, 24 Jun 2018 01:29:51 +0300 Subject: [PATCH 010/346] The Translations interface can be recursive. --- types/vuex-i18n/index.d.ts | 2 +- types/vuex-i18n/vuex-i18n-tests.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/vuex-i18n/index.d.ts b/types/vuex-i18n/index.d.ts index 2332ef4436..0f8a3ac1ea 100644 --- a/types/vuex-i18n/index.d.ts +++ b/types/vuex-i18n/index.d.ts @@ -17,7 +17,7 @@ declare module "vue/types/vue" { } export interface Translations { - [key: string]: string; + [key: string]: string | Translations; } export interface Ii18n { diff --git a/types/vuex-i18n/vuex-i18n-tests.ts b/types/vuex-i18n/vuex-i18n-tests.ts index 218bd12ccf..c24be6c70e 100644 --- a/types/vuex-i18n/vuex-i18n-tests.ts +++ b/types/vuex-i18n/vuex-i18n-tests.ts @@ -23,7 +23,10 @@ Vue.use(vuexI18n.plugin, store); // structured as object trees and will automatically be flattened by the the // plugin const translationsEn = { - content: "This is some {type} content" + content: "This is some {type} content", + tree: { + nested: "This is nested content" + } }; // translations can be kept in separate files for each language From c59225edd921020f1777b014800a70afd1b7ff92 Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Sun, 24 Jun 2018 01:31:10 +0300 Subject: [PATCH 011/346] translateIn supports just two parameters. --- types/vuex-i18n/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vuex-i18n/index.d.ts b/types/vuex-i18n/index.d.ts index 0f8a3ac1ea..92a6e679dd 100644 --- a/types/vuex-i18n/index.d.ts +++ b/types/vuex-i18n/index.d.ts @@ -64,7 +64,7 @@ export interface Ii18n { /** * get localized string from store in a given language if available. */ - translateIn(locale: string, key: string, options: any, pluralization?: number): string | undefined; + translateIn(locale: string, key: string, options?: any, pluralization?: number): string | undefined; /** * get localized string from store in a given language if available. From 0b312f74eaeed706edb197e5ea2c7ab42e969b38 Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Sun, 24 Jun 2018 01:45:29 +0300 Subject: [PATCH 012/346] Added example for translateIn call with two arguments. --- types/vuex-i18n/vuex-i18n-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/vuex-i18n/vuex-i18n-tests.ts b/types/vuex-i18n/vuex-i18n-tests.ts index c24be6c70e..82d9d864d9 100644 --- a/types/vuex-i18n/vuex-i18n-tests.ts +++ b/types/vuex-i18n/vuex-i18n-tests.ts @@ -42,3 +42,5 @@ Vue.i18n.add("de", translationsDe); // set the start locale to use Vue.i18n.set("en"); + +Vue.i18n.translateIn("en", "tree.nested"); From d918c54b7cc11fa0a24265b88fb5f726e05545a6 Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Sun, 24 Jun 2018 02:09:13 +0300 Subject: [PATCH 013/346] Updated header. --- types/vuex-i18n/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/vuex-i18n/index.d.ts b/types/vuex-i18n/index.d.ts index 92a6e679dd..30124209a1 100644 --- a/types/vuex-i18n/index.d.ts +++ b/types/vuex-i18n/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for vuex-i18n 1.7 // Project: https://github.com/dkfbasel/vuex-i18n // Definitions by: Cedric Kemp +// Noam Kfir // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 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 014/346] 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 28c5b788e76f967670782d88c83451f33d033739 Mon Sep 17 00:00:00 2001 From: Cahya Pribadi <534150+ozylog@users.noreply.github.com> Date: Mon, 25 Jun 2018 09:15:39 +1200 Subject: [PATCH 015/346] Update parameters.ts --- types/hapi/test/request/parameters.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hapi/test/request/parameters.ts b/types/hapi/test/request/parameters.ts index 3f19a02d45..33177d53b4 100644 --- a/types/hapi/test/request/parameters.ts +++ b/types/hapi/test/request/parameters.ts @@ -20,7 +20,7 @@ const serverRoute1: ServerRoute = { // Example 2 // http://localhost:8000/person/rafael/fijalkowski const getPerson: Lifecycle.Method = (request, h) => { - const nameParts = request.params.name.split('/'); + const nameParts = request.params ? request.params.name.split('/') : []; return { first: nameParts[0], last: nameParts[1] }; }; const serverRoute2: ServerRoute = { From ad5d4e8ef1eb39f7d5c425f7e8145a0c9b4ddffd Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Mon, 25 Jun 2018 08:51:02 +0300 Subject: [PATCH 016/346] Added locales method to Ii18n interface. --- types/vuex-i18n/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/vuex-i18n/index.d.ts b/types/vuex-i18n/index.d.ts index 30124209a1..00caa4863f 100644 --- a/types/vuex-i18n/index.d.ts +++ b/types/vuex-i18n/index.d.ts @@ -25,6 +25,9 @@ export interface Ii18n { /** get the current locale */ locale(): string; + /** get all the registered locales */ + locales(): string[]; + /** set the current locale (i.e. 'de', 'en') */ set(locale: string): void; From d762c0b513d1c428f31b9cba0d392d185a0feb24 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 25 Jun 2018 08:51:29 +0200 Subject: [PATCH 017/346] 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 018/346] 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 019/346] 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 d7473150a976eb64dfddb2047275e452d56b0829 Mon Sep 17 00:00:00 2001 From: YangusKhan <9inchsamurai@gmail.com> Date: Mon, 25 Jun 2018 11:46:26 -0600 Subject: [PATCH 020/346] add slate-react definitions --- types/slate-react/index.d.ts | 108 ++++++++++++++++++++++++ types/slate-react/package.json | 6 ++ types/slate-react/slate-react-tests.tsx | 28 ++++++ types/slate-react/tsconfig.json | 23 +++++ types/slate-react/tslint.json | 3 + 5 files changed, 168 insertions(+) create mode 100644 types/slate-react/index.d.ts create mode 100644 types/slate-react/package.json create mode 100644 types/slate-react/slate-react-tests.tsx create mode 100644 types/slate-react/tsconfig.json create mode 100644 types/slate-react/tslint.json diff --git a/types/slate-react/index.d.ts b/types/slate-react/index.d.ts new file mode 100644 index 0000000000..97d0b65614 --- /dev/null +++ b/types/slate-react/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for slate-react 0.12 +// Project: https://github.com/ianstormtaylor/slate +// Definitions by: Andy Kent +// Jamie Talbot +// Jan Löbel +// Patrick Sachs +// Brandon Shelton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +import { Slate } from 'slate'; +import * as Immutable from 'immutable'; +import * as React from 'react'; + +// Values prefixed with "data-..." (Used for spellchecking according to docs) +export interface RenderAttributes { + [key: string]: any; +} + +export interface RenderMarkProps { + attributes: RenderAttributes; + children: React.ReactNode; + editor: Editor; + mark: Slate.Mark; + marks: Immutable.Set; + node: Slate.Node; + offset: number; + text: string; +} + +export interface RenderNodeProps { + attributes: RenderAttributes; + children: React.ReactNode; + editor: Editor; + isSelected: boolean; + key: string; + node: Slate.Block; + parent: Slate.Node; +} + +export interface Plugin { + onBeforeInput?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onBlur?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onFocus?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onClick?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onCopy?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onCut?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onDrop?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onKeyDown?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onKeyUp?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onPaste?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onSelect?: (event: Event, change: Slate.Change, editor: Editor) => Slate.Change | void; + onChange?: (change: Slate.Change) => any; + renderEditor?: (props: RenderAttributes, editor: Editor) => object | void; + schema?: Slate.Schema; + decorateNode?: (node: Slate.Node) => Slate.Range[] | void; + renderMark?: (props: RenderMarkProps) => any; + renderNode?: (props: RenderNodeProps) => any; + renderPlaceholder?: (props: RenderAttributes) => any; + renderPortal?: (props: RenderAttributes) => any; + validateNode?: (node: Node) => any; +} + +export interface BasicEditorProps { + value: Slate.Value; + autoCorrect?: boolean; + autoFocus?: boolean; + className?: string; + onChange?: (change: Slate.Change) => any; + placeholder?: any; + plugins?: Plugin[]; + readOnly?: boolean; + role?: string; + schema?: Slate.Schema; + spellCheck?: boolean; + style?: { [key: string]: string }; + tabIndex?: number; +} + +// tsling:disable interface-over-type-literal +export type EditorProps = BasicEditorProps & Plugin; + +export interface EditorState { + schema: Slate.Schema; + value: Slate.Value; + stack: Slate.Stack; // [TODO] define stack +} + +export class Editor extends React.Component { + schema: Slate.Schema; + value: Slate.Value; + stack: Slate.Stack; + + // Instance Methods + blur(): void; + change(fn: (change: Slate.Change) => any): void; + change(...args: any[]): void; + focus(): void; +} + +export type SlateType = 'fragment' | 'html' | 'node' | 'rich' | 'text' | 'files'; + +export function findDOMNode(node: Slate.Node): Element; +export function findDOMRange(range: Slate.Range): Range; +export function findNode(element: Element, value: Slate.Value): Slate.Node; +export function findRange(selection: Selection, value: Slate.Value): Slate.Range; +export function getEventRange(event: Event, value: Slate.Value): Slate.Range; +export function getEventTransfer(event: Event): { type: SlateType; node: Slate.Node }; +export function setEventTransfer(event: Event, type: SlateType, data: any): void; diff --git a/types/slate-react/package.json b/types/slate-react/package.json new file mode 100644 index 0000000000..58698c580a --- /dev/null +++ b/types/slate-react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "immutable": "^3.8.2" + } +} diff --git a/types/slate-react/slate-react-tests.tsx b/types/slate-react/slate-react-tests.tsx new file mode 100644 index 0000000000..f576ea580c --- /dev/null +++ b/types/slate-react/slate-react-tests.tsx @@ -0,0 +1,28 @@ +import { Editor, Plugin, EditorProps } from "slate-react"; +import { Slate } from "slate"; +import * as React from "react"; + +class MyPlugin implements Plugin { + onChange(change: Slate.Change): void { + change.blur(); + } +} + +const myPlugin = new MyPlugin(); + +interface MyEditorState { + value: Slate.Value; +} + +class MyEditor extends React.Component { + constructor(props: EditorProps) { + super(props); + this.state = { + value: Slate.Value.create() + }; + } + + render() { + return ; + } +} diff --git a/types/slate-react/tsconfig.json b/types/slate-react/tsconfig.json new file mode 100644 index 0000000000..902d90178c --- /dev/null +++ b/types/slate-react/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "jsx": "preserve", + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "slate-react-tests.tsx" + ] +} diff --git a/types/slate-react/tslint.json b/types/slate-react/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/slate-react/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 028e9208268973612275ca7afa21139de13ed9fc Mon Sep 17 00:00:00 2001 From: YangusKhan <9inchsamurai@gmail.com> Date: Mon, 25 Jun 2018 12:00:32 -0600 Subject: [PATCH 021/346] match typescript version with react --- types/slate-react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/slate-react/index.d.ts b/types/slate-react/index.d.ts index 97d0b65614..492156363a 100644 --- a/types/slate-react/index.d.ts +++ b/types/slate-react/index.d.ts @@ -6,7 +6,7 @@ // Patrick Sachs // Brandon Shelton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 import { Slate } from 'slate'; import * as Immutable from 'immutable'; import * as React from 'react'; From 883e0733c02153e5dc647571256a3d028ec2b08a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 13 Jun 2018 13:24:04 -0700 Subject: [PATCH 022/346] 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 023/346] 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 024/346] 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 025/346] 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 026/346] 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 027/346] 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 028/346] 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 029/346] 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 030/346] 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 031/346] 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 032/346] 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 033/346] 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 034/346] 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 035/346] 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 036/346] 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 037/346] 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 038/346] 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 039/346] [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 6c2a6c8781772a8b4c7cefc1c652b49b00154a9f Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Wed, 27 Jun 2018 21:33:46 -0400 Subject: [PATCH 040/346] Fix indentation error in twig's index.d.ts --- types/twig/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twig/index.d.ts b/types/twig/index.d.ts index 29f0e0be56..d09e713e44 100644 --- a/types/twig/index.d.ts +++ b/types/twig/index.d.ts @@ -17,7 +17,7 @@ export interface Parameters { method?: any; options?: any; data?: any; - async?: any; + async?: any; } export interface Template { From 12c40169e904bddb6f0c0f7aff4364a534bf4da6 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Thu, 28 Jun 2018 10:59:20 +0800 Subject: [PATCH 041/346] 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 042/346] 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 043/346] 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 044/346] 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 045/346] 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 046/346] 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 047/346] 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 14a76fc8e4445a2da25492522a8e0a417e881708 Mon Sep 17 00:00:00 2001 From: Dmytro Kozlov Date: Thu, 28 Jun 2018 14:08:11 +0200 Subject: [PATCH 048/346] Allow to initialize state in constructor (#26912) Partial rollback of the https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26813 that allow developers to follow react recommended way of initializing state in constructor --- types/react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 1cd5f4ef09..42ef0401e1 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -306,7 +306,7 @@ declare namespace React { // In the future, if we can define its call signature conditionally // on the existence of `children` in `P`, then we should remove this. readonly props: Readonly<{ children?: ReactNode }> & Readonly

; - readonly state: null | Readonly; + state: null | Readonly; /** * @deprecated * https://reactjs.org/docs/legacy-context.html 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 049/346] 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 ); diff --git a/types/react-tracking/test/react-tracking-without-types-tests.tsx b/types/react-tracking/test/react-tracking-without-types-tests.tsx index 02a89d929c..a3cf2b4330 100644 --- a/types/react-tracking/test/react-tracking-without-types-tests.tsx +++ b/types/react-tracking/test/react-tracking-without-types-tests.tsx @@ -14,6 +14,11 @@ class ClassPage extends React.Component { // ... other stuff } + @track((_props, _state, [e]) => ({ event: `drag started at ${e.screenX}x${e.screenY}` })) + handleDrag(event: any) { + // no-op + } + // Only need to cast this to `any` because the settings for this project is to disallow implicit `any`. @track((props: any, state: any) => ({ event: `got ${props.someProp} and clicked ${state.isClicked}` })) render() { From 8a4fefd5433a11243528edac801fdcf19917ef0f Mon Sep 17 00:00:00 2001 From: Tyler Jones Date: Thu, 12 Jul 2018 09:21:53 -0700 Subject: [PATCH 272/346] Stripe card's cardholder name can be null (#27206) See example response in https://stripe.com/docs/api#retrieve_card --- types/stripe/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 420869592d..0704eef970 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4398,7 +4398,7 @@ declare namespace Stripe { /** * Cardholder name */ - name: string; + name: string | null; /** * Uniquely identifies this particular card number. You can use this attribute to check From e8dcdd9186fd6fe180721ac2c684c8979a2ffc01 Mon Sep 17 00:00:00 2001 From: James Greenaway Date: Thu, 12 Jul 2018 17:22:25 +0100 Subject: [PATCH 273/346] Use ComponentType rather than ComponentClass in grid-styled definitions (#27192) * Use ComponentType rather than ComponentClass Update grid-styled BoxProps to accept React component classes or stateless functions * Increment version number * Fix missed type --- types/grid-styled/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index af969b0cec..81c11df405 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for grid-styled 4.1 +// Type definitions for grid-styled 4.2 // Project: https://github.com/jxnblk/grid-styled // Definitions by: Anton Vasin // Victor Orlov @@ -8,7 +8,7 @@ export type Omit = Pick; -import { ComponentClass } from "react"; +import { ComponentType } from "react"; import { StyledComponentClass } from "styled-components"; export type ResponsiveProp = number | string | Array; @@ -39,7 +39,7 @@ export interface BoxProps extends Omit, "width" | "wrap" | "is"> { flex?: ResponsiveProp; order?: ResponsiveProp; - is?: string | ComponentClass; + is?: string | ComponentType; alignSelf?: ResponsiveProp; } @@ -77,4 +77,4 @@ export const theme: Theme; export type DivProps = Omit, "ref"> & { innerRef?: (el: HTMLDivElement) => any; }; -export const div: ComponentClass; +export const div: ComponentType; From 1a07f27101934e730eb8286c1d7b27309a237489 Mon Sep 17 00:00:00 2001 From: segayuu Date: Fri, 13 Jul 2018 01:23:46 +0900 Subject: [PATCH 274/346] [@types/Bluebird] Make iterative methods rigid types without type parameters. (#27216) * Resolve bluebird(Array) method * upgrade typescript version from bluebird-global * move testfile Reason: There are too many type definition files depending on jquery and it can not be managed. * upgrade typescript version from bluebird require packages * fix lint error: use-default-type-parameter --- types/acl/index.d.ts | 3 +- types/amqplib/index.d.ts | 2 +- types/asana/index.d.ts | 5 +- types/auth0/index.d.ts | 4 +- types/blue-tape/blue-tape-tests.ts | 2 - types/blue-tape/index.d.ts | 2 +- types/bluebird-global/index.d.ts | 2 +- .../test/jquery-tests.ts} | 2 +- types/bluebird-global/tsconfig.json | 3 +- types/bluebird-retry/index.d.ts | 2 +- types/bluebird/bluebird-tests.ts | 62 +++++++++++-------- types/bluebird/index.d.ts | 32 ++++------ types/bookshelf/index.d.ts | 2 +- types/bull/index.d.ts | 2 +- types/consolidate/index.d.ts | 4 +- types/consolidate/tslint.json | 1 + types/db-migrate-base/index.d.ts | 2 +- types/db-migrate-pg/index.d.ts | 2 +- types/dts-generator/index.d.ts | 2 +- types/epilogue/index.d.ts | 2 +- types/exceljs/exceljs-tests.ts | 3 +- types/fs-extra-promise/index.d.ts | 2 +- types/hexo-fs/hexo-fs-tests.ts | 32 +++++----- types/hexo-fs/index.d.ts | 2 +- types/inline-css/index.d.ts | 5 +- types/ioredis/index.d.ts | 2 +- types/jackrabbit/index.d.ts | 2 +- types/java/java-tests.ts | 4 +- types/jquery/tsconfig.json | 1 - types/karma-coverage/index.d.ts | 2 +- types/karma-webpack/index.d.ts | 2 +- types/karma/index.d.ts | 2 +- types/knex-postgis/index.d.ts | 2 +- types/knex/index.d.ts | 2 +- types/mock-knex/index.d.ts | 2 +- types/move-concurrently/index.d.ts | 2 +- types/node-mysql-wrapper/index.d.ts | 2 +- types/orientjs/index.d.ts | 2 +- types/project-oxford/index.d.ts | 2 +- types/promise-ftp/index.d.ts | 2 +- types/promise-sftp/index.d.ts | 2 +- types/redlock/index.d.ts | 2 +- types/redlock/v2/index.d.ts | 2 +- types/request-promise/index.d.ts | 2 +- types/restling/index.d.ts | 2 +- types/retry-as-promised/index.d.ts | 2 +- types/schwifty/index.d.ts | 2 +- types/sequelize-fixtures/index.d.ts | 2 +- types/sequelize/index.d.ts | 4 +- types/sequelize/v3/index.d.ts | 6 +- types/simple-oauth2/index.d.ts | 2 +- types/supertest-as-promised/index.d.ts | 2 +- types/umzug/index.d.ts | 2 +- types/viewporter/viewporter-tests.ts | 2 +- types/waterline/index.d.ts | 2 +- types/x-ray/index.d.ts | 2 +- 56 files changed, 124 insertions(+), 127 deletions(-) rename types/{jquery/test/bluebird-global-tests.ts => bluebird-global/test/jquery-tests.ts} (75%) diff --git a/types/acl/index.d.ts b/types/acl/index.d.ts index 43de3f5369..3f4df31aa2 100644 --- a/types/acl/index.d.ts +++ b/types/acl/index.d.ts @@ -2,9 +2,8 @@ // Project: https://github.com/optimalbits/node_acl // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 -/// /// /// diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 269ed0112e..9ad6d9ceda 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/squaremo/amqp.node // Definitions by: Michael Nahkies , Ab Reitsma , Nicolás Fantone , Nick Zelei // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index 9bbfb62508..4a0ce5a05f 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -2,10 +2,7 @@ // Project: https://github.com/Asana/node-asana // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; declare namespace asana { diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 18cc086ed8..e03ad5aa06 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; @@ -264,7 +264,7 @@ export interface CreateClientGrant { scope: string[]; } -export type Strategy = +export type Strategy = 'ad' | 'adfs' | 'amazon' | 'dropbox' | 'bitbucket' | 'aol' | 'auth0-adldap' | 'auth0-oidc' | 'auth0' | 'baidu' | 'bitly' | 'box' | 'custom' | 'daccount' | 'dwolla' | 'email' | 'evernote-sandbox' | 'evernote' | 'exact' | 'facebook' | 'fitbit' | 'flickr' | 'github' | diff --git a/types/blue-tape/blue-tape-tests.ts b/types/blue-tape/blue-tape-tests.ts index c34bc6e32c..526142158b 100644 --- a/types/blue-tape/blue-tape-tests.ts +++ b/types/blue-tape/blue-tape-tests.ts @@ -1,5 +1,3 @@ -/// - import tape = require('blue-tape'); import P = require('bluebird'); diff --git a/types/blue-tape/index.d.ts b/types/blue-tape/index.d.ts index c2d2d50ab5..b086124695 100644 --- a/types/blue-tape/index.d.ts +++ b/types/blue-tape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/spion/blue-tape // Definitions by: Haoqun Jiang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index 6b22cb7114..0d8ac4eeb3 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: d-ph // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /* * 1. Why use `bluebird-global` instead of `bluebird`? diff --git a/types/jquery/test/bluebird-global-tests.ts b/types/bluebird-global/test/jquery-tests.ts similarity index 75% rename from types/jquery/test/bluebird-global-tests.ts rename to types/bluebird-global/test/jquery-tests.ts index 3b7f58e9cd..c4c98fadfc 100644 --- a/types/jquery/test/bluebird-global-tests.ts +++ b/types/bluebird-global/test/jquery-tests.ts @@ -1,4 +1,4 @@ -/// +/// // Pulls in bluebird-global to test compatibility. // Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26328. diff --git a/types/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json index d037429e0d..aa19fd3cda 100644 --- a/types/bluebird-global/tsconfig.json +++ b/types/bluebird-global/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "bluebird-global-tests.ts" + "bluebird-global-tests.ts", + "test/jquery-tests.ts" ] } \ No newline at end of file diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index b7ba96495d..7192ff90a3 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jut-io/bluebird-retry // Definitions by: Pascal Vomhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index e5a39714d1..7330bd5b31 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -590,25 +590,39 @@ obj = fooProm.toJSON(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { +barProm = fooArrProm.spread((one: Foo, two: Foo, twotwo: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - -barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { +barProm = fooArrProm.spread((one: Foo, two: Foo, twotwo: Foo) => { return barThen; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO fix collection inference +fooArrProm = fooArrProm.all(); + +// $ExpectType Bluebird +fooProm.all(); -barArrProm = fooProm.all(); fooInspectionPromise = fooProm.reflect(); -barProm = fooProm.any(); -barArrProm = fooProm.some(num); -barProm = fooProm.race(); + +fooProm = fooArrProm.any(); + +// $ExpectType Bluebird +fooProm.any(); + +fooArrProm = fooArrProm.some(num); + +// $ExpectType Bluebird +fooProm.some(num); + +fooProm = fooArrProm.race(); + +// $ExpectType Bluebird +fooProm.race(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -649,21 +663,19 @@ Promise.all([fooProm, barProm, fooProm]).then(result => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO fix collection inference - -barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooArrProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }); -barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }, { concurrency: 1 }); -barArrProm = fooArrProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }, { concurrency: 1 @@ -671,37 +683,37 @@ barArrProm = fooArrProm.map((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooArrProm.mapSeries((item: Foo) => { +barArrProm = fooArrProm.mapSeries((item: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { return memo; }); -barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { return memo; }, bar); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { return bool; }); -fooArrProm = fooArrProm.filter((item: Foo) => { +fooArrProm = fooArrProm.filter((item: Foo) => { return bool; }); -fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { return bool; }, { concurrency: 1 }); -fooArrProm = fooArrProm.filter((item: Foo) => { +fooArrProm = fooArrProm.filter((item: Foo) => { return bool; }, { concurrency: 1 @@ -709,10 +721,10 @@ fooArrProm = fooArrProm.filter((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooArrProm = fooArrProm.each((item: Foo): Bar => bar); -fooArrProm = fooArrProm.each((item: Foo, index: number): Bar => index ? bar : null); -fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Bar => bar); -fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Promise => barProm); +fooArrProm = fooArrProm.each((item: Foo): Bar => bar); +fooArrProm = fooArrProm.each((item: Foo, index: number): Bar => index ? bar : null); +fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Bar => bar); +fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Promise => barProm); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 1e49e04f51..f6a869c392 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /*! * The code following this comment originates from: @@ -36,6 +36,8 @@ */ type CatchFilter = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); +type IterableItem = R extends Iterable ? U : never; +type IterableOrNever = R extends Iterable ? R : never; declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** @@ -453,14 +455,12 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. */ - spread(fulfilledHandler: (...values: W[]) => U | PromiseLike): Bluebird; - spread(fulfilledHandler: (...args: any[]) => U | PromiseLike): Bluebird; + spread(fulfilledHandler: (...values: Array>) => U | PromiseLike): Bluebird; /** * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - all(): Bluebird; + all(): Bluebird>; /** * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. @@ -471,48 +471,42 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - any(): Bluebird; + any(): Bluebird>; /** * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - some(count: number): Bluebird; + some(count: number): Bluebird>; /** * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - race(): Bluebird; + race(): Bluebird>; /** * Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - map(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + map(mapper: (item: IterableItem, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird ? U[] : never>; /** * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; + reduce(reducer: (memo: U, item: IterableItem, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird ? U : never>; /** * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - filter(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + filter(filterer: (item: IterableItem, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird>; /** * Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - each(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + each(iterator: (item: IterableItem, index: number, arrayLength: number) => U | PromiseLike): Bluebird>; /** * Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - mapSeries(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + mapSeries(iterator: (item: IterableItem, index: number, arrayLength: number) => U | PromiseLike): Bluebird ? U[] : never>; /** * Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index c151e81624..7467b3178f 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -2,7 +2,7 @@ // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Knex = require('knex'); import knex = require('knex'); diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index cdef279acb..17780d7d97 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -8,7 +8,7 @@ // Oleg Repin // David Koblas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Redis from "ioredis"; import * as Promise from "bluebird"; diff --git a/types/consolidate/index.d.ts b/types/consolidate/index.d.ts index bfe432214f..23f431d8f8 100644 --- a/types/consolidate/index.d.ts +++ b/types/consolidate/index.d.ts @@ -2,13 +2,13 @@ // Project: https://github.com/visionmedia/consolidate.js // Definitions by: Carlos Ballesteros Velasco , Theo Sherry , Nicolas Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts /// -/// +import Promise = require("bluebird"); declare var cons: Consolidate; diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a41bf5d19a..a403f5da2b 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -4,6 +4,7 @@ "adjacent-overload-signatures": false, "array-type": false, "arrow-return-shorthand": false, + "await-promise": false, "ban-types": false, "callable-types": false, "comment-format": false, diff --git a/types/db-migrate-base/index.d.ts b/types/db-migrate-base/index.d.ts index a881fa6a06..c1c9189a50 100644 --- a/types/db-migrate-base/index.d.ts +++ b/types/db-migrate-base/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/db-migrate/db-migrate-base // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/db-migrate-pg/index.d.ts b/types/db-migrate-pg/index.d.ts index 09cba26317..71726463e4 100644 --- a/types/db-migrate-pg/index.d.ts +++ b/types/db-migrate-pg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/db-migrate/pg // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as pg from "pg"; import * as DbMigrateBase from "db-migrate-base"; diff --git a/types/dts-generator/index.d.ts b/types/dts-generator/index.d.ts index 5ef99eb2b0..d4d730850c 100644 --- a/types/dts-generator/index.d.ts +++ b/types/dts-generator/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/SitePen/dts-generator#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import ts = require('typescript'); import Bluebird = require('bluebird'); diff --git a/types/epilogue/index.d.ts b/types/epilogue/index.d.ts index 3fe56b9e9f..e54f127d9e 100644 --- a/types/epilogue/index.d.ts +++ b/types/epilogue/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/dchester/epilogue // Definitions by: Satana Charuwichitratana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 import { Sequelize, diff --git a/types/exceljs/exceljs-tests.ts b/types/exceljs/exceljs-tests.ts index 684fad8719..0f5504fef0 100644 --- a/types/exceljs/exceljs-tests.ts +++ b/types/exceljs/exceljs-tests.ts @@ -1,7 +1,6 @@ import * as Excel from 'exceljs'; import * as stream from 'stream'; import * as fs from 'fs'; -import * as Bluebird from 'bluebird'; // most examples taken and adapted from README.md @@ -464,4 +463,4 @@ worksheet.commit(); workbook.commit().then(() => null); -Excel.config.setValue('promise', Bluebird); +Excel.config.setValue('promise', Promise); diff --git a/types/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts index a7222b9d5d..c2c12f6d28 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/overlookmotel/fs-extra-promise // Definitions by: midknight41 , Jason Swearingen , Hiromi Shikata // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/hexo-fs/hexo-fs-tests.ts b/types/hexo-fs/hexo-fs-tests.ts index 7bd5dc13b8..7bdd8918fb 100644 --- a/types/hexo-fs/hexo-fs-tests.ts +++ b/types/hexo-fs/hexo-fs-tests.ts @@ -558,7 +558,7 @@ it('emptyDir()', () => { return createDummyFolder(target).then(() => { return fs.emptyDir(target); - }).then(files => { + }).then>(files => { files.should.have.members([ 'e.txt', 'f.js', @@ -577,7 +577,7 @@ it('emptyDir()', () => { [join(target, 'folder', 'i.js'), false], [join(target, 'folder', '.j'), true] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -626,7 +626,7 @@ it('emptyDir() - ignoreHidden off', () => { return createDummyFolder(target).then(() => { return fs.emptyDir(target, { ignoreHidden: false }); - }).then(files => { + }).then>(files => { files.should.have.members([ join('.hidden', 'a.txt'), join('.hidden', 'b.js'), @@ -650,7 +650,7 @@ it('emptyDir() - ignoreHidden off', () => { [join(target, 'folder', 'i.js'), false], [join(target, 'folder', '.j'), false] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -664,7 +664,7 @@ it('emptyDir() - ignorePattern', () => { return createDummyFolder(target).then(() => { return fs.emptyDir(target, { ignorePattern: /\.js/ }); - }).then(files => { + }).then>(files => { files.should.have.members(['e.txt', join('folder', 'h.txt')]); return [ @@ -678,7 +678,7 @@ it('emptyDir() - ignorePattern', () => { [join(target, 'folder', 'i.js'), true], [join(target, 'folder', '.j'), true] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -692,7 +692,7 @@ it('emptyDir() - exclude', () => { return createDummyFolder(target).then(() => { return fs.emptyDir(target, { exclude: ['e.txt', join('folder', 'i.js')] }); - }).then(files => { + }).then>(files => { files.should.have.members(['f.js', join('folder', 'h.txt')]); return [ @@ -706,7 +706,7 @@ it('emptyDir() - exclude', () => { [join(target, 'folder', 'i.js'), true], [join(target, 'folder', '.j'), true] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -718,7 +718,7 @@ it('emptyDir() - exclude', () => { it('emptyDirSync()', () => { const target = join(tmpDir, 'test'); - return createDummyFolder(target).then(() => { + return createDummyFolder(target).then>(() => { const files = fs.emptyDirSync(target); files.should.have.members([ 'e.txt', @@ -738,7 +738,7 @@ it('emptyDirSync()', () => { [join(target, 'folder', 'i.js'), false], [join(target, 'folder', '.j'), true] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -750,7 +750,7 @@ it('emptyDirSync()', () => { it('emptyDirSync() - ignoreHidden off', () => { const target = join(tmpDir, 'test'); - return createDummyFolder(target).then(() => { + return createDummyFolder(target).then>(() => { const files = fs.emptyDirSync(target, { ignoreHidden: false }); files.should.have.members([ join('.hidden', 'a.txt'), @@ -775,7 +775,7 @@ it('emptyDirSync() - ignoreHidden off', () => { [join(target, 'folder', 'i.js'), false], [join(target, 'folder', '.j'), false] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -787,7 +787,7 @@ it('emptyDirSync() - ignoreHidden off', () => { it('emptyDirSync() - ignorePattern', () => { const target = join(tmpDir, 'test'); - return createDummyFolder(target).then(() => { + return createDummyFolder(target).then>(() => { const files = fs.emptyDirSync(target, { ignorePattern: /\.js/ }); files.should.have.members(['e.txt', join('folder', 'h.txt')]); @@ -802,7 +802,7 @@ it('emptyDirSync() - ignorePattern', () => { [join(target, 'folder', 'i.js'), true], [join(target, 'folder', '.j'), true] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); @@ -814,7 +814,7 @@ it('emptyDirSync() - ignorePattern', () => { it('emptyDirSync() - exclude', () => { const target = join(tmpDir, 'test'); - return createDummyFolder(target).then(() => { + return createDummyFolder(target).then>(() => { const files = fs.emptyDirSync(target, { exclude: ['e.txt', join('folder', 'i.js')] }); files.should.have.members(['f.js', join('folder', 'h.txt')]); @@ -829,7 +829,7 @@ it('emptyDirSync() - exclude', () => { [join(target, 'folder', 'i.js'), true], [join(target, 'folder', '.j'), true] ]; - }).map((data: [string, boolean]) => { + }).map(data => { return fs.exists(data[0]).then(exist => { exist.should.eql(data[1]); }); diff --git a/types/hexo-fs/index.d.ts b/types/hexo-fs/index.d.ts index 46c7b99d64..89166b230c 100644 --- a/types/hexo-fs/index.d.ts +++ b/types/hexo-fs/index.d.ts @@ -2,7 +2,7 @@ // Project: http://hexo.io/ // Definitions by: segayuu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); import { diff --git a/types/inline-css/index.d.ts b/types/inline-css/index.d.ts index 6d43b7975d..2567e01e85 100644 --- a/types/inline-css/index.d.ts +++ b/types/inline-css/index.d.ts @@ -2,10 +2,7 @@ // Project: https://github.com/jonkemp/inline-css // Definitions by: Philip Spain // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - +// TypeScript Version: 2.8 import Promise = require('bluebird'); diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index 7172f1e97d..45b334a205 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -7,7 +7,7 @@ // Shahar Mor // Whemoon Jang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /* =================== USAGE =================== import * as Redis from "ioredis"; diff --git a/types/jackrabbit/index.d.ts b/types/jackrabbit/index.d.ts index ec0ff27fa9..7be4ee23ed 100644 --- a/types/jackrabbit/index.d.ts +++ b/types/jackrabbit/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hunterloftis/jackrabbit // Definitions by: Elvis Adomnica // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 import { Connection, Options, Message } from 'amqplib'; diff --git a/types/java/java-tests.ts b/types/java/java-tests.ts index 4c79640733..42ca007155 100644 --- a/types/java/java-tests.ts +++ b/types/java/java-tests.ts @@ -1,11 +1,11 @@ import java = require('java'); -import BluePromise = require('bluebird'); +import pify = require('pify'); java.asyncOptions = { syncSuffix: 'Sync', asyncSuffix: '', promiseSuffix: 'P', - promisify: BluePromise.promisify + promisify: pify }; // todo: figure out why promise doesn't work here /* java.registerClientP((): Promise => { diff --git a/types/jquery/tsconfig.json b/types/jquery/tsconfig.json index 40a0bc76d4..86c99c452f 100644 --- a/types/jquery/tsconfig.json +++ b/types/jquery/tsconfig.json @@ -21,7 +21,6 @@ "files": [ "index.d.ts", "jquery-tests.ts", - "test/bluebird-global-tests.ts", "test/example-tests.ts", "test/longdesc-tests.ts", "test/learn-tests.ts", diff --git a/types/karma-coverage/index.d.ts b/types/karma-coverage/index.d.ts index 03ca857449..50be80d5cf 100644 --- a/types/karma-coverage/index.d.ts +++ b/types/karma-coverage/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/karma-runner/karma-coverage // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as karma from 'karma'; import * as istanbul from 'istanbul'; diff --git a/types/karma-webpack/index.d.ts b/types/karma-webpack/index.d.ts index 73e65a39f5..f7278b64a5 100644 --- a/types/karma-webpack/index.d.ts +++ b/types/karma-webpack/index.d.ts @@ -2,7 +2,7 @@ // Project: http://github.com/webpack/karma-webpack // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import 'karma'; import * as Webpack from 'webpack'; diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index 682cb35bf2..cc4525566b 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Tanguy Krotoff // James Garbutt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/knex-postgis/index.d.ts b/types/knex-postgis/index.d.ts index b63c1f11dd..193c0aa4a5 100644 --- a/types/knex-postgis/index.d.ts +++ b/types/knex-postgis/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jfgodoy/knex-postgis // Definitions by: Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as GeoJSON from 'geojson'; import * as Knex from 'knex'; diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 20418e1fac..c80238f259 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -7,7 +7,7 @@ // Satana Charuwichitratana // Shrey Jain // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/mock-knex/index.d.ts b/types/mock-knex/index.d.ts index bad0aadb01..8c3f022bc7 100644 --- a/types/mock-knex/index.d.ts +++ b/types/mock-knex/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/colonyamerican/mock-knex // Definitions by: Jesse Zhang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/move-concurrently/index.d.ts b/types/move-concurrently/index.d.ts index 277c1299f1..75434a4224 100644 --- a/types/move-concurrently/index.d.ts +++ b/types/move-concurrently/index.d.ts @@ -2,7 +2,7 @@ // Project: https://www.npmjs.com/package/move-concurrently // Definitions by: Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /** * Recursively moves from to to and resolves its promise when finished. If to already exists then the promise will be rejected with an EEXIST error. diff --git a/types/node-mysql-wrapper/index.d.ts b/types/node-mysql-wrapper/index.d.ts index 170ff5eca0..82170b4704 100644 --- a/types/node-mysql-wrapper/index.d.ts +++ b/types/node-mysql-wrapper/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/nodets/node-mysql-wrapper // Definitions by: Makis Maropoulos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/orientjs/index.d.ts b/types/orientjs/index.d.ts index 19f615efd0..31980678bb 100644 --- a/types/orientjs/index.d.ts +++ b/types/orientjs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/orientechnologies/orientjs // Definitions by: [Saeed Tabrizi] // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Last Update : 20-7-2017 // Compatible with Orientdb >= 2.2.15 and orientjs >= 2.2.x features . diff --git a/types/project-oxford/index.d.ts b/types/project-oxford/index.d.ts index f84676c94c..83c73da3f7 100644 --- a/types/project-oxford/index.d.ts +++ b/types/project-oxford/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/felixrieseberg/project-oxford // Definitions by: Scott Southwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/promise-ftp/index.d.ts b/types/promise-ftp/index.d.ts index 9253b4d093..23aa5333e0 100644 --- a/types/promise-ftp/index.d.ts +++ b/types/promise-ftp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/realtymaps/promise-ftp // Definitions by: coolreader18 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /// diff --git a/types/promise-sftp/index.d.ts b/types/promise-sftp/index.d.ts index 05d941856e..fc75bd9bee 100644 --- a/types/promise-sftp/index.d.ts +++ b/types/promise-sftp/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/realtymaps/promise-sftp // Definitions by: coolreader18 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /// diff --git a/types/redlock/index.d.ts b/types/redlock/index.d.ts index 27e6784886..9b3af6d0b7 100644 --- a/types/redlock/index.d.ts +++ b/types/redlock/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Ilya Mochalov // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; import { EventEmitter } from 'events'; diff --git a/types/redlock/v2/index.d.ts b/types/redlock/v2/index.d.ts index d683ec83a4..9ca431c449 100644 --- a/types/redlock/v2/index.d.ts +++ b/types/redlock/v2/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mike-marcacci/node-redlock // Definitions by: Ilya Mochalov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as redis from 'redis'; import * as Promise from 'bluebird'; diff --git a/types/request-promise/index.d.ts b/types/request-promise/index.d.ts index 8b2382d049..895213e770 100644 --- a/types/request-promise/index.d.ts +++ b/types/request-promise/index.d.ts @@ -5,7 +5,7 @@ // Aya Morisawa // Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import request = require('request'); import http = require('http'); diff --git a/types/restling/index.d.ts b/types/restling/index.d.ts index 79bc2d8c2c..b4f03a6633 100644 --- a/types/restling/index.d.ts +++ b/types/restling/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/lucasfeliciano/restling // Definitions by: Alessandro vergani // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from "bluebird"; import * as Restler from "restler"; diff --git a/types/retry-as-promised/index.d.ts b/types/retry-as-promised/index.d.ts index 429e0bb6d1..6287827def 100644 --- a/types/retry-as-promised/index.d.ts +++ b/types/retry-as-promised/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mickhansen/retry-as-promised // Definitions by: Florian Oellerich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); diff --git a/types/schwifty/index.d.ts b/types/schwifty/index.d.ts index e95de1af55..9ac2556c2b 100644 --- a/types/schwifty/index.d.ts +++ b/types/schwifty/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapipal/schwifty // Definitions by: ozum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 // HELP NEEDED: If possible, find a better way to define Server.models, Request.models and ResponseToolkit.models // They are dynamic types extended from SchwiftyModel. diff --git a/types/sequelize-fixtures/index.d.ts b/types/sequelize-fixtures/index.d.ts index 06e7aaf157..773bb43982 100644 --- a/types/sequelize-fixtures/index.d.ts +++ b/types/sequelize-fixtures/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/domasx2/sequelize-fixtures // Definitions by: Christian Schwarz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Sequelize from "sequelize"; diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index f003b77731..ecbdba3602 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -15,7 +15,7 @@ // Nick Schultz // Thomas Breleur // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Based on original work by: samuelneff @@ -5263,7 +5263,7 @@ declare namespace sequelize { * Set to true or a string with the attribute name you want to use to enable. */ version?: boolean | string; - + /** * Throws an error when no records found */ diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 11b6775846..484edd089d 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -6,7 +6,7 @@ // Nick Mueller // James D. Callahan III // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Based on original work by: samuelneff @@ -3140,7 +3140,7 @@ declare namespace sequelize { /** * Shortcut for types used in FindOptions.attributes */ - type FindOptionsAttributesArray = Array; + type FindOptionsAttributesArray = Array; /** * Options that are passed to any model creating a SELECT query @@ -6183,7 +6183,7 @@ declare namespace sequelize { camelizeIf(str: string, condition: boolean): string; underscoredIf(str: string, condition: boolean): string; - + _: SequelizeLoDash; /** diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index f5f7659b99..21718c0722 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Michael Müller , // Troy Lamerton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Bluebird = require("bluebird"); diff --git a/types/supertest-as-promised/index.d.ts b/types/supertest-as-promised/index.d.ts index f88c80eaba..1b12d57b0f 100644 --- a/types/supertest-as-promised/index.d.ts +++ b/types/supertest-as-promised/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/WhoopInc/supertest-as-promised // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as supertest from "supertest"; import * as superagent from "superagent"; diff --git a/types/umzug/index.d.ts b/types/umzug/index.d.ts index b60028c566..f74c5933be 100644 --- a/types/umzug/index.d.ts +++ b/types/umzug/index.d.ts @@ -4,7 +4,7 @@ // Margus Lamp // Troy McKinnon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import { EventEmitter } from 'events'; import Sequelize = require("sequelize"); diff --git a/types/viewporter/viewporter-tests.ts b/types/viewporter/viewporter-tests.ts index 94df0749fa..59fa5cd20f 100644 --- a/types/viewporter/viewporter-tests.ts +++ b/types/viewporter/viewporter-tests.ts @@ -109,7 +109,7 @@ function test_swipey() { var canvas = $('canvas')[0]; var context = canvas.getContext('2d'); var iOS = (/iphone|ipad/i).test(navigator.userAgent); - var pointers = new Map(); + var pointers = new Map(); // handle resizing / rotating of the viewport var width, height; $(window).bind(viewporter.ACTIVE ? 'viewportchange' : 'resize', function () { diff --git a/types/waterline/index.d.ts b/types/waterline/index.d.ts index a3aa7c04ee..b0a23d8e5a 100644 --- a/types/waterline/index.d.ts +++ b/types/waterline/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/balderdashy/waterline // Definitions by: Alexandro Libertino // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/x-ray/index.d.ts b/types/x-ray/index.d.ts index 271155ef94..345059a8eb 100644 --- a/types/x-ray/index.d.ts +++ b/types/x-ray/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/lapwinglabs/x-ray#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// From 532aedc04db38f80c795eef8e2ccd2d512ad3c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20P=C3=A9rez=20Batanero?= Date: Thu, 12 Jul 2018 18:24:20 +0200 Subject: [PATCH 275/346] Add ignoreUnavailable param to delete indices (#27215) --- types/elasticsearch/elasticsearch-tests.ts | 7 +++++++ types/elasticsearch/index.d.ts | 1 + 2 files changed, 8 insertions(+) diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 35b4e39798..85574e3c91 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -44,6 +44,13 @@ client.indices.delete({ }, (error) => { }); +client.indices.delete({ + index: 'test_index', + ignoreUnavailable: true +}).then((body) => { +}, (error) => { +}); + client.deleteByQuery({ index: 'test_index', type: 'test_type', diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index 2cfd14f689..c791db72c3 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -1143,6 +1143,7 @@ export interface IndicesDeleteParams extends GenericParams { timeout?: TimeSpan; masterTimeout?: TimeSpan; index: NameList; + ignoreUnavailable?: boolean; } export interface IndicesDeleteAliasParams extends GenericParams { From 251bfc8c1a4808ef7f33b048383798fa71a36914 Mon Sep 17 00:00:00 2001 From: Benedict Etzel Date: Thu, 12 Jul 2018 18:25:00 +0200 Subject: [PATCH 276/346] [react-i18next] Update for 7.8.0 (#27186) * react-i18next: Support ReactNode parents in Trans * react-i18next: Support defaults-style Trans for 7.8.0 --- types/react-i18next/index.d.ts | 3 ++- types/react-i18next/src/trans.d.ts | 9 ++++++++- types/react-i18next/test/react-i18next-tests.tsx | 11 +++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/types/react-i18next/index.d.ts b/types/react-i18next/index.d.ts index 5ea0e7cb91..3f019617c1 100644 --- a/types/react-i18next/index.d.ts +++ b/types/react-i18next/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-i18next 7.6 +// Type definitions for react-i18next 7.8 // Project: https://github.com/i18next/react-i18next // Definitions by: Giedrius Grabauskas // Simon Baumann +// Benedict Etzel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-i18next/src/trans.d.ts b/types/react-i18next/src/trans.d.ts index c5652315c7..3ef535cf5d 100644 --- a/types/react-i18next/src/trans.d.ts +++ b/types/react-i18next/src/trans.d.ts @@ -5,13 +5,20 @@ export interface TOptions { [key: string]: any; } +export interface Values { + [key: string]: any; +} + export interface TransProps { i18nKey?: string; count?: number; - parent?: string; + parent?: React.ReactNode | (() => React.ReactNode); i18n?: i18n; t?: TranslationFunction; tOptions?: TOptions; + defaults?: string; + values?: Values; + components?: React.ReactNode[]; } export default class Trans extends React.Component { } diff --git a/types/react-i18next/test/react-i18next-tests.tsx b/types/react-i18next/test/react-i18next-tests.tsx index 7f49913c44..d3afe7643a 100644 --- a/types/react-i18next/test/react-i18next-tests.tsx +++ b/types/react-i18next/test/react-i18next-tests.tsx @@ -114,12 +114,23 @@ loadNamespaces({components: [App], i18n}).then(() => { ; ; ; +}/>; +

}/>; ; ; ; ; +placeholder + ]} + values={{ + universe: "World" + }} +/>; type Key = "view" | "nav"; From 5831bb2199fdd1b39857223e414a7a0143a1bdda Mon Sep 17 00:00:00 2001 From: ikokostya Date: Thu, 12 Jul 2018 19:25:37 +0300 Subject: [PATCH 277/346] [got] Body type must be an object in GotJSONOptions (#27168) * Revert "[got] Allow primitive types in JSON body for POST requests (#27109)" This reverts commit 03eede695193d0d78291cee1262f7d59aa7fd4f9. * [got] Add link to issue with json body type * Improve comment --- types/got/got-tests.ts | 16 ---------------- types/got/index.d.ts | 3 ++- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/types/got/got-tests.ts b/types/got/got-tests.ts index a05812be8d..1eb2d89aa8 100644 --- a/types/got/got-tests.ts +++ b/types/got/got-tests.ts @@ -84,22 +84,6 @@ got.patch('todomvc.com', {hostname: 'todomvc'}).then(response => str = response. got.head('todomvc.com', {hostname: 'todomvc'}).then(response => str = response.body); got.delete('todomvc.com', {hostname: 'todomvc'}).then(response => str = response.body); -// Allow primitive types as JSON body. -{ - got.post('todomvc.com', { - json: true, - body: 1 - }); - got.post('todomvc.com', { - json: true, - body: null - }); - got.post('todomvc.com', { - json: true, - body: 'str' - }); -} - got.stream('todomvc.com').pipe(fs.createWriteStream('index.html')); fs.createReadStream('index.html').pipe(got.stream.get('todomvc.com')); diff --git a/types/got/index.d.ts b/types/got/index.d.ts index 6b44aab339..86a3d42131 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -100,7 +100,8 @@ declare namespace got { } interface GotJSONOptions extends GotOptions { - body?: any; + // Body must be an object or array. See https://github.com/sindresorhus/got/issues/511 + body?: object; form?: boolean; json: true; } From 0db033ec96f78d1964799f19970641da0854c7f5 Mon Sep 17 00:00:00 2001 From: WEBER Logan Date: Thu, 12 Jul 2018 18:26:49 +0200 Subject: [PATCH 278/346] fix(serialport): missing includeDelimiter option for delimiter parser (#27222) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If changing an existing definition: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://node-serialport.github.io/utilities/parser-delimiter_delimiter.js.html - [ ] Increase the version number in the header if appropriate. - [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. --- types/serialport/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/serialport/index.d.ts b/types/serialport/index.d.ts index 1e8aa9faa5..2f5f8fc55d 100644 --- a/types/serialport/index.d.ts +++ b/types/serialport/index.d.ts @@ -87,7 +87,7 @@ declare namespace SerialPort { constructor(); } class Delimiter extends Stream.Transform { - constructor(options: {delimiter: string | Buffer | number[]}); + constructor(options: {delimiter: string | Buffer | number[], includeDelimiter?: boolean}); } class Readline extends Delimiter { constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'}); From 35835aa27530188255ddfafd49dea35a24f88d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Thu, 12 Jul 2018 18:30:10 +0200 Subject: [PATCH 279/346] [react-navigation] Adding support for parameters in NavigationInjectedProps (#27226) * Adding a failing test for getParam This demonstrates that typing of `navigation.getParam` works when a parameter type is provided. This fails with the following error: ``` ERROR: 559:54 expect TypeScript@next compile error: Argument of type '"title"' is not assignable to parameter of type '"unknown"'. ``` * Making test pass --- types/react-navigation/index.d.ts | 4 ++-- types/react-navigation/react-navigation-tests.tsx | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 02dc72d98f..be2e84a345 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1160,8 +1160,8 @@ export const HeaderBackButton: React.ComponentClass; */ export const Header: React.ComponentClass; -export interface NavigationInjectedProps { - navigation: NavigationScreenProp; +export interface NavigationInjectedProps

{ + navigation: NavigationScreenProp; } export function withNavigation( diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 40aa75cbc3..f6f6aa3681 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -550,3 +550,13 @@ const MyFocusedComponentWithNavigationFocus = withNavigationFocus { const backButtonRef = ref; }} />; + +// Test Screen with params + +interface MyScreenParams { title: string; } +class MyScreen extends React.Component> { + render() { + const title = this.props.navigation.getParam('title'); + return +

+ )} + /> + ( +
+

Gandalf

+ + +
+ )} + /> + ( +
+

Dumbledore

+ +
+ )} + /> + + )} + /> +); diff --git a/types/react-albus/tsconfig.json b/types/react-albus/tsconfig.json new file mode 100644 index 0000000000..23dcedc16b --- /dev/null +++ b/types/react-albus/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-albus-tests.tsx" + ] +} diff --git a/types/react-albus/tslint.json b/types/react-albus/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-albus/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b2bbdd82410fa7b289de92ad909e7d27f6389934 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Sun, 15 Jul 2018 20:32:52 +0100 Subject: [PATCH 329/346] Add type declarations for stream-shift. (#27295) --- types/stream-shift/index.d.ts | 10 ++++++++++ types/stream-shift/stream-shift-tests.ts | 6 ++++++ types/stream-shift/tsconfig.json | 23 +++++++++++++++++++++++ types/stream-shift/tslint.json | 1 + 4 files changed, 40 insertions(+) create mode 100644 types/stream-shift/index.d.ts create mode 100644 types/stream-shift/stream-shift-tests.ts create mode 100644 types/stream-shift/tsconfig.json create mode 100644 types/stream-shift/tslint.json diff --git a/types/stream-shift/index.d.ts b/types/stream-shift/index.d.ts new file mode 100644 index 0000000000..5b26fd3217 --- /dev/null +++ b/types/stream-shift/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for stream-shift 1.0 +// Project: https://github.com/mafintosh/stream-shift +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function shift(stream: NodeJS.ReadableStream): Buffer | string | null; + +export = shift; diff --git a/types/stream-shift/stream-shift-tests.ts b/types/stream-shift/stream-shift-tests.ts new file mode 100644 index 0000000000..391419df96 --- /dev/null +++ b/types/stream-shift/stream-shift-tests.ts @@ -0,0 +1,6 @@ +import shift = require("stream-shift"); +import { createReadStream, createWriteStream } from "fs"; + +const stream = createReadStream(__filename); + +const x: Buffer | string | null = shift(stream); diff --git a/types/stream-shift/tsconfig.json b/types/stream-shift/tsconfig.json new file mode 100644 index 0000000000..59db2bfad5 --- /dev/null +++ b/types/stream-shift/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", + "stream-shift-tests.ts" + ] +} diff --git a/types/stream-shift/tslint.json b/types/stream-shift/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stream-shift/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From c3293bdfe3d6536ca8b124ff2db1dddb124578b0 Mon Sep 17 00:00:00 2001 From: Ben O'Sullivan Date: Mon, 16 Jul 2018 05:34:22 +1000 Subject: [PATCH 330/346] Added typings for websocket-async (#27293) * Added typings for websocket-async * Updated in accordance with linter * Update tsconfig.json --- types/websocket-async/index.d.ts | 87 +++++++++++++++++++ types/websocket-async/tsconfig.json | 26 ++++++ types/websocket-async/tslint.json | 1 + .../websocket-async/websocket-async-tests.ts | 4 + 4 files changed, 118 insertions(+) create mode 100644 types/websocket-async/index.d.ts create mode 100644 types/websocket-async/tsconfig.json create mode 100644 types/websocket-async/tslint.json create mode 100644 types/websocket-async/websocket-async-tests.ts diff --git a/types/websocket-async/index.d.ts b/types/websocket-async/index.d.ts new file mode 100644 index 0000000000..36bb12e08e --- /dev/null +++ b/types/websocket-async/index.d.ts @@ -0,0 +1,87 @@ +// Type definitions for websocket-async 1.3 +// Project: https://github.com/jcao219/websocket-async +// Definitions by: Ben O'Sullivan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Typescript Version: 2.7 + +/** + * An asynchronous WebSocket client. + * @example + * // Set up connection. + * const webSocketClient = new WebSocketClient; + * // Connect. + * await webSocketClient.connect('ws://www.example.com/'); + * // Send is synchronous. + * webSocketClient.send('Hello!'); + * // Receive is asynchronous. + * console.log(await webSocketClient.receive()); + * // See if there are any more messages received. + * if (webSocketClient.dataAvailable !== 0) { + * console.log(await webSocketClient.receive()); + * } + * // Close the connection. + * await webSocketClient.disconnect(); + */ +declare class WebSocketClient { + _socket: WebSocket; + + _closeEvent: CloseEvent | null; + + _receiveCallbacksQueue: Array<{ resolve: (data: any) => void, reject: (reason: any) => void }>; + + _receiveDataQueue: any[]; + + constructor(); + + /** + * Whether a connection is currently open. + * @returns true if the connection is open. + */ + connected(): boolean; + + /** + * The number of messages available to receive. + * @returns The number of queued messages that can be retrieved with {@link #receive} + */ + dataAvailable(): number; + + /** + * Sets up a WebSocket connection to specified url. Resolves when the + * connection is established. Can be called again to reconnect to any url. + */ + connect(url: string, protocols?: string): Promise; + + /** + * Send data through the websocket. + * Must be connected. See {@link #connected}. + */ + send(data: any): void; + + /** + * Asynchronously receive data from the websocket. + * Resolves immediately if there is buffered, unreceived data. + * Otherwise, resolves with the next rececived message, + * or rejects if disconnected. + * @returns A promise that resolves with the data received. + */ + receive(): Promise; + + /** + * Initiates the close handshake if there is an active connection. + * Returns a promise that will never reject. + * The promise resolves once the WebSocket connection is closed. + */ + disconnect(code?: number, reason?: string): Promise; + + /** + * Sets up the event listeners, which do the bulk of the work. + */ + private _setupListenersOnConnect(): Promise; + + /** + * Resets the receive arrays and close events, called in the constructor + */ + private _reset(): void; +} + +export default WebSocketClient; diff --git a/types/websocket-async/tsconfig.json b/types/websocket-async/tsconfig.json new file mode 100644 index 0000000000..78b5de7ea6 --- /dev/null +++ b/types/websocket-async/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "es2015.promise", + "webworker" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "websocket-async-tests.ts" + ] +} diff --git a/types/websocket-async/tslint.json b/types/websocket-async/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/websocket-async/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/websocket-async/websocket-async-tests.ts b/types/websocket-async/websocket-async-tests.ts new file mode 100644 index 0000000000..f32192be95 --- /dev/null +++ b/types/websocket-async/websocket-async-tests.ts @@ -0,0 +1,4 @@ +import WebSocketClient from 'websocket-async'; + +const connection = new WebSocketClient(); +connection.connect(''); From 40ed9ae071f2114d629e1036b70cb141c2ad96ae Mon Sep 17 00:00:00 2001 From: Ika Date: Mon, 16 Jul 2018 03:34:50 +0800 Subject: [PATCH 331/346] feat(find-parent-dir): initial commit (#27290) --- .../find-parent-dir/find-parent-dir-tests.ts | 19 +++++++++++++++++++ types/find-parent-dir/index.d.ts | 19 +++++++++++++++++++ types/find-parent-dir/tsconfig.json | 16 ++++++++++++++++ types/find-parent-dir/tslint.json | 3 +++ 4 files changed, 57 insertions(+) create mode 100644 types/find-parent-dir/find-parent-dir-tests.ts create mode 100644 types/find-parent-dir/index.d.ts create mode 100644 types/find-parent-dir/tsconfig.json create mode 100644 types/find-parent-dir/tslint.json diff --git a/types/find-parent-dir/find-parent-dir-tests.ts b/types/find-parent-dir/find-parent-dir-tests.ts new file mode 100644 index 0000000000..31b3307377 --- /dev/null +++ b/types/find-parent-dir/find-parent-dir-tests.ts @@ -0,0 +1,19 @@ +/// + +import findParentDir = require("find-parent-dir"); + +let parentDir: string | null; + +findParentDir(__dirname, ".git", (err, dir) => { + if (err) { + console.error("error", err); + } else { + parentDir = dir; + } +}); + +try { + parentDir = findParentDir.sync(__dirname, ".git"); +} catch (err) { + console.error("error", err); +} diff --git a/types/find-parent-dir/index.d.ts b/types/find-parent-dir/index.d.ts new file mode 100644 index 0000000000..0302255198 --- /dev/null +++ b/types/find-parent-dir/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for find-parent-dir 0.3 +// Project: https://github.com/thlorenz/find-parent-dir +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds the first parent directory that contains a given file or directory. + */ +declare function findParentDir( + currentFullPath: string, + clue: string, + cb: (err: any, dir: string | null) => void +): void; + +declare namespace findParentDir { + function sync(currentFullPath: string, clue: string): string | null; +} + +export = findParentDir; diff --git a/types/find-parent-dir/tsconfig.json b/types/find-parent-dir/tsconfig.json new file mode 100644 index 0000000000..83c817d86c --- /dev/null +++ b/types/find-parent-dir/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "find-parent-dir-tests.ts"] +} diff --git a/types/find-parent-dir/tslint.json b/types/find-parent-dir/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-parent-dir/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From e06903040a0412463231421cb8883a1cd73fe909 Mon Sep 17 00:00:00 2001 From: Ika Date: Mon, 16 Jul 2018 03:35:11 +0800 Subject: [PATCH 332/346] feat(find-project-root): initial commit (#27291) --- .../find-project-root-tests.ts | 7 +++++ types/find-project-root/index.d.ts | 27 +++++++++++++++++++ types/find-project-root/tsconfig.json | 16 +++++++++++ types/find-project-root/tslint.json | 3 +++ 4 files changed, 53 insertions(+) create mode 100644 types/find-project-root/find-project-root-tests.ts create mode 100644 types/find-project-root/index.d.ts create mode 100644 types/find-project-root/tsconfig.json create mode 100644 types/find-project-root/tslint.json diff --git a/types/find-project-root/find-project-root-tests.ts b/types/find-project-root/find-project-root-tests.ts new file mode 100644 index 0000000000..b77d7846d0 --- /dev/null +++ b/types/find-project-root/find-project-root-tests.ts @@ -0,0 +1,7 @@ +/// + +import findProjectRoot = require("find-project-root"); + +const root: string | null = findProjectRoot(process.cwd(), { + maxDepth: 12 +}); diff --git a/types/find-project-root/index.d.ts b/types/find-project-root/index.d.ts new file mode 100644 index 0000000000..a541c1f982 --- /dev/null +++ b/types/find-project-root/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for find-project-root 1.1 +// Project: https://github.com/kirstein/find-project-root +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds the project root by custom markers + */ +declare function findProjectRoot( + path: string, + options?: findProjectRoot.Options +): null | string; + +declare namespace findProjectRoot { + interface Options { + /** + * total number of levels the algorithm can traverse + */ + maxDepth?: number; + /** + * markers that it will search for + */ + markers?: string[]; + } +} + +export = findProjectRoot; diff --git a/types/find-project-root/tsconfig.json b/types/find-project-root/tsconfig.json new file mode 100644 index 0000000000..1e727f9025 --- /dev/null +++ b/types/find-project-root/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "find-project-root-tests.ts"] +} diff --git a/types/find-project-root/tslint.json b/types/find-project-root/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-project-root/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 2550b11007a6d863184167f38fa67ddb60443fdc Mon Sep 17 00:00:00 2001 From: Marcin Tomczyk Date: Sun, 15 Jul 2018 21:38:16 +0200 Subject: [PATCH 333/346] Add types for jexl@1.1 by TechnologyAdvice; new owner TomFrost (#27269) --- types/jexl/index.d.ts | 113 +++++++++++++++++++++++++++++++++++++++ types/jexl/jexl-tests.ts | 77 ++++++++++++++++++++++++++ types/jexl/tsconfig.json | 23 ++++++++ types/jexl/tslint.json | 1 + 4 files changed, 214 insertions(+) create mode 100644 types/jexl/index.d.ts create mode 100644 types/jexl/jexl-tests.ts create mode 100644 types/jexl/tsconfig.json create mode 100644 types/jexl/tslint.json diff --git a/types/jexl/index.d.ts b/types/jexl/index.d.ts new file mode 100644 index 0000000000..953702346c --- /dev/null +++ b/types/jexl/index.d.ts @@ -0,0 +1,113 @@ +// Type definitions for jexl 1.1 +// Project: https://github.com/TechnologyAdvice/jexl +// Definitions by: Marcin Tomczyk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Currently maintained by https://github.com/TomFrost/Jexl + +type TransformFunction = (value: any, args?: object) => any; + +type BinaryOpFunction = (left: any, right: any) => any; + +type UnaryOpFunction = (right: any) => any; + +type EvalCallbackFunction = (err: Error | null, result: any) => void; + +/** + * Jexl is the Javascript Expression Language, capable of parsing and + * evaluating basic to complex expression strings, combined with advanced + * xpath-like drilldown into native Javascript objects. + */ +declare class Jexl { + /** + * Adds a binary operator to Jexl at the specified precedence. The higher the + * precedence, the earlier the operator is applied in the order of operations. + * For example, * has a higher precedence than +, because multiplication comes + * before division. + * + * Please see grammar.js for a listing of all default operators and their + * precedence values in order to choose the appropriate precedence for the + * new operator. + * @param operator The operator string to be added + * @param precedence The operator's precedence + * @param fn A function to run to calculate the result. The function + * will be called with two arguments: left and right, denoting the values + * on either side of the operator. It should return either the resulting + * value, or a Promise that resolves with the resulting value. + */ + addBinaryOp(operator: string, precedence: number, fn: BinaryOpFunction): void; + + /** + * Adds a unary operator to Jexl. Unary operators are currently only supported + * on the left side of the value on which it will operate. + * @param operator The operator string to be added + * @param fn A function to run to calculate the result. The function + * will be called with one argument: the literal value to the right of the + * operator. It should return either the resulting value, or a Promise + * that resolves with the resulting value. + */ + addUnaryOp(operator: string, fn: UnaryOpFunction): void; + + /** + * Adds or replaces a transform function in this Jexl instance. + * @param name The name of the transform function, as it will be used + * within Jexl expressions + * @param fn The function to be executed when this transform is + * invoked. It will be provided with two arguments: + * - {*} value: The value to be transformed + * - {{}} args: The arguments for this transform + * - {function} cb: A callback function to be called with an error + * if the transform fails, or a null first argument and the + * transformed value as the second argument on success. + */ + addTransform(name: string, fn: TransformFunction): void; + + /** + * Syntactic sugar for calling {@link #Jexl:addTransform} repeatedly. This function + * accepts a map of one or more transform names to their transform function. + * @param map A map of transform names to transform functions + */ + addTransforms(map: { [key: string]: TransformFunction }): void; + + /** + * Retrieves a previously set transform function. + * @param name The name of the transform function + * @returns The transform function + */ + getTransform(name: string): TransformFunction; + + /** + * Evaluates a Jexl string within an optional context. + * @param expression The Jexl expression to be evaluated + * @param context A mapping of variables to values, which will be + * made accessible to the Jexl expression when evaluating it + * @param cb An optional callback function to be executed when + * evaluation is complete. It will be supplied with two arguments: + * - err: Present if an error occurred + * - result: The result of the evaluation + * @returns resolves with the result of the evaluation. Note that + * if a callback is supplied, the returned promise will already have + * a '.catch' attached to it in order to pass the error to the callback. + */ + eval(expression: string, context?: object, cb?: EvalCallbackFunction): Promise; + + /** + * Removes a binary or unary operator from the Jexl grammar. + * @param operator The operator string to be removed + */ + removeOp(operator: string): void; +} + +/** + * Jexl is the Javascript Expression Language, capable of parsing and + * evaluating basic to complex expression strings, combined with advanced + * xpath-like drilldown into native Javascript objects. + */ +declare class BuildableJexl extends Jexl { + Jexl: { new(): Jexl }; +} + +declare const exportJexl: BuildableJexl; + +export = exportJexl; diff --git a/types/jexl/jexl-tests.ts b/types/jexl/jexl-tests.ts new file mode 100644 index 0000000000..df55bba69e --- /dev/null +++ b/types/jexl/jexl-tests.ts @@ -0,0 +1,77 @@ +import * as jexl from "jexl"; + +const context = { + name: {first: 'Sterling', last: 'Archer'}, + assoc: [ + {first: 'Lana', last: 'Kane'}, + {first: 'Cyril', last: 'Figgis'}, + {first: 'Pam', last: 'Poovey'} + ], + age: 36 +}; + +// Filter an array +// Output: Kane +// $ExpectType Promise +jexl.eval('assoc[.first == "Lana"].last', context); + +// Do math +// Output: 72 +// $ExpectType Promise +jexl.eval('age * (3 - 1)', context, (err, res) => { +}); + +// Concatenate +// Output: Sterling Archer +// $ExpectType Promise +jexl.eval('name.first + " " + name["la" + "st"]', context); + +// Compound +// Output: true +// $ExpectType Promise +jexl.eval('assoc[.last == "Figgis"].first == "Cyril" && assoc[.last == "Poovey"].first == "Pam"', context); + +// Use array indexes +// Output: Cyril Figgis +// $ExpectType Promise +jexl.eval('assoc[1]', context, (err, res) => { +}); + +// Use conditional logic +// Output: working +// $ExpectType Promise +jexl.eval('age > 62 ? "retired" : "working"', context); + +// Transform +// $ExpectType void +jexl.addTransform('upper', (val) => { + return val.toUpperCase(); +}); +// Output: DUCHESS ARCHER +// $ExpectType Promise +jexl.eval('"duchess"|upper + " " + name.last|upper', context); + +// Transform asynchronously, with arguments +// $ExpectType void +jexl.addTransform('getStat', (val, stat) => { + return Promise.resolve('Test'); // Returns a promise +}); +// Output: 184 +// $ExpectType Promise +jexl.eval('name.last|getStat("weight")', context, (err, res) => { +}); + +// Add your own (a)synchronous operators +// Here's a case-insensitive string equality +// $ExpectType void +jexl.addBinaryOp('_=', 20, (left, right) => { + return left.toLowerCase() === right.toLowerCase(); +}); +// Output: true +// $ExpectType Promise +jexl.eval('"Guest" _= "gUeSt"'); + +const newJexlInstance = new jexl.Jexl(); + +// $ExpectType Promise +newJexlInstance.eval("true == true"); diff --git a/types/jexl/tsconfig.json b/types/jexl/tsconfig.json new file mode 100644 index 0000000000..8db678a16d --- /dev/null +++ b/types/jexl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jexl-tests.ts" + ] +} diff --git a/types/jexl/tslint.json b/types/jexl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jexl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 215cb1970b3c998bac688396c6cd9756b446055b Mon Sep 17 00:00:00 2001 From: Andrew Debens Date: Sun, 15 Jul 2018 20:38:59 +0100 Subject: [PATCH 334/346] [classnames] Supporting ES6 & commonjs module imports (#27127) * Updating classnames types for es6 and node imports * Fixing linting --- types/classnames/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/classnames/index.d.ts b/types/classnames/index.d.ts index 40e3ce835c..0c3502d4dd 100644 --- a/types/classnames/index.d.ts +++ b/types/classnames/index.d.ts @@ -21,7 +21,9 @@ interface ClassArray extends Array { } // tslint:disable-line no-emp type ClassNamesFn = (...classes: ClassValue[]) => string; -declare const classNames: ClassNamesFn; +type ClassNamesExport = ClassNamesFn & { default: ClassNamesFn }; + +declare const classNames: ClassNamesExport; export = classNames; export as namespace classNames; From 606b1af8e1fb34a4a016c030840b3893747a0a32 Mon Sep 17 00:00:00 2001 From: sparklellama Date: Mon, 16 Jul 2018 05:42:15 +1000 Subject: [PATCH 335/346] Add access to numer.js options (#27159) Not possible to set options for numeral.js with current .d.ts. Adding the following seems to get it working on my project so hoping it can be included at the DefinitelyTyped end. --- types/numeral/index.d.ts | 11 ++++++++++- types/numeral/numeral-tests.ts | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/numeral/index.d.ts b/types/numeral/index.d.ts index 3a22584b3c..16d5a68692 100644 --- a/types/numeral/index.d.ts +++ b/types/numeral/index.d.ts @@ -22,6 +22,14 @@ interface NumeralJSLocale { }; } +interface NumeralJSOptions { + currentLocale: string; + zeroFormat: string; + nullFormat: string; + defaultFormat: string; + scalePercentBy100: boolean; +} + type RoundingFunction = (value: number) => number; // http://numeraljs.com/#custom-formats @@ -41,7 +49,8 @@ interface Numeral { (value?: any): Numeral; version: string; isNumeral: boolean; - + options: NumeralJSOptions; + /** * This function sets the current locale. If no arguments are passed in, * it will simply return the current global locale key. diff --git a/types/numeral/numeral-tests.ts b/types/numeral/numeral-tests.ts index b58d6e7411..79f66efed4 100644 --- a/types/numeral/numeral-tests.ts +++ b/types/numeral/numeral-tests.ts @@ -90,3 +90,8 @@ numeral.locale('fr'); // return the current locale numeral.locale(); // 'fr' + +// test changing an option +numeral.options.scalePercentBy100 = false +numeral(50).formatCurrency('0%') +// '50%' \ No newline at end of file From 11bb84af8c205a3242dd8ef70713452d02146784 Mon Sep 17 00:00:00 2001 From: Emilio Martinez Date: Sun, 15 Jul 2018 12:43:04 -0700 Subject: [PATCH 336/346] feat(html-webpack-plugin): add html-webpack-plugin hook definitions (#27135) --- .../html-webpack-plugin-tests.ts | 14 ++++ types/html-webpack-plugin/index.d.ts | 76 ++++++++++++++++++- 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/types/html-webpack-plugin/html-webpack-plugin-tests.ts b/types/html-webpack-plugin/html-webpack-plugin-tests.ts index b80ea9e6b0..60f1faf023 100644 --- a/types/html-webpack-plugin/html-webpack-plugin-tests.ts +++ b/types/html-webpack-plugin/html-webpack-plugin-tests.ts @@ -1,4 +1,5 @@ import HtmlWebpackPlugin = require('html-webpack-plugin'); +import { Compiler, compilation } from 'webpack'; new HtmlWebpackPlugin(); @@ -25,3 +26,16 @@ const optionsArray: HtmlWebpackPlugin.Options[] = [ ]; const plugins: HtmlWebpackPlugin[] = optionsArray.map(options => new HtmlWebpackPlugin(options)); + +// Webpack plugin `apply` function +function apply(compiler: Compiler) { + compiler.hooks.compilation.tap('SomeWebpackPlugin', (compilation: compilation.Compilation) => { + ( compilation.hooks).htmlWebpackPluginAfterHtmlProcessing.tap( + 'MyPlugin', + (data) => { + data.html += 'The Magic Footer'; + return data; + } + ); + }); +} diff --git a/types/html-webpack-plugin/index.d.ts b/types/html-webpack-plugin/index.d.ts index c3db12f4e7..74c7d31073 100644 --- a/types/html-webpack-plugin/index.d.ts +++ b/types/html-webpack-plugin/index.d.ts @@ -6,7 +6,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { Plugin } from 'webpack'; +import { Plugin, compilation } from 'webpack'; +import { AsyncSeriesWaterfallHook } from 'tapable'; import { Options as HtmlMinifierOptions } from 'html-minifier'; export = HtmlWebpackPlugin; @@ -84,8 +85,81 @@ declare namespace HtmlWebpackPlugin { [option: string]: any; } + interface Hooks extends compilation.CompilationHooks { + htmlWebpackPluginBeforeHtmlGeneration: AsyncSeriesWaterfallHook<{ + assets: { + publicPath: string; + js: EntryObject[]; + css: EntryObject[]; + }; + outputName: string; + plugin: HtmlWebpackPlugin; + }>; + htmlWebpackPluginBeforeHtmlProcessing: AsyncSeriesWaterfallHook<{ + html: string; + assets: { + publicPath: string; + js: EntryObject[]; + css: EntryObject[]; + }; + outputName: string; + plugin: HtmlWebpackPlugin; + }>; + htmlWebpackPluginAfterHtmlProcessing: AsyncSeriesWaterfallHook<{ + html: string; + assets: { + publicPath: string; + js: EntryObject[]; + css: EntryObject[]; + }; + outputName: string; + plugin: HtmlWebpackPlugin; + }>; + htmlWebpackPluginAlterAssetTags: AsyncSeriesWaterfallHook<{ + head: HtmlTagObject[]; + body: HtmlTagObject[]; + outputName: string; + plugin: HtmlWebpackPlugin; + }>; + htmlWebpackPluginAfterEmit: AsyncSeriesWaterfallHook<{ + html: string; + outputName: string; + plugin: HtmlWebpackPlugin; + }>; + } + /** @deprecated use MinifyOptions */ type MinifyConfig = MinifyOptions; /** @deprecated use Options */ type Config = Options; } + +interface EntryObject { + /** Webpack entry or chunk name */ + entryName: string; + /** Entry or chunk path */ + path: string; +} + +interface HtmlTagObject { + /** + * Attributes of the html tag + * E.g. `{'disabled': true, 'value': 'demo'}` + */ + attributes: { + [attributeName: string]: string | boolean; + }; + /** + * Wether this html must not contain innerHTML + * @see https://www.w3.org/TR/html5/syntax.html#void-elements + */ + voidTag: boolean; + /** + * The tag name e.g. `'div'` + */ + tagName: string; + /** + * Inner HTML The + */ + innerHTML?: string; +} From 2ace47c40477cda37a8bb2e8d04ecce62d3f1ab3 Mon Sep 17 00:00:00 2001 From: Allison Shaw Date: Sun, 15 Jul 2018 14:43:32 -0500 Subject: [PATCH 337/346] Update index.d.ts (#27158) Expose the public GenericOptions const to users. --- types/canvas-gauges/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/canvas-gauges/index.d.ts b/types/canvas-gauges/index.d.ts index e5b4f69047..3c3a617ed7 100644 --- a/types/canvas-gauges/index.d.ts +++ b/types/canvas-gauges/index.d.ts @@ -118,6 +118,8 @@ declare namespace CanvasGauges { barProgress?: boolean, barShadow?: number } + + export const GenericOptions: GenericOptions; export interface RadialGaugeOptions extends GenericOptions { ticksAngle?: number, From ec15c9c9a30e8249843a37b910940c37ec42fb90 Mon Sep 17 00:00:00 2001 From: Adam Binford Date: Sun, 15 Jul 2018 15:44:07 -0400 Subject: [PATCH 338/346] Expanded allowable redux version (#27156) --- types/react-redux-toastr/index.d.ts | 4 ++-- types/react-redux-toastr/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-redux-toastr/index.d.ts b/types/react-redux-toastr/index.d.ts index 7c9f30b056..8f18abc73b 100644 --- a/types/react-redux-toastr/index.d.ts +++ b/types/react-redux-toastr/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-redux-toastr 7.0.0 +// Type definitions for react-redux-toastr 7.1 // Project: https://github.com/diegoddox/react-redux-toastr // Definitions by: Aleksandar Ivanov // Artyom Stukans @@ -7,7 +7,7 @@ // TypeScript Version: 2.8 import { Component } from 'react'; -import { Action, ActionCreator, Reducer } from 'redux'; +import { Action, Reducer } from 'redux'; export type iconType = 'success' | 'info' | 'warning' | 'error'; export type positionType = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; diff --git a/types/react-redux-toastr/package.json b/types/react-redux-toastr/package.json index 6d68bf2f9b..998f8e9b38 100644 --- a/types/react-redux-toastr/package.json +++ b/types/react-redux-toastr/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^3.6.0 || ^4.0.0" } } From fc1bfd0f9e783ee42c90bc4336d2fe3074110e7c Mon Sep 17 00:00:00 2001 From: Jonathan Skeate Date: Sun, 15 Jul 2018 15:44:37 -0400 Subject: [PATCH 339/346] [material-ui] Add placeholder, title to TextFieldProps (#27082) --- types/material-ui/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 21ee89c329..649a058156 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1908,6 +1908,8 @@ declare namespace __MaterialUI { minlength?: string; step?: number; autoComplete?: string; + placeholder?: string; + title?: string; } export class TextField extends React.Component { blur(): void; From 4ca4cba9ea80496e918443ba2634562494ea190d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 15 Jul 2018 21:45:29 +0200 Subject: [PATCH 340/346] [react-select]: add typings for valueComponent prop (#27145) --- types/react-select/index.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index 377dad4495..fd4d543dd3 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -12,6 +12,7 @@ // Anton Novik // David Schkalee // Arthur Udalov +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -27,6 +28,7 @@ export class Async extends React.Component extends React.Component> { } export type OptionComponentType = React.ComponentType>; +export type ValueComponentType = React.ComponentType>; export type HandlerRendererResult = JSX.Element | null | false; @@ -217,6 +219,17 @@ export interface ArrowRendererProps { isOpen: boolean; } +export interface ValueComponentProps { + disabled: ReactSelectProps['disabled']; + id: string; + instancePrefix: string; + onClick: OnValueClickHandler | null; + onRemove?: SelectValueHandler; + placeholder: ReactSelectProps['placeholder']; + value: Option; + values?: Array>; +} + export interface ReactSelectProps extends React.Props> { /** * text to display when `allowCreate` is true. @@ -552,7 +565,7 @@ export interface ReactSelectProps extends React.Props; + valueComponent?: ValueComponentType; /** * optional style to apply to the component wrapper From d37a85553f2889034e84f328dbf8b333bbe8f212 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Sun, 15 Jul 2018 21:46:24 +0200 Subject: [PATCH 341/346] Add github-url-to-object (#27229) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). - [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. --- .../github-url-to-object-tests.ts | 5 ++++ types/github-url-to-object/index.d.ts | 25 +++++++++++++++++++ types/github-url-to-object/tsconfig.json | 23 +++++++++++++++++ types/github-url-to-object/tslint.json | 1 + 4 files changed, 54 insertions(+) create mode 100644 types/github-url-to-object/github-url-to-object-tests.ts create mode 100644 types/github-url-to-object/index.d.ts create mode 100644 types/github-url-to-object/tsconfig.json create mode 100644 types/github-url-to-object/tslint.json diff --git a/types/github-url-to-object/github-url-to-object-tests.ts b/types/github-url-to-object/github-url-to-object-tests.ts new file mode 100644 index 0000000000..a6de7f1355 --- /dev/null +++ b/types/github-url-to-object/github-url-to-object-tests.ts @@ -0,0 +1,5 @@ +import gh = require('github-url-to-object'); + +gh('github:monkey/business'); // $ExpectType Result | null +gh('https://ghe.example.com:heroku/heroku-flags.git', {enterprise: true}); // $ExpectType Result | null +gh({url: 'git+https://github.com/monkey/business.git'}); // $ExpectType Result | null diff --git a/types/github-url-to-object/index.d.ts b/types/github-url-to-object/index.d.ts new file mode 100644 index 0000000000..a46ca93dd7 --- /dev/null +++ b/types/github-url-to-object/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for github-url-to-object 4.0 +// Project: https://github.com/zeke/github-url-to-object#readme +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace gh { + interface Options { + enterprise?: boolean; + } + interface Result { + user: string; + repo: string; + branch: string; + https_url: string; + tarball_url: string; + clone_url: string; + travis_url: string; + api_url: string; + zip_url: string; + } +} + +declare function gh(url: string | {url: string}, options?: gh.Options): gh.Result | null; + +export = gh; diff --git a/types/github-url-to-object/tsconfig.json b/types/github-url-to-object/tsconfig.json new file mode 100644 index 0000000000..d25b3d0527 --- /dev/null +++ b/types/github-url-to-object/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "github-url-to-object-tests.ts" + ] +} diff --git a/types/github-url-to-object/tslint.json b/types/github-url-to-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/github-url-to-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6c93547985f4df775496ce2aa388e42a40c833e6 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Sun, 15 Jul 2018 21:46:51 +0200 Subject: [PATCH 342/346] add parse-github-url (#27230) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). - [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. --- types/parse-github-url/index.d.ts | 23 +++++++++++++++++++ .../parse-github-url-tests.ts | 3 +++ types/parse-github-url/tsconfig.json | 23 +++++++++++++++++++ types/parse-github-url/tslint.json | 1 + 4 files changed, 50 insertions(+) create mode 100644 types/parse-github-url/index.d.ts create mode 100644 types/parse-github-url/parse-github-url-tests.ts create mode 100644 types/parse-github-url/tsconfig.json create mode 100644 types/parse-github-url/tslint.json diff --git a/types/parse-github-url/index.d.ts b/types/parse-github-url/index.d.ts new file mode 100644 index 0000000000..c5793277e8 --- /dev/null +++ b/types/parse-github-url/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for parse-github-url 1.0 +// Project: https://github.com/jonschlinkert/parse-github-url +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Url } from 'url'; + +declare namespace gh { + interface Result extends Url { + filepath: string | null; + owner: string | null; + name: string | null; + repo: string | null; + repository: string | null; + branch: string; + } +} + +declare function gh(url: string): gh.Result | null; + +export = gh; diff --git a/types/parse-github-url/parse-github-url-tests.ts b/types/parse-github-url/parse-github-url-tests.ts new file mode 100644 index 0000000000..7c5a7c50f7 --- /dev/null +++ b/types/parse-github-url/parse-github-url-tests.ts @@ -0,0 +1,3 @@ +import gh = require('parse-github-url'); + +gh('github:monkey/business'); // $ExpectType Result | null diff --git a/types/parse-github-url/tsconfig.json b/types/parse-github-url/tsconfig.json new file mode 100644 index 0000000000..e5a7fcab63 --- /dev/null +++ b/types/parse-github-url/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "parse-github-url-tests.ts" + ] +} diff --git a/types/parse-github-url/tslint.json b/types/parse-github-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/parse-github-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6e4e25a30e33a2269253b572c26dceffcdbf89c3 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Sun, 15 Jul 2018 21:47:32 +0200 Subject: [PATCH 343/346] add git-url-parse (#27233) --- types/git-url-parse/git-url-parse-tests.ts | 8 ++++ types/git-url-parse/index.d.ts | 48 ++++++++++++++++++++++ types/git-url-parse/tsconfig.json | 23 +++++++++++ types/git-url-parse/tslint.json | 1 + 4 files changed, 80 insertions(+) create mode 100644 types/git-url-parse/git-url-parse-tests.ts create mode 100644 types/git-url-parse/index.d.ts create mode 100644 types/git-url-parse/tsconfig.json create mode 100644 types/git-url-parse/tslint.json diff --git a/types/git-url-parse/git-url-parse-tests.ts b/types/git-url-parse/git-url-parse-tests.ts new file mode 100644 index 0000000000..41fd0bd0f0 --- /dev/null +++ b/types/git-url-parse/git-url-parse-tests.ts @@ -0,0 +1,8 @@ +import gitUrlParse = require('git-url-parse'); + +gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git"); // $ExpectType GitUrl +gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git").toString(); // $ExpectType string +gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git").toString('git+ssh'); // $ExpectType string + +gitUrlParse.stringify(gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git")); // $ExpectType string +gitUrlParse.stringify(gitUrlParse("git@github.com:IonicaBizau/node-git-url-parse.git"), 'https'); // $ExpectType string diff --git a/types/git-url-parse/index.d.ts b/types/git-url-parse/index.d.ts new file mode 100644 index 0000000000..5c1d14ba7a --- /dev/null +++ b/types/git-url-parse/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for git-url-parse 9.0 +// Project: https://github.com/IonicaBizau/git-url-parse +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace gitUrlParse { + interface GitUrl { + /** An array with the url protocols (usually it has one element). */ + protocols: string[]; + port: number | null; + /** The url domain (including subdomains). */ + resource: string; + /** The authentication user (usually for ssh urls). */ + user: string; + pathname: string; + hash: string; + search: string; + href: string; + protocol: string; + /** The oauth token (could appear in the https urls). */ + token: string; + /** The Git provider (e.g. `"github.com"`). */ + source: string; + /** The repository owner. */ + owner: string; + /** The repository name. */ + name: string; + /** The repository ref (e.g., "master" or "dev"). */ + ref: string; + /** A filepath relative to the repository root. */ + filepath: string; + /** The type of filepath in the url ("blob" or "tree"). */ + filepathtype: string; + /** The owner and name values in the `owner/name` format. */ + full_name: string; + /** The organization the owner belongs to. This is CloudForge specific. */ + organization: string; + /** Whether to add the `.git` suffix or not. */ + git_suffix?: boolean; + toString(type?: string): string; + } + + function stringify(url: GitUrl, type?: string): string; +} + +declare function gitUrlParse(url: string): gitUrlParse.GitUrl; + +export = gitUrlParse; diff --git a/types/git-url-parse/tsconfig.json b/types/git-url-parse/tsconfig.json new file mode 100644 index 0000000000..0261055b6f --- /dev/null +++ b/types/git-url-parse/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "git-url-parse-tests.ts" + ] +} diff --git a/types/git-url-parse/tslint.json b/types/git-url-parse/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-url-parse/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b56eb29ea66f803f5c5ae8099f5de354a03968fe Mon Sep 17 00:00:00 2001 From: Ben Grynhaus Date: Sun, 15 Jul 2018 22:47:55 +0300 Subject: [PATCH 344/346] Added types for 'css-to-style' (#27253) --- types/css-to-style/css-to-style-tests.ts | 9 +++++++++ types/css-to-style/index.d.ts | 9 +++++++++ types/css-to-style/tsconfig.json | 16 ++++++++++++++++ types/css-to-style/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/css-to-style/css-to-style-tests.ts create mode 100644 types/css-to-style/index.d.ts create mode 100644 types/css-to-style/tsconfig.json create mode 100644 types/css-to-style/tslint.json diff --git a/types/css-to-style/css-to-style-tests.ts b/types/css-to-style/css-to-style-tests.ts new file mode 100644 index 0000000000..ede5ae8f06 --- /dev/null +++ b/types/css-to-style/css-to-style-tests.ts @@ -0,0 +1,9 @@ +import toStyle from "css-to-style"; + +toStyle(); // $ExpectError + +toStyle({}); // $ExpectError + +toStyle(1); // $ExpectError + +toStyle(''); // $ExpectType CSSStyleDeclaration diff --git a/types/css-to-style/index.d.ts b/types/css-to-style/index.d.ts new file mode 100644 index 0000000000..eb450341f9 --- /dev/null +++ b/types/css-to-style/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for css-to-style 1.2 +// Project: https://github.com/jacobbuck/css-to-style +// Definitions by: Ben Grynhaus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare function toStyle(cssText: string): CSSStyleDeclaration; + +export default toStyle; diff --git a/types/css-to-style/tsconfig.json b/types/css-to-style/tsconfig.json new file mode 100644 index 0000000000..8b3a9292b3 --- /dev/null +++ b/types/css-to-style/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "css-to-style-tests.ts"] +} diff --git a/types/css-to-style/tslint.json b/types/css-to-style/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/css-to-style/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 504902e9747994992b7fe7f2bdbd8f3cf3681229 Mon Sep 17 00:00:00 2001 From: Sebastian Lenz Date: Mon, 16 Jul 2018 18:51:24 +0200 Subject: [PATCH 345/346] Add third parameter `parent` to matchPath, add prop `sensitive` to Route (#27336) * Add third parameter `parent` to matchPath MathPath takes a third parameter, see https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/matchPath.js#L28 * Add prop `sensitive` to Route Routes accept the prop `sensitive`, see https://reacttraining.com/react-router/web/api/Route/sensitive-bool --- types/react-router/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index 4b0f45853f..05d5fe30bb 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -78,6 +78,7 @@ export interface RouteProps { children?: ((props: RouteComponentProps) => React.ReactNode) | React.ReactNode; path?: string; exact?: boolean; + sensitive?: boolean; strict?: boolean; } export class Route extends React.Component { } @@ -115,7 +116,7 @@ export interface match

{ // Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html export type Omit = Pick>; -export function matchPath

(pathname: string, props: RouteProps): match

| null; +export function matchPath

(pathname: string, props: RouteProps, parent?: match

| null): match

| null; export function generatePath(pattern: string, params?: { [paramName: string]: string | number | boolean }): string; From 91f8a6b7d1ef61cc543d0901dcc004b846283345 Mon Sep 17 00:00:00 2001 From: Sindre Date: Mon, 16 Jul 2018 20:09:10 +0200 Subject: [PATCH 346/346] auto-bind definitions (#27299) * auto-bind definitions * auto-bind: fix lint errors * auto-bind: PR feedback, fix import syntax in tests --- types/auto-bind/auto-bind-tests.ts | 65 ++++++++++++++++++++++++++++++ types/auto-bind/index.d.ts | 25 ++++++++++++ types/auto-bind/tsconfig.json | 23 +++++++++++ types/auto-bind/tslint.json | 1 + 4 files changed, 114 insertions(+) create mode 100644 types/auto-bind/auto-bind-tests.ts create mode 100644 types/auto-bind/index.d.ts create mode 100644 types/auto-bind/tsconfig.json create mode 100644 types/auto-bind/tslint.json diff --git a/types/auto-bind/auto-bind-tests.ts b/types/auto-bind/auto-bind-tests.ts new file mode 100644 index 0000000000..2c3754e09d --- /dev/null +++ b/types/auto-bind/auto-bind-tests.ts @@ -0,0 +1,65 @@ +import autoBind = require("auto-bind"); + +const emptyConfig: autoBind.AutoBindOptions = {}; +const onlyIncludeInConfig: autoBind.AutoBindOptions = { + include: [] +}; +const onlyExcludeInConfig: autoBind.AutoBindOptions = { + exclude: [] +}; +const emptyArraysInConfig: autoBind.AutoBindOptions = { + include: [], + exclude: [] +}; +const regexConfig: autoBind.AutoBindOptions = { + include: [/test[123]/], + exclude: [/test[123]/, /^regex[123]$/] +}; +const stringConfig: autoBind.AutoBindOptions = { + include: ["test"], + exclude: ["123", "abc"] +}; +const mixConfig: autoBind.AutoBindOptions = { + include: ["test", /test[123]/], + exclude: ["123", /test[123]/] +}; + +class TestConfigs { + constructor() { + // no config + autoBind(this); + autoBind.react(this); + + // empty configs + autoBind(this, emptyConfig); + autoBind.react(this, emptyConfig); + + // include only configs + autoBind(this, onlyIncludeInConfig); + autoBind.react(this, onlyIncludeInConfig); + + // exclude only configs + autoBind(this, onlyExcludeInConfig); + autoBind.react(this, onlyExcludeInConfig); + + // empty array configs + autoBind(this, emptyArraysInConfig); + autoBind.react(this, emptyArraysInConfig); + + // regex configs + autoBind(this, regexConfig); + autoBind.react(this, regexConfig); + + // string configs + autoBind(this, stringConfig); + autoBind.react(this, stringConfig); + + // mix configs + autoBind(this, mixConfig); + autoBind.react(this, mixConfig); + } + + shutUpNoUnnecessaryClass() { + // noop + } +} diff --git a/types/auto-bind/index.d.ts b/types/auto-bind/index.d.ts new file mode 100644 index 0000000000..9b91fb3da6 --- /dev/null +++ b/types/auto-bind/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for auto-bind 1.2 +// Project: https://github.com/sindresorhus/auto-bind#readme +// Definitions by: Sindre Seppola +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace autoBind { + interface AutoBindOptions { + include?: Array; + exclude?: Array; + } + + type AutoBindFunction = ( + self: selfT, + options?: AutoBindOptions + ) => selfT; +} + +interface AutoBindModule + extends autoBind.AutoBindFunction { + react: autoBind.AutoBindFunction; +} + +declare const autoBind: AutoBindModule; +export = autoBind; diff --git a/types/auto-bind/tsconfig.json b/types/auto-bind/tsconfig.json new file mode 100644 index 0000000000..d9589cadad --- /dev/null +++ b/types/auto-bind/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auto-bind-tests.ts" + ] +} diff --git a/types/auto-bind/tslint.json b/types/auto-bind/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/auto-bind/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }