diff --git a/notNeededPackages.json b/notNeededPackages.json index 7efe76e0d7..cf61daf58d 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2010,6 +2010,12 @@ "sourceRepoURL": "https://github.com/Lellansin/node-scanf", "asOfVersion": "0.7.3" }, + { + "libraryName": "screenfull", + "typingsPackageName": "screenfull", + "sourceRepoURL": "https://github.com/sindresorhus/screenfull.js", + "asOfVersion": "4.1.0" + }, { "libraryName": "sendgrid", "typingsPackageName": "sendgrid", diff --git a/types/absolute/tslint.json b/types/absolute/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/absolute/tslint.json +++ b/types/absolute/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/acc-wizard/tslint.json b/types/acc-wizard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/acc-wizard/tslint.json +++ b/types/acc-wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ace/tslint.json b/types/ace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ace/tslint.json +++ b/types/ace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/actioncable/tslint.json b/types/actioncable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/actioncable/tslint.json +++ b/types/actioncable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/add2home/tslint.json b/types/add2home/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/add2home/tslint.json +++ b/types/add2home/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/agenda/tslint.json b/types/agenda/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/agenda/tslint.json +++ b/types/agenda/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/alertify/tslint.json b/types/alertify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/alertify/tslint.json +++ b/types/alertify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/algoliasearch/tslint.json b/types/algoliasearch/tslint.json index 886f1a8b6c..4ef1833aa4 100644 --- a/types/algoliasearch/tslint.json +++ b/types/algoliasearch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/alt/tslint.json b/types/alt/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/alt/tslint.json +++ b/types/alt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts new file mode 100644 index 0000000000..f6efc2dc54 --- /dev/null +++ b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts @@ -0,0 +1,114 @@ +// $ExpectType IndoorMap +new AMap.IndoorMap(); +// $ExpectType IndoorMap +new AMap.IndoorMap({}); +// $ExpectType IndoorMap +const indoorMap = new AMap.IndoorMap({ + zIndex: 1, + opacity: 0.5, + cursor: 'cursor', + hideFloorBar: false, + alaysShow: true +}); + +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId'); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', (error, result) => { + // $ExpectType Error | null + error; + // $ExpectType SearchResult + result; + // $ExpectType string + result.id; + // $ExpectType 0 | 1 + result.status; + if (result.status === 0) { + // $ExpectType Building + const building = result.building; + { + // $ExpectType number + building.floor; + // $ExpectType FloorDetails + const floorDetails = building.floor_details; + { + // $ExpectType number[] + floorDetails.floor_indexs; + // $ExpectType string[] + floorDetails.floor_names; + // $ExpectType string[] + floorDetails.floor_nonas; + } + // $ExpectType string + building.id; + // $ExpectType LngLat + building.lnglat; + // $ExpectType string + building.name; + } + } else { + // $ExpectType Error + result.error; + } +}); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, () => { }); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId'); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', () => { }); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true, () => { }); + +let floor: undefined | false; +floor = indoorMap.showFloor(1); +floor = indoorMap.showFloor(1, true); + +// $ExpectType void +indoorMap.showFloorBar(); + +// $ExpectType void +indoorMap.hideFloorBar(); + +// $ExpectType void +indoorMap.hideLabels(); + +// $ExpectType string | null +indoorMap.getSelectedBuildingId(); + +// $ExpectType Building | null +const building = indoorMap.getSelectedBuilding(); +if (building) { + // $ExpectType number + building.floor; + // $ExpectType FloorDetails + building.floor_details; + // $ExpectType string + building.id; + // $ExpectType LngLat + building.lnglat; + // $ExpectType string + building.name; +} + +indoorMap.on('complete', (event: AMap.IndoorMap.EventMap['complete']) => { + // $ExpectType "complete" + event.type; +}); + +indoorMap.on('click', (event: AMap.IndoorMap.EventMap['click']) => { + // $ExpectType string + event.building_id; + // $ExpectType number + event.floor; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Shop + event.shop; + // $ExpectType "click" + event.type; +}); diff --git a/types/amap-js-api-indoor-map/index.d.ts b/types/amap-js-api-indoor-map/index.d.ts new file mode 100644 index 0000000000..9b30ea1722 --- /dev/null +++ b/types/amap-js-api-indoor-map/index.d.ts @@ -0,0 +1,239 @@ +// Type definitions for non-npm package amap-js-api-indoor-map 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/indoormap +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace IndoorMap { + interface EventMap { + complete: Event<'complete'>; + click: MouseEvent<'click'>; + + floor_complete: Event<'floor_complete', SearchResult>; + mouseover: MouseEvent<'mouseover'>; + mouseout: MouseEvent<'mouseout'>; + } + type MouseEvent = Event; + interface Options extends Layer.Options { + /** + * 图层叠加的顺序值 + */ + zIndex?: number; + /** + * 图层的透明度 + */ + opacity?: number; + /** + * 鼠标悬停到店铺面时的鼠标样式 + */ + cursor?: string; + /** + * 是否隐藏楼层切换控件 + */ + hideFloorBar?: boolean; + /** + * 是否持续显示 + */ + alaysShow?: boolean; + + // internal + visible?: boolean; + featurezIndex?: number; + zooms?: [number, number]; + disableIconRender?: boolean; + disableLabelRender?: boolean; + disableHoverMarker?: boolean; + autoLoadBuildingsInTile?: boolean; + } + interface FloorDetails { + /** + * 各楼层索引 + */ + floor_indexs: number[]; + /** + * 各楼层英文 + */ + floor_nonas: string[]; + /** + * 各楼层名字 + */ + floor_names: string[]; + } + type ShopCategory = 'public' | 'connection' | 'shop'; + interface Shop { + /** + * 店铺的id + */ + id: string; + /** + * 兴趣点ID + */ + poiId: string; + /** + * 店铺所属楼宇ID + */ + building_id: string; + /** + * 店铺名称 + */ + name: string; + /** + * 店铺的经纬度 + */ + lnglat: LngLat; + /** + * 分类 + */ + category: ShopCategory; + } + interface Building { + /** + * 所属楼宇ID + */ + id: string; + /** + * 楼层名称 + */ + name: string; + /** + * 楼层的经纬度 + */ + lnglat: LngLat; + /** + * 所在楼层 + */ + floor: number; + floor_details: FloorDetails; + } + interface SearchSuccessResult { + /** + * 楼层的id + */ + id: string; + status: 0; + /** + * 建筑信息 + */ + building: Building; + } + interface SearchErrorResult { + /** + * 楼宇id + */ + id: string; + status: 1; + error: Error; + } + type SearchResult = SearchSuccessResult | SearchErrorResult; + } + + class IndoorMap extends Layer { + /** + * 室内地图 + * @param options 选项 + */ + constructor(options?: IndoorMap.Options); + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param shopId 商铺ID + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + shopId?: string, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param shopId 商铺ID + * @param noMove 阻止移动 + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + shopId?: string, + noMove?: boolean, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定的楼层 + * @param floor 楼层 + * @param noMove 禁止移动 + */ + showFloor(floor: number, noMove?: boolean): false | undefined; + /** + * 显示楼层切换控件 + */ + showFloorBar(): void; + /** + * 隐藏楼层切换控件 + */ + hideFloorBar(): void; + /** + * 显示室内地图标注 + */ + showLabels(): void; + /** + * 隐藏室内地图标注 + */ + hideLabels(): void; + /** + * 获取处于被选中状态的室内地图的ID + */ + getSelectedBuildingId(): string | null; + /** + * 获取处于被选中状态的室内地图的一些基本信息 + */ + getSelectedBuilding(): IndoorMap.Building | null; + + // internal + getFloorBar(): void; + setSelectedBuildingId(id: string): void; + } +} diff --git a/types/screenfull/tsconfig.json b/types/amap-js-api-indoor-map/tsconfig.json similarity index 91% rename from types/screenfull/tsconfig.json rename to types/amap-js-api-indoor-map/tsconfig.json index e3073a5338..da736c3c7b 100644 --- a/types/screenfull/tsconfig.json +++ b/types/amap-js-api-indoor-map/tsconfig.json @@ -5,6 +5,7 @@ "es6", "dom" ], + "noEmit": true, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -14,11 +15,10 @@ "../" ], "types": [], - "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "screenfull-tests.ts" + "amap-js-api-indoor-map-tests.ts" ] } diff --git a/types/screenfull/tslint.json b/types/amap-js-api-indoor-map/tslint.json similarity index 100% rename from types/screenfull/tslint.json rename to types/amap-js-api-indoor-map/tslint.json diff --git a/types/amap-js-api/array-bounds.d.ts b/types/amap-js-api/array-bounds.d.ts index 419d8e4b1d..3e0145e049 100644 --- a/types/amap-js-api/array-bounds.d.ts +++ b/types/amap-js-api/array-bounds.d.ts @@ -2,7 +2,12 @@ declare namespace AMap { class ArrayBounds { constructor(bounds: LocationValue[]); bounds: LngLat[]; + /** + * 判断传入的点是否在ArrayBounds内 + * @param point 目标点 + */ contains(point: LocationValue): boolean; + // internal toBounds(): Bounds; getCenter(): LngLat; diff --git a/types/amap-js-api/bounds.d.ts b/types/amap-js-api/bounds.d.ts index 63e880fe65..f594969292 100644 --- a/types/amap-js-api/bounds.d.ts +++ b/types/amap-js-api/bounds.d.ts @@ -1,12 +1,39 @@ declare namespace AMap { class Bounds { + /** + * 地物对象的经纬度矩形范围。 + * @param southWest 西南角经纬度 + * @param northEast 东北角经纬度 + */ constructor(southWest: LngLat, northEast: LngLat); + /** + * 指定点坐标是否在矩形范围内 + * @param point 制定坐标 + */ contains(point: LocationValue): boolean; + /** + * 获取当前Bounds的中心点经纬度坐标 + */ getCenter(): LngLat; + /** + * 获取西南角坐标 + */ getSouthWest(): LngLat; + /** + * 获取东南角坐标 + */ getSouthEast(): LngLat; + /** + * 获取东北角坐标 + */ getNorthEast(): LngLat; + /** + * 获取西北角坐标 + */ getNorthWest(): LngLat; + /** + * 以字符串形式返回地物对象的矩形范围 + */ toString(): string; } } diff --git a/types/amap-js-api/browser.d.ts b/types/amap-js-api/browser.d.ts index 71bfaa8fea..26b3956aa1 100644 --- a/types/amap-js-api/browser.d.ts +++ b/types/amap-js-api/browser.d.ts @@ -1,51 +1,192 @@ declare namespace AMap { namespace Browser { + /** + * 当前浏览器userAgent + */ const ua: string; + /** + * 是否移动设备 + */ const mobile: boolean; + /** + * 平台类型,如:'windows'、'mac'、'ios'、'android'、'other' + */ const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other'; + /** + * 是否mac设备 + */ const mac: boolean; + /** + * 是否windows设备 + */ const windows: boolean; + /** + * 是否iOS设备 + */ const ios: boolean; + /** + * 是否iPad + */ const iPad: boolean; + /** + * 是否iPhone + */ const iPhone: boolean; + /** + * 是否安卓设备 + */ const android: boolean; + /** + * 是否安卓4以下系统 + */ const android23: boolean; + /** + * 是否Chrome浏览器 + */ const chrome: boolean; + /** + * 是否火狐浏览器 + */ const firefox: boolean; + /** + * 是否Safari浏览器 + */ const safari: boolean; + /** + * 是否微信 + */ const wechat: boolean; + /** + * 是否UC浏览器 + */ const uc: boolean; + /** + * 是否QQ或者QQ浏览器 + */ const qq: boolean; + /** + * 是否IE + */ const ie: boolean; + /** + * 是否IE6 + */ const ie6: boolean; + /** + * 是否IE7 + */ const ie7: boolean; + /** + * 是否IE8 + */ const ie8: boolean; + /** + * 是否IE9 + */ const ie9: boolean; + /** + * 是否IE10 + */ const ie10: boolean; + /** + * 是否IE11 + */ const ie11: boolean; + /** + * 是否Edge浏览器 + */ const edge: boolean; + /** + * 是否IE9以下 + */ const ielt9: boolean; + /** + * 是否百度浏览器 + */ const baidu: boolean; + /** + * 是否支持LocaStorage + */ const isLocalStorage: boolean; + /** + * 是否支持Geolocation + */ const isGeolocation: boolean; + /** + * 是否Webkit移动浏览器 + */ const mobileWebkit: boolean; + /** + * 是否支持Css3D的Webkit移动端浏览器 + */ const mobileWebkit3d: boolean; + /** + * 是否Opera移动浏览器 + */ const mobileOpera: boolean; + /** + * 是否高清屏幕,devicePixelRatio>1 + */ const retina: boolean; + /** + * 是否触屏 + */ const touch: boolean; + /** + * 是否msPointer设备 + */ const msPointer: boolean; + /** + * 是否pointer设备 + */ const pointer: boolean; + /** + * 是否webkit浏览器 + */ const webkit: boolean; + /** + * 是否支持Css3D的ie浏览器 + */ const ie3d: boolean; + /** + * 是否支持Css3D的Webkit浏览器 + */ const webkit3d: boolean; + /** + * 是否支持Css3D的gecko浏览器 + */ const gecko3d: boolean; + /** + * 是否支持Css3D的opera浏览器 + */ const opera3d: boolean; + /** + * 是否支持Css3D的浏览器 + */ const any3d: boolean; + /** + * 是否支持canvas + */ const isCanvas: boolean; + /** + * 是否支持svg + */ const isSvg: boolean; + /** + * 是否支持vml + */ const isVML: boolean; + /** + * 是否支持WebWorker + */ const isWorker: boolean; + /** + * 是否支持WebSocket + */ const isWebsocket: boolean; + /** + * 判断是否支持webgl + */ function isWebGL(): boolean; } } diff --git a/types/amap-js-api/common.d.ts b/types/amap-js-api/common.d.ts index 3d51dc719e..8b442ad0a3 100644 --- a/types/amap-js-api/common.d.ts +++ b/types/amap-js-api/common.d.ts @@ -9,8 +9,17 @@ declare namespace AMap { : V extends undefined ? {} : { value: V }); type MapsEvent = Event; diff --git a/types/amap-js-api/convert-from.d.ts b/types/amap-js-api/convert-from.d.ts index 9fe1f1e76d..61f83f9b94 100644 --- a/types/amap-js-api/convert-from.d.ts +++ b/types/amap-js-api/convert-from.d.ts @@ -1,12 +1,24 @@ declare namespace AMap { namespace convertFrom { interface Result { + /** + * 成功状态文字描述 + */ info: string; // 'ok' + /** + * 高德坐标集合 + */ locations: LngLat[]; } type Type = 'gps' | 'baidu' | 'mapbar'; type SearchStatus = 'complete' | 'error'; } + /** + * 为坐标转换类,支持将其他坐标系的坐标点转换为高德坐标系。 + * @param lnglat 待转换坐标 + * @param type 用于说明是哪个服务商的坐标 + * @param callback 转换完成后的回调函数 + */ function convertFrom( lnglat: LocationValue | LocationValue[], type: convertFrom.Type | null, diff --git a/types/amap-js-api/dom-util.d.ts b/types/amap-js-api/dom-util.d.ts index d83a2ca69a..e39793f006 100644 --- a/types/amap-js-api/dom-util.d.ts +++ b/types/amap-js-api/dom-util.d.ts @@ -1,31 +1,78 @@ declare namespace AMap { namespace DomUtil { + /** + * 获取DOM元素的大小 + * @param dom DOM元素 + */ function getViewport(dom: HTMLElement): Size; - + /** + * 获取DOM元素距离窗口左上角的距离 + * @param dom DOM元素 + */ function getViewportOffset(dom: HTMLElement): Pixel; - + /** + * 在parentNode内部创建一个className类名的tagName元素 + * @param tagName 标签名称 + * @param parent 父节点 + * @param className 类名 + */ function create( tagName: K, parent?: HTMLElement, className?: string ): HTMLElementTagNameMap[K]; - + /** + * 给DOM元素设置为className样式 + * @param dom DOM元素 + * @param className 类名 + */ function setClass(dom: HTMLElement, className?: string): void; - + /** + * DOM元素是否包含className + * @param dom DOM元素 + * @param className 类名 + */ function hasClass(dom: HTMLElement, className: string): boolean; - + /** + * 给DOM元素添加一个className + * @param dom DOM元素 + * @param className 类名 + */ function addClass(dom: HTMLElement, className: string): void; - + /** + * 给DOM元素删除一个className + * @param dom DOM元素 + * @param className 类名 + */ function removeClass(dom: HTMLElement, className: string): void; - + /** + * 给DOM元素设定一个透明度 + * @param dom DOM元素 + * @param opacity 透明度(0-1) + */ function setOpacity(dom: HTMLElement, opacity: number): void; - + /** + * 给DOM元素旋转一个角度,以center为中心,center以元素左上角为坐标原点 + * @param dom DOM元素 + * @param deg 旋转角度 + * @param origin 旋转中心 + */ function rotate(dom: HTMLElement, deg: number, origin?: { x: number, y: number }): void; - + /** + * 给DOM元素删除一组样式,Object同样式表 + * @param dom DOM元素 + * @param style 样式 + */ function setCss(dom: HTMLElement | HTMLElement[], style: Partial): typeof DomUtil; // this - + /** + * 清空DOM元素 + * @param dom DOM元素 + */ function empty(dom: HTMLElement): void; - + /** + * 将DOM元素从父节点删除 + * @param dom DOM元素 + */ function remove(dom: HTMLElement): void; } } diff --git a/types/amap-js-api/event.d.ts b/types/amap-js-api/event.d.ts index d8ff5753c9..d90ee4c720 100644 --- a/types/amap-js-api/event.d.ts +++ b/types/amap-js-api/event.d.ts @@ -1,5 +1,13 @@ declare namespace AMap { abstract class EventEmitter { + /** + * 注册事件 + * @param eventName 事件名称 + * @param handler 事件回调函数 + * @param context 事件回调中的上下文 + * @param once 触发一次 + * @param unshift 更改事件顺序 + */ on( eventName: string, // tslint:disable-next-line:no-unnecessary-generics @@ -8,14 +16,23 @@ declare namespace AMap { once?: boolean, unshift?: boolean ): this; - + /** + * 移除事件绑定 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ off( eventName: string, // tslint:disable-next-line handler: ((this: C, event: E) => void) | 'mv', context?: C ): this; - + /** + * 触发事件 + * @param eventName 事件名称 + * @param data 事件数据 + */ emit(eventName: string, data?: any): this; } @@ -23,7 +40,13 @@ declare namespace AMap { interface EventListener { type: T; } - + /** + * 注册DOM对象事件 + * @param instance 需注册事件的DOM对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ function addDomListener( // tslint:disable-next-line: no-unnecessary-generics instance: HTMLElementTagNameMap[N], @@ -31,7 +54,13 @@ declare namespace AMap { handler: (this: C, event: HTMLElementEventMap[E]) => void, context?: C ): EventListener<0>; - + /** + * 给对象注册事件 + * @param instance 需注册事件的对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ function addListener( // tslint:disable-next-line: no-unnecessary-generics instance: I, @@ -41,7 +70,13 @@ declare namespace AMap { // tslint:disable-next-line: no-unnecessary-generics context?: C ): EventListener<1>; - + /** + * 给对象注册一次性事件 + * @param instance 需注册事件的对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ function addListenerOnce( // tslint:disable-next-line: no-unnecessary-generics instance: I, @@ -51,9 +86,17 @@ declare namespace AMap { // tslint:disable-next-line: no-unnecessary-generics context?: C ): EventListener<1>; - + /** + * 删除事件 + * @param listener 侦听器 + */ function removeListener(listener: EventListener<0 | 1>): void; - + /** + * 触发非DOM事件 + * @param instance 触发对象 + * @param eventName 事件名称 + * @param data 事件数据 + */ function trigger(instance: EventEmitter, eventName: string, data?: any): void; } } diff --git a/types/amap-js-api/geometry-util.d.ts b/types/amap-js-api/geometry-util.d.ts index 03f6800088..c8a5eae2e9 100644 --- a/types/amap-js-api/geometry-util.d.ts +++ b/types/amap-js-api/geometry-util.d.ts @@ -1,106 +1,176 @@ declare namespace AMap { namespace GeometryUtil { + /** + * 计算两个经纬度点之间的实际距离 + */ function distance( point1: LocationValue, point2: LocationValue | LocationValue[] ): number; - + /** + * 计算一个经纬度路径围成区域的实际面积 + */ function ringArea(ring: LocationValue[]): number; - + /** + * 判断一个经纬度路径是否为顺时针 + */ function isClockwise(path: LocationValue[]): boolean; - + /** + * 计算一个经纬度路径的实际长度 + */ function distanceOfLine(line: LocationValue[]): number; - + /** + * 计算两个经纬度面的交叉区域 + */ function ringRingClip( ring1: LocationValue[], ring2: LocationValue[] ): Array<[number, number]>; - + /** + * 判断两个经纬度面是否交叉 + */ function doesRingRingIntersect( ring1: LocationValue[], ring2: LocationValue[] ): boolean; - + /** + * 判断经纬度路径和经纬度面是否交叉 + */ function doesLineRingIntersect( line: LocationValue[], ring: LocationValue[] ): boolean; - + /** + * 判断两个经纬度路径是否相交 + */ function doesLineLineIntersect( line1: LocationValue[], line2: LocationValue[] ): boolean; - + /** + * 判断线段和多个环是否相交 + */ function doesSegmentPolygonIntersect( point1: LocationValue, point2: LocationValue, polygon: LocationValue[][] ): boolean; - + /** + * 判断线段和一个环是否相交 + */ function doesSegmentRingIntersect( point1: LocationValue, point2: LocationValue, ring: LocationValue[] ): boolean; - + /** + * 判断线段和一个路径是否相交 + */ function doesSegmentLineIntersect( point1: LocationValue, point2: LocationValue, line: LocationValue[] ): boolean; - + /** + * 判断两个线段是否相交 + */ function doesSegmentsIntersect( point1: LocationValue, point2: LocationValue, point3: LocationValue, point4: LocationValue ): boolean; - + /** + * 判断点是否在环内 + */ function isPointInRing(point: LocationValue, ring: LocationValue[]): boolean; - + /** + * 判断环是否在另一个环内 + */ function isRingInRing(ring1: LocationValue[], ring2: LocationValue[]): boolean; - + /** + * 判断点是否在多个环组成区域内 + */ function isPointInPolygon(point: LocationValue, polygon: LocationValue[][]): boolean; - + /** + * 判断点是否在多个环组成区域内 + */ function makesureClockwise(path: Array<[number, number]>): Array<[number, number]>; - + /** + * 将一个路径变为逆时针 + */ function makesureAntiClockwise(path: Array<[number, number]>): Array<[number, number]>; - + /** + * 计算P2P3上距离P1最近的点 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + */ function closestOnSegment( point1: LocationValue, point2: LocationValue, point3: LocationValue ): [number, number]; - + /** + * 计算line上距离P最近的点 + */ function closestOnLine(point: LocationValue, line: LocationValue[]): [number, number]; - + /** + * 计算P2P3到P1的距离 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + */ function distanceToSegment( point1: LocationValue, point2: LocationValue, point3: LocationValue ): number; - + /** + * 计算P到line的距离 + */ function distanceToLine(point: LocationValue, line: LocationValue[]): number; - + /** + * 判断P1是否在P2P3上 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + * @param tolerance 误差范围 + */ function isPointOnSegment( point1: LocationValue, point2: LocationValue, point3: LocationValue, tolerance?: number ): boolean; - + /** + * 判断P是否在line上 + * @param point 点P + * @param line 线 + * @param tolerance 误差范围 + */ function isPointOnLine( point: LocationValue, line: LocationValue[], tolerance?: number ): boolean; - + /** + * 判断P是否在ring的边上 + * @param point 点P + * @param ring 环 + * @param tolerance 误差范围 + */ function isPointOnRing( point: LocationValue, ring: LocationValue[], tolerance?: number ): boolean; - + /** + * 判断P是否在多个ring的边上 + * @param point 点P + * @param polygon 多边形 + * @param tolerance 误差范围 + */ function isPointOnPolygon( point: LocationValue, polygon: LocationValue[][], diff --git a/types/amap-js-api/layer/building.d.ts b/types/amap-js-api/layer/building.d.ts index 30dd7c4092..1b7426e28d 100644 --- a/types/amap-js-api/layer/building.d.ts +++ b/types/amap-js-api/layer/building.d.ts @@ -1,11 +1,27 @@ declare namespace AMap { namespace Buildings { interface Options extends Layer.Options { + /** + * 可见级别范围 + */ zooms?: [number, number]; + /** + * 不透明度 + */ opacity?: number; + /** + * 高度比例系数,可控制3D视图下的楼块高度 + */ heightFactor?: number; + /** + * 是否可见 + */ visible?: boolean; + /** + * 层级 + */ zIndex?: number; + // inner merge?: boolean; sort?: boolean; @@ -24,7 +40,15 @@ declare namespace AMap { } class Buildings extends Layer { + /** + * 楼块图层,单独展示矢量化的楼块图层 + * @param opts 图层选项 + */ constructor(opts?: Buildings.Options); + /** + * 按区域设置楼块的颜色 + * @param style 颜色设置 + */ setStyle(style: Buildings.Style): void; } } diff --git a/types/amap-js-api/layer/flexible.d.ts b/types/amap-js-api/layer/flexible.d.ts index bdb4001a7c..d91970dc31 100644 --- a/types/amap-js-api/layer/flexible.d.ts +++ b/types/amap-js-api/layer/flexible.d.ts @@ -2,6 +2,14 @@ declare namespace AMap { namespace TileLayer { namespace Flexible { interface Options extends TileLayer.Options { + /** + * 创建切片回调 + * @param x 横坐标 + * @param y 纵坐标 + * @param z 层级 + * @param success 成功回调 + * @param fail 失败回调 + */ createTile?( x: number, y: number, @@ -9,11 +17,21 @@ declare namespace AMap { success: (tile: HTMLImageElement | HTMLCanvasElement) => void, fail: () => void ): void; + /** + * 内存中缓存的切片的数量上限 + */ cacheSize?: number; + /** + * 是否显示 + */ visible?: boolean; } } class Flexible extends TileLayer { + /** + * 灵活切片图层 + * @param options 图层选项 + */ constructor(options?: Flexible.Options); } } diff --git a/types/amap-js-api/layer/layer.d.ts b/types/amap-js-api/layer/layer.d.ts index 8f35d949fd..64714bc68f 100644 --- a/types/amap-js-api/layer/layer.d.ts +++ b/types/amap-js-api/layer/layer.d.ts @@ -1,20 +1,56 @@ declare namespace AMap { namespace Layer { interface Options { + /** + * 所属的地图对象 + */ map?: Map; } } abstract class Layer extends EventEmitter { + /** + * 图层获取DOM节点 + */ getContainer(): HTMLDivElement | undefined; + /** + * 获取图层缩放范围 + */ getZooms(): [number, number]; + /** + * 设置透明度 + * @param alpha 透明度 + */ setOpacity(alpha: number): void; + /** + * 设置透明度 + */ getOpacity(): number; + /** + * 显示图层 + */ show(): void; + /** + * 隐藏图层 + */ hide(): void; + /** + * 设置图层所属地图 + * @param map map对象 + */ setMap(map?: Map | null): void; + /** + * 获取图层所属地图 + */ getMap(): Map | null | undefined; + /** + * 设置图层的层级 + * @param index 层级 + */ setzIndex(index: number): void; + /** + * 获取图层的层级 + */ getzIndex(): number; } } diff --git a/types/amap-js-api/layer/layerGroup.d.ts b/types/amap-js-api/layer/layerGroup.d.ts index 4cc463eef7..6a07c8fc72 100644 --- a/types/amap-js-api/layer/layerGroup.d.ts +++ b/types/amap-js-api/layer/layerGroup.d.ts @@ -1,14 +1,49 @@ declare namespace AMap { class LayerGroup extends Layer { + /** + * 图层集合 + * @param layers 集合中的图层 + */ constructor(layers: L | L[]); + /** + * 添加单个图层到集合中,不支持添加重复的图层 + * @param layer 图层 + */ addLayer(layer: L | L[]): this; + /** + * 添加图层数组到集合中,不支持添加重复的图层 + * @param layers 图层数组 + */ addLayers(layers: L | L[]): this; + /** + * 返回当前集合中所有的图层 + */ getLayers(): L[]; getLayer(finder: (this: null, item: L, index: number, list: L[]) => boolean): L | null; + /** + * 判断传入的图层实例是否在集合中 + * @param layer 目标图层 + */ hasLayer(layer: L | ((this: null, item: L, index: number, list: L[]) => boolean)): boolean; + /** + * 从集合中删除传入的图层实例 + * @param layer 图层 + */ removeLayer(layer: L | L[]): this; - removeLayers(layer: L | L[]): this; + /** + * 从集合中删除传入的图层实例数组 + * @param layers 图层数组 + */ + removeLayers(layers: L | L[]): this; + /** + * 清空集合 + */ clearLayers(): this; + /** + * 对集合中的图层做迭代操作 + * @param iterator 迭代回调 + * @param context 执行上下文 + */ eachLayer(iterator: (this: C, layer: L, index: number, list: L[]) => void, context?: C): void; // overwrite diff --git a/types/amap-js-api/layer/massMarks.d.ts b/types/amap-js-api/layer/massMarks.d.ts index 1ab5464a5b..963f7e2ec6 100644 --- a/types/amap-js-api/layer/massMarks.d.ts +++ b/types/amap-js-api/layer/massMarks.d.ts @@ -12,21 +12,51 @@ declare namespace AMap { } interface Style { + /** + * 图标显示位置偏移量,以图标的左上角为基准点(0,0)点 + */ anchor: Pixel; + /** + * 图标的地址 + */ url: string; + /** + * 图标的尺寸 + */ size: Size; + /** + * 旋转角度 + */ rotation?: number; } type UIEvent = Event ? D : Data; }>; interface Options extends Layer.Options { + /** + * 显示层级 + */ zIndex?: number; + /** + * 指针样式 + */ cursor?: string; + /** + * 是否在拖拽缩放过程中实时重绘 + */ alwayRender?: boolean; + /** + * 设置点的样式 + */ style: Style | Style[]; // rejectMapMask } @@ -37,11 +67,33 @@ declare namespace AMap { } class MassMarks extends Layer { + /** + * 海量点类,利用该类可同时在地图上展示万级别的点 + * @param data 点对象数组或url + * @param opts 选项 + */ constructor(data: D[] | string, opts: MassMarks.Options); + /** + * 设置显示样式 + * @param style 样式设置 + */ setStyle(style: MassMarks.Style | MassMarks.Style[]): void; + /** + * 获取显示样式 + */ getStyle(): MassMarks.Style | MassMarks.Style[]; + /** + * 设置数据集 + * @param data 数据集 + */ setData(data: D[] | string): void; + /** + * 获取数据集 + */ getData(): Array> & { lnglat: LngLat }>; + /** + * 清除海量点 + */ clear(): void; } } diff --git a/types/amap-js-api/layer/mediaLayer.d.ts b/types/amap-js-api/layer/mediaLayer.d.ts index a38f5ba025..43fee214bb 100644 --- a/types/amap-js-api/layer/mediaLayer.d.ts +++ b/types/amap-js-api/layer/mediaLayer.d.ts @@ -1,35 +1,94 @@ declare namespace AMap { namespace MediaLayer { interface Options extends Layer.Options { + /** + * 显示范围 + */ bounds?: Bounds; + /** + * 是否可见 + */ visible?: boolean; + /** + * 缩放范围 + */ zooms?: [number, number]; + /** + * 透明度 + */ opacity?: number; } } abstract class MediaLayer extends Layer { + /** + * @param options 图层选项 + */ constructor(options?: MediaLayer.Options); + /** + * 设置显示范围 + * @param bounds 显示范围 + */ setBounds(bounds: Bounds): void; + /** + * 获取显示的范围 + */ getBounds(): Bounds; + /** + * 设置图层选项 + * @param options 图层选项 + */ setOptions(options: Partial): void; + /** + * 获取图层选项 + */ getOptions(): Partial; + /** + * 获取元素 + */ getElement(): E | null; } + /** + * 图片图层 + */ class ImageLayer extends MediaLayer { + /** + * 修改Image的Url + * @param url url + */ setImageUrl(url: string): void; + /** + * 返回Image的Url + */ getImageUrl(): string | undefined; } class VideoLayer extends MediaLayer { + /** + * 修改Video的Url + * @param source url + */ setVideoUrl(source: string | string[]): void; + /** + * 返回Video的Url + */ getVideoUrl(): string | string[] | undefined; } class CanvasLayer extends MediaLayer { + /** + * 修改显示的Canvas + * @param canvas Canvas对象 + */ setCanvas(canvas: HTMLCanvasElement): void; + /** + * 返回Canvas对象 + */ getCanvas(): HTMLCanvasElement | undefined; + /** + * 当canvas的内容发生改变是用于刷新图层 + */ reFresh(): void; } } diff --git a/types/amap-js-api/layer/tileLayer.d.ts b/types/amap-js-api/layer/tileLayer.d.ts index 7576a70664..1a146b964c 100644 --- a/types/amap-js-api/layer/tileLayer.d.ts +++ b/types/amap-js-api/layer/tileLayer.d.ts @@ -5,33 +5,87 @@ declare namespace AMap { } interface Options extends Layer.Options { + /** + * 切片大小 + */ tileSize?: number; + /** + * 切片取图地址(自1.3版本起,该属性与getTileUrl属性合并) + */ tileUrl?: string; + /** + * 取图错误时的代替地址 + */ errorUrl?: string; + /** + * 获取图块取图地址 + */ getTileUrl?: string | ((x: number, y: number, level: number) => string); + /** + * 图层叠加的顺序值 + */ zIndex?: number; + /** + * 图层的透明度 + */ opacity?: number; + /** + * 支持的缩放级别范围 + */ zooms?: [number, number]; + /** + * 是否在高清屏下进行清晰度适配 + */ detectRetina?: boolean; } + /** + * 卫星图层 + */ class Satellite extends TileLayer { } + /** + * 路网图层 + */ class RoadNet extends TileLayer { } namespace Traffic { interface Options extends TileLayer.Options { + /** + * 是否设置可以自动刷新实时路况信息 + */ autoRefresh?: boolean; + /** + * 设置刷新间隔时长 + */ interval?: number; } } class Traffic extends TileLayer { + /** + * 实时交通图层 + * @param options 图层选项 + */ constructor(options?: Traffic.Options); } } class TileLayer extends Layer { + /** + * 切片图层 + * @param options 图层选项 + */ constructor(options?: TileLayer.Options); + /** + * 获取当前图层所有切片号 + */ getTiles(): string[]; + /** + * 重新加载此图层 + */ reload(): void; + /** + * 设置图层的取图地址 + * @param url 取图地址 + */ setTileUrl(url: string | ((x: number, y: number, level: number) => string)): void; } } diff --git a/types/amap-js-api/layer/wms.d.ts b/types/amap-js-api/layer/wms.d.ts index c4561ddf14..043975d856 100644 --- a/types/amap-js-api/layer/wms.d.ts +++ b/types/amap-js-api/layer/wms.d.ts @@ -13,16 +13,43 @@ declare namespace AMap { ELEVATION?: string; } interface Options extends Flexible.Options { + /** + * wms服务的url地址 + */ url: string; + /** + * OGC标准的WMS地图服务的GetMap接口的参数 + */ params: Params; + /** + * 地图级别切换时,不同级别的图片是否进行混合 + */ blend?: boolean; } } class WMS extends Flexible { + /** + * WMS图层 + * @param options 图层选项 + */ constructor(options: WMS.Options); + /** + * 设置wms服务地址 + * @param url 服务地址 + */ setUrl(url: string): void; + /** + * 返回wms服务地址 + */ getUrl(): string; + /** + * 设置OGC标准的WMS getMap接口的参数 + * @param params 接口参数 + */ setParams(params: WMS.Params): void; + /** + * 返回OGC标准的WMS getMap接口的参数 + */ getParams(): WMS.Params; } } diff --git a/types/amap-js-api/layer/wmts.d.ts b/types/amap-js-api/layer/wmts.d.ts index 5d85e5df48..7a122dd6b9 100644 --- a/types/amap-js-api/layer/wmts.d.ts +++ b/types/amap-js-api/layer/wmts.d.ts @@ -8,17 +8,44 @@ declare namespace AMap { Format?: string; } interface Options extends Flexible.Options { + /** + * wmts服务的url地址 + */ url: string; + /** + * OGC标准的WMTS地图服务的GetTile接口的参数 + */ params: Params; + /** + * 地图级别切换时,不同级别的图片是否进行混合 + */ blend?: boolean; } } class WMTS extends Flexible { + /** + * WMTS图层 + * @param options 图层选项 + */ constructor(options: WMTS.Options); + /** + * 设置wmts服务地址 + * @param url 服务地址 + */ setUrl(url: string): void; + /** + * 返回wmts服务地址 + */ getUrl(): string; + /** + * 设置OGC标准的WMTS getTile接口的参数 + * @param params 接口参数 + */ setParams(params: WMTS.Params): void; + /** + * 返回OGC标准的WMTS getTile接口的参数 + */ getParams(): WMTS.Params; } } diff --git a/types/amap-js-api/lngLat.d.ts b/types/amap-js-api/lngLat.d.ts index 4247002b2b..f649a78de8 100644 --- a/types/amap-js-api/lngLat.d.ts +++ b/types/amap-js-api/lngLat.d.ts @@ -1,11 +1,39 @@ declare namespace AMap { class LngLat { + /** + * 构造一个地理坐标对象 + * @param lng 经度 + * @param lat 纬度 + * @param noAutofix 是否自动修正 + */ constructor(lng: number, lat: number, noAutofix?: boolean); + /** + * 移动当前经纬度坐标得到新的坐标 + * @param east 移动经度,向右为正值 + * @param north 移动维度,向上为正值 + */ offset(east: number, north: number): LngLat; + /** + * 当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 + * @param lnglat 对比目标 + */ distance(lnglat: LngLat | LngLat[]): number; + /** + * 获取经度值 + */ getLng(): number; + /** + * 获取纬度值 + */ getLat(): number; + /** + * 判断当前坐标对象与传入坐标对象是否相等 + * @param lnglat 判断目标 + */ equals(lnglat: LngLat): boolean; + /** + * 以字符串的形式返回 + */ toString(): string; // internal diff --git a/types/amap-js-api/map.d.ts b/types/amap-js-api/map.d.ts index 46edc68577..e7937966b1 100644 --- a/types/amap-js-api/map.d.ts +++ b/types/amap-js-api/map.d.ts @@ -3,39 +3,145 @@ declare namespace AMap { type Feature = 'bg' | 'point' | 'road' | 'building'; type ViewMode = '2D' | '3D'; interface Options { + /** + * 地图视口,用于控制影响地图静态显示的属性 + */ view?: View2D; + /** + * 地图图层数组,数组可以是图层 中的一个或多个,默认为普通二维地图 + */ layers?: Layer[]; + /** + * 地图显示的缩放级别 + */ zoom?: number; + /** + * 地图中心点坐标值 + */ center?: LocationValue; + /** + * 地图标注显示顺序 + */ labelzIndex?: number; + /** + * 地图显示的缩放级别范围 + */ zooms?: [number, number]; + /** + * 地图语言类型 + */ lang?: Lang; + /** + * 地图默认鼠标样式 + */ defaultCursor?: string; + /** + * 地图显示的参考坐标系 + */ crs?: 'EPSG3857' | 'EPSG3395' | 'EPSG4326'; + /** + * 地图平移过程中是否使用动画 + */ animateEnable?: boolean; + /** + * 是否开启地图热点和标注的hover效果 + */ isHotspot?: boolean; + /** + * 当前地图中默认显示的图层 + */ defaultLayer?: TileLayer; + /** + * 地图是否可旋转 + */ rotateEnable?: boolean; + /** + * 是否监控地图容器尺寸变化 + */ resizeEnable?: boolean; + /** + * 是否在有矢量底图的时候自动展示室内地图 + */ showIndoorMap?: boolean; + /** + * 在展示矢量图的时候自动展示室内地图图层 + */ + // indoorMap?: IndorMap + /** + * 是否支持可以扩展最大缩放级别 + */ expandZoomRange?: boolean; + /** + * 地图是否可通过鼠标拖拽平移 + */ dragEnable?: boolean; + /** + * 地图是否可缩放 + */ zoomEnable?: boolean; + /** + * 地图是否可通过双击鼠标放大地图 + */ doubleClickZoom?: boolean; + /** + * 地图是否可通过键盘控制 + */ keyboardEnable?: boolean; + /** + * 地图是否使用缓动效果 + */ jogEnable?: boolean; + /** + * 地图是否可通过鼠标滚轮缩放浏览 + */ scrollWheel?: boolean; + /** + * 地图在移动终端上是否可通过多点触控缩放浏览地图 + */ touchZoom?: boolean; + /** + * 当touchZoomCenter=1的时候,手机端双指缩放的以地图中心为中心,否则默认以双指中间点为中心 + */ touchZoomCenter?: number; + /** + * 设置地图的显示样式 + */ mapStyle?: string; + /** + * 设置地图上显示的元素种类 + */ features?: Feature[] | 'all' | Feature; + /** + * 设置地图显示3D楼块效果 + */ showBuildingBlock?: boolean; + /** + * 视图模式 + */ viewMode?: ViewMode; + /** + * 俯仰角度 + */ pitch?: number; + /** + * 是否允许设置俯仰角度 + */ pitchEnable?: boolean; + /** + * 楼块出现和消失的时候是否显示动画过程 + */ buildingAnimation?: boolean; + /** + * 调整天空颜色 + */ skyColor?: string; + /** + * 设置地图的预加载模式 + */ preloadMode?: boolean; + /** + * 为 Map 实例指定掩模的路径,各图层将只显示路径范围内图像 + */ mask?: Array<[number, number]> | Array> | Array>>; maxPitch?: number; rotation?: number; @@ -58,24 +164,67 @@ declare namespace AMap { // detectRetina: number; } interface Status { + /** + * 是否开启动画 + */ animateEnable: boolean; + /** + * 是否双击缩放 + */ doubleClickZoom: boolean; + /** + * 是否支持拖拽 + */ dragEnable: boolean; isHotspot: boolean; + /** + * 是否开启缓动效果 + */ jogEnable: boolean; + /** + * 是否支持键盘 + */ keyboardEnable: boolean; + /** + * 是否支持调整俯仰角 + */ pitchEnable: boolean; resizeEnable: boolean; + /** + * 是否支持旋转 + */ rotateEnable: boolean; + /** + * 是否支持滚轮缩放 + */ scrollWheel: boolean; + /** + * 是否支持触摸缩放 + */ touchZoom: boolean; + /** + * 是否支持缩放 + */ zoomEnable: boolean; } type HotspotEvent = Event; interface EventMap { @@ -113,73 +262,305 @@ declare namespace AMap { } class Map extends EventEmitter { + /** + * 构造一个地图对象 + * @param container 地图容器的id或者是DOM元素 + * @param opts 选项 + */ constructor(container: string | HTMLElement, opts?: Map.Options); + /** + * 唤起高德地图客户端marker页 + * @param obj 唤起参数 + */ poiOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + /** + * 唤起高德地图客户端marker详情页 + * @param obj 唤起参数 + */ detailOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + /** + * 获取当前地图缩放级别 + */ getZoom(): number; + /** + * 获取地图图层数组 + */ getLayers(): Layer[]; + /** + * 获取地图中心点经纬度坐标值 + */ getCenter(): LngLat; + /** + * 返回地图对象的容器 + */ getContainer(): HTMLElement | null; + /** + * 获取地图中心点所在区域 + */ getCity(callback: (cityData: { + /** + * 市名称 + */ city: string; + /** + * 市代码 + */ citycode: string; + /** + * 区名称 + */ district: string; + /** + * 省 + */ province: string | never[]; // province is empty array when getCity fail }) => void): void; + /** + * 获取当前地图视图范围,获取当前可视区域 + */ getBounds(): Bounds; + /** + * 获取当前地图标注的显示顺序 + */ getLabelzIndex(): number; + /** + * 获取Map的限制区域 + */ getLimitBounds(): Bounds; + /** + * 获取地图语言类型 + */ getLang(): Lang; + /** + * 获取地图容器像素大小 + */ getSize(): Size; + /** + * 获取地图顺时针旋转角度 + */ getRotation(): number; + /** + * 获取当前地图状态信息 + */ getStatus(): Map.Status; + /** + * 获取地图默认鼠标指针样式 + */ getDefaultCursor(): string; + /** + * 获取指定位置的地图分辨率 + * @param point 指定经纬度 + */ getResolution(point?: LocationValue): number; + /** + * 获取当前地图比例尺 + * @param dpi dpi + */ getScale(dpi?: number): number; + /** + * 设置地图显示的缩放级别 + * @param level 缩放级别 + */ setZoom(level: number): void; + /** + * 设置地图标注显示的顺序 + * @param index 显示顺序 + */ setLabelzIndex(index: number): void; + /** + * 设置地图图层数组 + * @param layers 图层数组 + */ setLayers(layers: Layer[]): void; + /** + * 添加覆盖物/图层 + * @param overlay 覆盖物/图层 + */ add(overlay: Overlay | Overlay[]): void; + /** + * 删除覆盖物/图层 + * @param overlay 覆盖物/图层 + */ remove(overlay: Overlay | Overlay[]): void; + /** + * 返回添加的覆盖物对象 + * @param type 覆盖物类型 + */ getAllOverlays(type?: 'marker' | 'circle' | 'polyline' | 'polygon'): Overlay[]; + /** + * 设置地图显示的中心点 + * @param center 中心点经纬度 + */ setCenter(center: LocationValue): void; + /** + * 地图缩放至指定级别并以指定点为地图显示中心点 + * @param zoomLevel 缩放等级 + * @param center 缩放中心 + */ setZoomAndCenter(zoomLevel: number, center: LocationValue): void; + /** + * 按照行政区名称或adcode来设置地图显示的中心点。 + * @param city 城市名称或城市编码 + * @param callback 回调 + */ setCity(city: string, callback: (this: this, coord: [string, string], zoom: number) => void): void; + /** + * 指定当前地图显示范围 + * @param bound 显示范围 + */ setBounds(bound: Bounds): Bounds; + /** + * 设置Map的限制区域 + * @param bound 限制区域 + */ setLimitBounds(bound: Bounds): void; + /** + * 清除限制区域 + */ clearLimitBounds(): void; + /** + * 设置地图语言类型 + * @param lang 语言类型 + */ setLang(lang: Lang): void; + /** + * 设置地图顺时针旋转角度,旋转原点为地图容器中心点 + * @param rotation 旋转角度 + */ setRotation(rotation: number): void; + /** + * 设置当前地图显示状态 + * @param status 状态 + */ setStatus(status: Partial): void; + /** + * 设置鼠标指针默认样式 + * @param cursor 指针样式 + */ setDefaultCursor(cursor: string): void; + /** + * 地图放大一级显示 + */ zoomIn(): void; + /** + * 地图缩小一级显示 + */ zoomOut(): void; + /** + * 地图中心点平移至指定点位置 + * @param position 目标位置经纬度 + */ panTo(position: LocationValue): void; + /** + * 以像素为单位,沿x方向和y方向移动地图 + * @param x 横向移动像素,向右为正 + * @param y 纵向移动像素,向下为正 + */ panBy(x: number, y: number): void; + /** + * 根据地图上添加的覆盖物分布情况,自动缩放地图到合适的视野级别 + * @param overlayList 覆盖物数组 + * @param immediately 是否需要动画过程 + * @param avoid 上下左右的像素避让宽度 + * @param maxZoom 最大缩放级别 + */ setFitView( overlayList?: Overlay | Overlay[], immediately?: boolean, avoid?: [number, number, number, number], maxZoom?: number ): Bounds | false | undefined; + /** + * 删除地图上所有的覆盖物 + */ clearMap(): void; + /** + * 注销地图对象,并清空地图容器 + */ destroy(): void; + /** + * 加载插件, + * tips: 插件的类型定义不在本类型定义中给出,需要另行安装例如 + * 3d地图:@types/amap-js-api-map3d + * 地区搜索:@types/amap-js-api-place-search + * @param name 插件名称 + * @param callback 插件加载完成后的回调函数 + */ plugin(name: string | string[], callback: () => void): this; + /** + * 添加控件 + * @param control 控件 + */ addControl(control: {}): void; // TODO + /** + * 移除控件 + * @param control 控件 + */ removeControl(control: {}): void; // TODO + /** + * 清除地图上的信息窗体。 + */ clearInfoWindow(): void; + /** + * 平面地图像素坐标转换为地图经纬度坐标 + * @param pixel 像素坐标 + * @param level 缩放等级 + */ pixelToLngLat(pixel: Pixel, level?: number): LngLat; + /** + * 地图经纬度坐标转换为平面地图像素坐标 + * @param lnglat 经纬度坐标 + * @param level 缩放等级 + */ lnglatToPixel(lnglat: LocationValue, level?: number): Pixel; + /** + * 地图容器像素坐标转为地图经纬度坐标 + * @param pixel 地图像素坐标 + */ containerToLngLat(pixel: Pixel): LngLat; + /** + * 地图经纬度坐标转为地图容器像素坐标 + * @param lnglat 经纬度坐标 + */ lngLatToContainer(lnglat: LocationValue): Pixel; + /** + * 地图经纬度坐标转为地图容器像素坐标 + * @param lnglat 经纬度坐标 + */ lnglatTocontainer(lnglat: LocationValue): Pixel; + /** + * 设置地图的显示样式 + * @param style 地图样式 + */ setMapStyle(style: string): void; + /** + * 获取地图显示样式 + */ getMapStyle(): string; + /** + * 设置地图上显示的元素种类 + * @param feature 元素 + */ setFeatures(feature: Map.Feature | Map.Feature[] | 'all'): void; + /** + * 获取地图显示元素种类 + */ getFeatures(): Map.Feature | Map.Feature[] | 'all'; + /** + * 修改底图图层 + * @param layer 图层 + */ setDefaultLayer(layer: TileLayer): void; + /** + * 设置俯仰角 + * @param pitch 俯仰角 + */ setPitch(pitch: number): void; + /** + * 获取俯仰角 + */ getPitch(): number; + getViewMode_(): Map.ViewMode; lngLatToGeodeticCoord(lnglat: LocationValue): Pixel; geodeticCoordToLngLat(pixel: Pixel): LngLat; diff --git a/types/amap-js-api/overlay/bezierCurve.d.ts b/types/amap-js-api/overlay/bezierCurve.d.ts index 5778cb72a6..b861440a92 100644 --- a/types/amap-js-api/overlay/bezierCurve.d.ts +++ b/types/amap-js-api/overlay/bezierCurve.d.ts @@ -2,18 +2,31 @@ declare namespace AMap { namespace BezierCurve { interface EventMap extends Polyline.EventMap { } type Options = Merge, { - // internal + /** + * 贝瑟尔曲线的路径 + */ path: Array>>; + // internal tolerance?: number; interpolateNumLimit?: [number | number]; }>; interface GetOptionsResult extends Polyline.GetOptionsResult { + /** + * 贝瑟尔曲线的路径 + */ path: Array; } } class BezierCurve extends Polyline { + /** + * 贝瑟尔曲线 + * @param options 覆盖物选项 + */ constructor(options: BezierCurve.Options); + /** + * 获取覆盖物选项 + */ getOptions(): Partial>; // internal getInterpolateLngLats(): LngLat[]; diff --git a/types/amap-js-api/overlay/circle.d.ts b/types/amap-js-api/overlay/circle.d.ts index 2a1cbd9020..c718119e5a 100644 --- a/types/amap-js-api/overlay/circle.d.ts +++ b/types/amap-js-api/overlay/circle.d.ts @@ -34,15 +34,50 @@ declare namespace AMap { } class Circle extends ShapeOverlay { + /** + * 圆形覆盖物 + * @param options 覆盖物选项 + */ constructor(options?: Circle.Options); + /** + * 设置圆中心点 + * @param center 中心点经纬度 + * @param preventEvent 阻止触发事件 + */ setCenter(center: LocationValue, preventEvent?: boolean): void; + /** + * 获取圆中心点 + */ getCenter(): LngLat | undefined; + /** + * 获取圆外切矩形范围 + */ getBounds(): Bounds | null; + /** + * 设置圆形的半径 + * @param radius 半径 + * @param preventEvent 阻止触发事件 + */ setRadius(radius: number, preventEvent?: boolean): void; + /** + * 获取圆形的半径 + */ getRadius(): number; + /** + * 修改选项 + * @param options 选项 + */ setOptions(options?: Circle.Options): void; + /** + * 获取选项 + */ getOptions(): Partial>; + /** + * 判断指定点坐标是否在圆内 + * @param point 坐标 + */ contains(point: LocationValue): boolean; + // internal getPath(count?: number): LngLat[]; } diff --git a/types/amap-js-api/overlay/circleMarker.d.ts b/types/amap-js-api/overlay/circleMarker.d.ts index 13e4162f46..0b67d7f13e 100644 --- a/types/amap-js-api/overlay/circleMarker.d.ts +++ b/types/amap-js-api/overlay/circleMarker.d.ts @@ -1,4 +1,7 @@ declare namespace AMap { // tslint:disable-next-line; + /** + * 圆点标记 + */ class CircleMarker extends Circle {} } diff --git a/types/amap-js-api/overlay/contextMenu.d.ts b/types/amap-js-api/overlay/contextMenu.d.ts index 72c7fc2852..eacb6673c8 100644 --- a/types/amap-js-api/overlay/contextMenu.d.ts +++ b/types/amap-js-api/overlay/contextMenu.d.ts @@ -1,7 +1,11 @@ declare namespace AMap { namespace ContextMenu { interface Options { + /** + * 右键菜单内容 + */ content?: string | HTMLElement; + // internal visible?: boolean; } @@ -14,10 +18,33 @@ declare namespace AMap { } class ContextMenu extends Overlay { + /** + * 地图右键菜单 + * @param options 选项 + */ constructor(options?: ContextMenu.Options); + /** + * 右键菜单中添加菜单项 + * @param text 菜单显示内容 + * @param fn 该菜单下需进行的操作 + * @param num 当前菜单项在右键菜单中的排序位置,以0开始 + */ addItem(text: string, fn: (this: HTMLLIElement) => void, num?: number): void; - removeItem(test: string, fn: (this: HTMLLIElement) => void): void; + /** + * 删除一个菜单项 + * @param text 菜单显示内容 + * @param fn 该菜单下需进行的操作 + */ + removeItem(text: string, fn: (this: HTMLLIElement) => void): void; + /** + * 在地图的指定位置打开右键菜单。 + * @param map 目标地图 + * @param position 打开位置经纬度 + */ open(map: Map, position: LocationValue): void; + /** + * 关闭右键菜单 + */ close(): void; } } diff --git a/types/amap-js-api/overlay/ellipse.d.ts b/types/amap-js-api/overlay/ellipse.d.ts index 55feaf3112..de9da22e0c 100644 --- a/types/amap-js-api/overlay/ellipse.d.ts +++ b/types/amap-js-api/overlay/ellipse.d.ts @@ -6,7 +6,13 @@ declare namespace AMap { } interface Options extends Polygon.Options { + /** + * 椭圆的中心 + */ center?: LocationValue; + /** + * 椭圆半径 + */ radius?: [number, number]; } type GetOptionsResult = Merge, { @@ -15,9 +21,25 @@ declare namespace AMap { } class Ellipse extends Polygon { + /** + * 椭圆 + * @param options 选项 + */ constructor(options?: Ellipse.Options); + /** + * 获取椭圆的中心点 + */ getCenter(): LngLat | undefined; + /** + * 设置椭圆的中心点 + * @param center 中心点 + * @param preventEvent 阻止触发事件 + */ setCenter(center: LocationValue, preventEvent?: boolean): void; + /** + * 修改椭圆属性 + * @param options 属性 + */ setOptions(options: Ellipse.Options): void; // internal diff --git a/types/amap-js-api/overlay/geoJSON.d.ts b/types/amap-js-api/overlay/geoJSON.d.ts index 75098a59f0..aa3554cb04 100644 --- a/types/amap-js-api/overlay/geoJSON.d.ts +++ b/types/amap-js-api/overlay/geoJSON.d.ts @@ -24,9 +24,27 @@ declare namespace AMap { features: GeoJSONObject[]; }; interface Options { + /** + * 要加载的标准GeoJSON对象 + */ geoJSON?: GeoJSONObject | GeoJSONObject[]; + /** + * 指定点要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglat 点的位置 + */ getMarker?(obj: GeoJSONObject, lnglat: LngLat): Marker; + /** + * 指定线要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglats 线的路径 + */ getPolyline?(obj: GeoJSONObject, lnglats: LngLat[]): Polyline; + /** + * 指定面要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglats 面的路径 + */ getPolygon?(obj: GeoJSONObject, lnglats: LngLat[]): Polygon; coordsToLatLng?(lnglat: LngLat): LngLat; @@ -36,8 +54,19 @@ declare namespace AMap { } class GeoJSON extends OverlayGroup { + /** + * GeoJSON + * @param options 选项 + */ constructor(options?: GeoJSON.Options); + /** + * 加载新的GeoJSON对象,转化为覆盖物,旧的覆盖物将移除 + * @param obj GeoJSON对象 + */ importData(obj: GeoJSON.GeoJSONObject | GeoJSON.GeoJSONObject[]): void; + /** + * 将当前对象包含的覆盖物转换为GeoJSON对象 + */ toGeoJSON(): GeoJSON.GeoJSONObject[]; } } diff --git a/types/amap-js-api/overlay/icon.d.ts b/types/amap-js-api/overlay/icon.d.ts index be300feef3..18d75921bf 100644 --- a/types/amap-js-api/overlay/icon.d.ts +++ b/types/amap-js-api/overlay/icon.d.ts @@ -1,16 +1,39 @@ declare namespace AMap { namespace Icon { interface Options { + /** + * 图标尺寸 + */ size?: SizeValue; + /** + * 图标取图偏移量 + */ imageOffset?: Pixel; + /** + * 图标的取图地址 + */ image?: string; + /** + * 图标所用图片大小 + */ imageSize?: SizeValue; } } class Icon extends EventEmitter { + /** + * 点标记的图标 + * @param options 选项 + */ constructor(options?: Icon.Options); + /** + * 设置图标图片大小 + * @param size 大小 + */ setImageSize(size: SizeValue): void; + /** + * 获取图标图片大小 + */ getImageSize(): Size; } } diff --git a/types/amap-js-api/overlay/infoWindow.d.ts b/types/amap-js-api/overlay/infoWindow.d.ts index 54bedd95a8..1c9b69a9a3 100644 --- a/types/amap-js-api/overlay/infoWindow.d.ts +++ b/types/amap-js-api/overlay/infoWindow.d.ts @@ -7,13 +7,37 @@ declare namespace AMap { } interface Options extends Overlay.Options { + /** + * 是否自定义窗体 + */ isCustom?: boolean; + /** + * 是否自动调整窗体到视野内 + */ autoMove?: boolean; + /** + * 控制是否在鼠标点击地图后关闭信息窗体 + */ closeWhenClickMap?: boolean; + /** + * 显示内容 + */ content?: string | HTMLElement; + /** + * 信息窗体尺寸 + */ size?: SizeValue; + /** + * 信息窗体显示位置偏移量 + */ offset?: Pixel; + /** + * 信息窗体显示基点位置 + */ position?: LocationValue; + /** + * 是否显示信息窗体阴影 + */ showShadow?: boolean; // internal height?: number; @@ -21,16 +45,53 @@ declare namespace AMap { } class InfoWindow extends Overlay { + /** + * 信息展示窗体 + * @param options 选项 + */ constructor(options?: InfoWindow.Options); + /** + * 在地图的指定位置打开信息窗体 + * @param map 地图 + * @param position 打开的位置 + */ open(map: Map, position?: LocationValue): void; + /** + * 关闭信息窗体 + */ close(): void; + /** + * 获取信息窗体是否打开 + */ getIsOpen(): boolean; + /** + * 设置信息窗体内容 + * @param content 窗体内容 + */ setContent(content: string | HTMLElement): void; + /** + * 获取信息窗体内容 + */ getContent(): string | HTMLElement | undefined; + /** + * 设置信息窗体显示基点位置 + * @param lnglat 位置经纬度 + */ setPosition(lnglat: LocationValue): void; + /** + * 获取信息窗体显示基点位置 + */ getPosition(): LngLat | undefined; + /** + * 设置信息窗体大小 + * @param size 大小 + */ setSize(size: SizeValue): void; + /** + * 获取信息窗体大小 + */ getSize(): Size | undefined; + // internal setOffset(offset: Pixel): void; } diff --git a/types/amap-js-api/overlay/marker.d.ts b/types/amap-js-api/overlay/marker.d.ts index e24ce7be8f..42dddf394a 100644 --- a/types/amap-js-api/overlay/marker.d.ts +++ b/types/amap-js-api/overlay/marker.d.ts @@ -26,78 +26,268 @@ declare namespace AMap { } interface Options extends Overlay.Options { + /** + * 点标记在地图上显示的位置 + */ position?: LocationValue; + /** + * 点标记显示位置偏移量 + */ offset?: Pixel; + /** + * 需在点标记中显示的图标 + */ icon?: string | Icon; + /** + * 点标记显示内容 + */ content?: string | HTMLElement; + /** + * 鼠标点击时marker是否置顶 + */ topWhenClick?: boolean; + /** + * 是否将覆盖物的鼠标或touch等事件冒泡到地图上 + */ bubble?: boolean; + /** + * 点标记是否可拖拽移动 + */ draggable?: boolean; + /** + * 拖拽点标记时是否开启点标记离开地图的效果 + */ raiseOnDrag?: boolean; + /** + * 鼠标悬停时的鼠标样式 + */ cursor?: string; + /** + * 点标记是否可见 + */ visible?: boolean; + /** + * 点标记的叠加顺序 + */ zIndex?: number; + /** + * 点标记的旋转角度 + */ angle?: number; + /** + * 是否自动旋转 + */ autoRotation?: boolean; + /** + * 点标记的动画效果 + */ animation?: AnimationName; + /** + * 点标记阴影 + */ shadow?: Icon | string; + /** + * 鼠标滑过点标记时的文字提示 + */ title?: string; + /** + * 可点击区域 + */ shape?: MarkerShape; + /** + * 文本标注 + */ label?: Label; - zooms?: [number, number]; // internal + zooms?: [number, number]; topWhenMouseOver?: boolean; height?: number; } } class Marker extends Overlay { + /** + * 点标记 + * @param options 选项 + */ constructor(options?: Marker.Options); + /** + * 唤起高德地图客户端标注页 + * @param obj 唤起参数 + */ markOnAMAP(obj?: { name?: string, position?: LocationValue }): void; + /** + * 获取偏移量 + */ getOffset(): Pixel; + /** + * 设置偏移量 + * @param offset 偏移量 + */ setOffset(offset: Pixel): void; + /** + * 设置点标记的动画效果 + * @param animate 动画效果类型 + */ setAnimation(animate: AnimationName, prevent?: boolean): void; + /** + * 获取点标记的动画效果类型 + */ getAnimation(): AnimationName; + /** + * 设置点标记是支持鼠标单击事件 + * @param cilckable 是否支持点击 + */ setClickable(cilckable: boolean): void; + /** + * 获取点标记是否支持鼠标单击事件 + */ getClickable(): boolean; + /** + * 获取点标记的位置 + */ getPosition(): LngLat | undefined; + /** + * 设置点标记位置 + * @param position 位置经纬度 + */ setPosition(position: LocationValue): void; + /** + * 设置点标记的旋转角度 + * @param angle 旋转角度 + */ setAngle(angle: number): void; + /** + * 设置点标记文本标签内容 + * @param label 标签内容 + */ setLabel(label?: Marker.Label): void; + /** + * 获取点标记文本标签内容 + */ getLabel(): Marker.Label | undefined; + /** + * 获取点标记的旋转角度 + */ getAngle(): number; + /** + * 设置点标记的叠加顺序 + * @param index 层级 + */ setzIndex(index: number): void; + /** + * 获取点标记的叠加顺序 + */ getzIndex(): number; + /** + * 设置点标记的显示图标 + * @param content 图标 + */ setIcon(content: string | Icon): void; + /** + * 获取Icon内容 + */ getIcon(): string | Icon | undefined; + /** + * 设置点标记对象是否可拖拽移动 + * @param draggable 是否可拖拽移动 + */ setDraggable(draggable: boolean): void; + /** + * 获取点标记对象是否可拖拽移动 + */ getDraggable(): boolean; + /** + * 设置鼠标悬停时的光标 + * @param cursor 光标 + */ setCursor(cursor: string): void; + /** + * 设置点标记显示内容,可以是HTML要素字符串或者HTML DOM对象 + * @param content 显示内容 + */ setContent(content: string | HTMLElement): void; + /** + * 获取点标记内容 + */ getContent(): string | HTMLElement; + /** + * 以指定的速度,点标记沿指定的路径移动 + * @param path 移动轨迹 + * @param speed 速度 + * @param timingFunction 缓动函数 + * @param circleable 是否循环 + */ moveAlong( path: LngLat[], speed: number, timingFunction?: (t: number) => number, circleable?: boolean ): void; + /** + * 以给定速度移动点标记到指定位置 + * @param lnglat 目标位置 + * @param speed 速度 + * @param timingFunction 缓动函数 + */ moveTo( - path: LocationValue, + lnglat: LocationValue, speed: number, timingFunction?: (t: number) => number ): void; + /** + * 点标记停止动画 + */ stopMove(): void; + /** + * 暂定点标记的动画效果 + */ pauseMove(): boolean; + /** + * 重新开始点标记的动画效果 + */ resumeMove(): boolean; + /** + * 指定目标显示地图 + * @param map 地图 + */ setMap(map: null | Map): void; + /** + * 鼠标滑过点标时的文字提示 + * @param title 提示文字 + */ setTitle(title: string): void; + /** + * 获取点标记的文字提示 + */ getTitle(): string | undefined; + /** + * 设置是否展示在最顶层 + * @param isTop 是否展示在最顶层 + */ setTop(isTop: boolean): void; + /** + * 获取是否展示在最顶层 + */ getTop(): boolean; + /** + * 设置阴影效果 + * @param icon 阴影效果 + */ setShadow(icon?: Icon | string): void; + /** + * 获取阴影图标 + */ getShadow(): Icon | undefined | string; + /** + * 设置可点击区域 + * @param shape 可点击区域 + */ setShape(shape?: MarkerShape): void; + /** + * 获取可点击区域 + */ getShape(): MarkerShape | undefined; } } diff --git a/types/amap-js-api/overlay/markerShape.d.ts b/types/amap-js-api/overlay/markerShape.d.ts index f0d6c39bac..19264f26cf 100644 --- a/types/amap-js-api/overlay/markerShape.d.ts +++ b/types/amap-js-api/overlay/markerShape.d.ts @@ -16,6 +16,10 @@ declare namespace AMap { } class MarkerShape extends EventEmitter { + /** + * Marker点击范围 + * @param options 选项 + */ constructor(options: MarkerShape.Options); } } diff --git a/types/amap-js-api/overlay/overlay.d.ts b/types/amap-js-api/overlay/overlay.d.ts index 1726b39c3e..f90bdb57ed 100644 --- a/types/amap-js-api/overlay/overlay.d.ts +++ b/types/amap-js-api/overlay/overlay.d.ts @@ -13,21 +13,59 @@ declare namespace AMap { mouseup: MapsEvent<'mouseup', I>; } interface Options { + /** + * 所属地图 + */ map?: Map; + /** + * 鼠标悬停时的鼠标样式 + */ cursor?: string; + /** + * 自定义数据 + */ extData?: ExtraData; + /** + * 事件是否穿透到地图 + */ bubble?: boolean; + /** + * 是否支持点击 + */ clickable?: boolean; + /** + * 是否支持拖拽 + */ draggable?: boolean; } } abstract class Overlay extends EventEmitter { constructor(options?: Overlay.Options); + /** + * 显示覆盖物 + */ show(): void; + /** + * 隐藏覆盖物 + */ hide(): void; + /** + * 获取所属地图 + */ getMap(): Map | null | undefined; + /** + * 设置所属地图 + * @param map 地图 + */ setMap(map: Map | null): void; + /** + * 设置自定义数据 + * @param extData 自定义数据 + */ setExtData(extData: ExtraData): void; + /** + * 获取自定义数据 + */ getExtData(): ExtraData | {}; // internal diff --git a/types/amap-js-api/overlay/overlayGroup.d.ts b/types/amap-js-api/overlay/overlayGroup.d.ts index d397505b04..a219e38fcd 100644 --- a/types/amap-js-api/overlay/overlayGroup.d.ts +++ b/types/amap-js-api/overlay/overlayGroup.d.ts @@ -11,20 +11,72 @@ type ReferOverlayOptions = declare namespace AMap { class OverlayGroup extends Overlay { + /** + * 覆盖物集合 + * @param overlays 覆盖物 + */ constructor(overlays?: O | O[]); + /** + * 添加单个覆盖物到集合中,不支持添加重复的覆盖物 + * @param overlay 覆盖物 + */ addOverlay(overlay: O | O[]): this; + /** + * 添加覆盖物数组到集合中,不支持添加重复的覆盖物 + * @param overlay 覆盖物数组 + */ addOverlays(overlay: O | O[]): this; + /** + * 返回当前集合中所有的覆盖物 + */ getOverlays(): O[]; + /** + * 判断传入的覆盖物实例是否在集合中 + * @param overlay 覆盖物 + */ hasOverlay(overlay: O | ((this: null, item: O, index: number, list: O[]) => boolean)): boolean; + /** + * 从集合中删除传入的覆盖物实例 + * @param overlay 覆盖物 + */ removeOverlay(overlay: O | O[]): this; + /** + * 从集合中删除传入的覆盖物实例数组 + * @param overlay 覆盖物数组 + */ removeOverlays(overlay: O | O[]): this; + /** + * 清空集合 + */ clearOverlays(): this; + /** + * 对集合中的覆盖物做迭代操作 + * @param iterator 迭代回调 + * @param context 执行上下文 + */ eachOverlay(iterator: (this: C, overlay: O, index: number, overlays: O[]) => void, context?: C): this; + /** + * 指定集合中里覆盖物的显示地图 + * @param map 地图 + */ setMap(map: null | Map): this; + /** + * 修改覆盖物属性 + * @param options 属性 + */ setOptions(options: ReferOverlayOptions): this; + /** + * 在地图上显示集合中覆盖物 + */ show(): this; + /** + * 在地图上隐藏集合中覆盖物 + */ hide(): this; - + /** + * 查找集合中的覆盖物 + * @param finder 查找回调 + */ getOverlay(finder: ((this: null, item: O, index: number, list: O[]) => boolean) | O): O | null; } } diff --git a/types/amap-js-api/overlay/pathOverlay.d.ts b/types/amap-js-api/overlay/pathOverlay.d.ts index de21aa35a7..d46b23a1c3 100644 --- a/types/amap-js-api/overlay/pathOverlay.d.ts +++ b/types/amap-js-api/overlay/pathOverlay.d.ts @@ -2,19 +2,49 @@ declare namespace AMap { namespace PathOverlay { interface EventMap extends ShapeOverlay.EventMap { } interface Options extends Overlay.Options { + /** + * 是否可见 + */ visible?: boolean; + /** + * 覆盖物层级 + */ zIndex?: number; + /** + * 描边线条颜色 + */ strokeColor?: string; + /** + * 描边线条透明度 + */ strokeOpacity?: number; + /** + * 描边宽度 + */ strokeWeight?: number; + /** + * 描边样式 + */ strokeStyle?: StrokeStyle; + /** + * 虚线间隔 + */ strokeDasharray?: number[]; + /** + * 折线拐点的绘制样式 + */ lineJoin?: StrokeLineJoin; + /** + * 折线两端线帽的绘制样式 + */ lineCap?: StrokeLineCap; } } abstract class PathOverlay extends ShapeOverlay { constructor(options?: PathOverlay.Options); + /** + * 获取范围 + */ getBounds(): Bounds | (this extends Rectangle ? undefined : null); } } diff --git a/types/amap-js-api/overlay/polygon.d.ts b/types/amap-js-api/overlay/polygon.d.ts index 8792e0e135..20a9c3595e 100644 --- a/types/amap-js-api/overlay/polygon.d.ts +++ b/types/amap-js-api/overlay/polygon.d.ts @@ -2,31 +2,77 @@ declare namespace AMap { namespace Polygon { interface EventMap extends PathOverlay.EventMap { } interface Options extends PathOverlay.Options { + /** + * 多边形轮廓线的节点坐标数组 + */ path?: LocationValue[] | LocationValue[][]; + /** + * 多边形填充颜色 + */ fillColor?: string; + /** + * 边形填充透明度 + */ fillOpacity?: number; } interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + /** + * 多边形填充颜色 + */ fillColor: string; + /** + * 边形填充透明度 + */ fillOpacity: number; + /** + * 多边形轮廓线的节点坐标数组 + */ path: LngLat[] | LngLat[][]; + /** + * 折线拐点的绘制样式 + */ lineJoin: StrokeLineJoin; texture: string; } } class Polygon extends PathOverlay { + /** + * 多边形 + * @param options 选项 + */ constructor(options?: Polygon.Options); + /** + * 设置多边形轮廓线节点数组 + * @param path 轮廓线节点 + */ setPath(path: LocationValue[] | LocationValue[][]): void; + /** + * 获取多边形轮廓线节点数组 + */ getPath(): LngLat[] | LngLat[][]; + /** + * 修改多边形属性 + * @param options 属性 + */ setOptions(options: Polygon.Options): void; + /** + * 获取多边形的属性 + */ getOptions(): Partial< this extends Omit ? Ellipse.GetOptionsResult : this extends Omit ? Rectangle.GetOptionsResult : Polygon.GetOptionsResult >; + /** + * 获取多边形的面积 + */ getArea(): number; + /** + * 判断指定点坐标是否在多边形范围内 + * @param point 坐标 + */ contains(point: LocationValue): boolean; } } diff --git a/types/amap-js-api/overlay/polyline.d.ts b/types/amap-js-api/overlay/polyline.d.ts index 207279b208..c7abfa6331 100644 --- a/types/amap-js-api/overlay/polyline.d.ts +++ b/types/amap-js-api/overlay/polyline.d.ts @@ -2,45 +2,118 @@ declare namespace AMap { namespace Polyline { interface EventMap extends PathOverlay.EventMap { } interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + /** + * 线条是否带描边 + */ isOutline: boolean; + /** + * 线条描边颜色 + */ outlineColor: string; + /** + * 是否绘制成大地线 + */ geodesic: boolean; + /** + * 折线的节点数组 + */ path: LngLat[]; + /** + * 折线拐点的绘制样式 + */ lineJoin: StrokeLineJoin; + /** + * 折线两端线帽的绘制样式 + */ lineCap: StrokeLineCap; + /** + * 描边的宽度 + */ borderWeight: number; + /** + * 是否延路径显示方向箭头 + */ showDir: boolean; + /** + * 方向箭头颜色 + */ dirColor: string; + /** + * 方向箭头图片 + */ dirImg: string; } interface Options extends PathOverlay.Options { + /** + * 线条是否带描边 + */ isOutline?: boolean; + /** + * 线条描边颜色 + */ outlineColor?: string; + /** + * 是否绘制成大地线 + */ geodesic?: boolean; + /** + * 方向箭头颜色 + */ dirColor?: string; + /** + * 描边的宽度 + */ borderWeight?: number; + /** + * 是否延路径显示方向箭头 + */ showDir?: boolean; + // internal + /** + * 折线的节点数组 + */ path?: LocationValue[]; } } class Polyline extends PathOverlay { + /** + * 折线 + * @param options 选项 + */ constructor(options?: BezierCurve.Options | Polyline.Options); + /** + * 设置组成该折线的节点数组 + * @param path 节点数组 + */ setPath( path: this extends Omit ? Array>> : LocationValue[] ): void; + /** + * 获取折线路径的节点数组 + */ getPath(): this extends Omit ? Array : LngLat[]; + /** + * 获取折线的总长度(单位:米) + */ getLength(): number; + /** + * 设置线的属性 + * @param options 属性 + */ setOptions(options: this extends Omit ? Partial> : Polyline.Options ): void; + /** + * 获取线的属性 + */ getOptions(): Partial>; } } diff --git a/types/amap-js-api/overlay/rectangle.d.ts b/types/amap-js-api/overlay/rectangle.d.ts index 259e2072de..833a46d3dc 100644 --- a/types/amap-js-api/overlay/rectangle.d.ts +++ b/types/amap-js-api/overlay/rectangle.d.ts @@ -5,17 +5,39 @@ declare namespace AMap { } interface Options extends Polygon.Options { + /** + * 矩形的范围 + */ bounds?: Bounds; } type GetOptionsResult = Merge, { + /** + * 路径节点数组 + */ path: LngLat[]; + /** + * 矩形的范围 + */ bounds: Bounds; texture: string; }>; } class Rectangle extends Polygon { + /** + * 矩形 + * @param options 选项 + */ constructor(options?: Rectangle.Options); + /** + * 获取矩形范围 + * @param bounds 矩形的范围 + * @param preventEvent 阻止触发事件 + */ setBounds(bounds: Bounds, preventEvent?: boolean): void; + /** + * 修改矩形属性 + * @param options 属性 + */ setOptions(options: Partial): void; } } diff --git a/types/amap-js-api/overlay/shapeOverlay.d.ts b/types/amap-js-api/overlay/shapeOverlay.d.ts index b8f239aac1..ab07fa3d88 100644 --- a/types/amap-js-api/overlay/shapeOverlay.d.ts +++ b/types/amap-js-api/overlay/shapeOverlay.d.ts @@ -7,24 +7,74 @@ declare namespace AMap { change: Event<'change', { target: I }>; } interface GetOptionsResult { + /** + * 所属地图 + */ map: Map; + /** + * 层级 + */ zIndex: number; + /** + * 线条颜色 + */ strokeColor: string; + /** + * 线条透明度 + */ strokeOpacity: number; + /** + * 线条宽度 + */ strokeWeight: number; + /** + * 线条样式,虚线或者实线 + */ strokeStyle: StrokeStyle; + /** + * 虚线的分段 + */ strokeDasharray: number[]; + /** + * 自定义属性 + */ extData: ExtraData | {}; + /** + * 事件是否穿透到地图 + */ bubble: boolean; + /** + * 是否支持点击 + */ clickable: boolean; } } abstract class ShapeOverlay extends Overlay { + /** + * 设置覆盖物属性 + * @param options 属性 + */ abstract setOptions(options: {}): void; + /** + * 获得属性 + */ abstract getOptions(): {}; + /** + * 获得层级 + */ getzIndex(): number; + /** + * 设置层级 + * @param zIndex 层级 + */ setzIndex(zIndex: number): void; + /** + * 返回可见 + */ getVisible(): boolean; + /** + * 设置是否可以拖拽 + */ setDraggable(draggable: boolean): void; } } diff --git a/types/amap-js-api/overlay/text.d.ts b/types/amap-js-api/overlay/text.d.ts index db15ae08ce..50f9249ad9 100644 --- a/types/amap-js-api/overlay/text.d.ts +++ b/types/amap-js-api/overlay/text.d.ts @@ -4,16 +4,38 @@ declare namespace AMap { type VerticalAlign = 'top' | 'middle' | 'bottom'; interface EventMap extends Marker.EventMap { } interface Options extends Marker.Options { + /** + * 文本内容 + */ text?: string; + /** + * 对齐方式 + */ textAlign?: TextAlign; + verticalAlign?: VerticalAlign; } } class Text extends Marker { + /** + * 纯文本标记 + * @param options 选项 + */ constructor(options?: Text.Options); + /** + * 标记显示的文本内容 + */ getText(): string; + /** + * 修改文本内容 + * @param text 文本内容 + */ setText(text: string): void; + /** + * 设置文本样式 + * @param style 文本样式 + */ setStyle(style: object): void; } } diff --git a/types/amap-js-api/pixel.d.ts b/types/amap-js-api/pixel.d.ts index fab4605b7a..b211e1d88a 100644 --- a/types/amap-js-api/pixel.d.ts +++ b/types/amap-js-api/pixel.d.ts @@ -1,9 +1,28 @@ declare namespace AMap { class Pixel { + /** + * 像素坐标,确定地图上的一个像素点 + * @param x 横轴坐标 + * @param y 纵轴坐标 + * @param round 是否四舍五入 + */ constructor(x: number, y: number, round?: boolean); + /** + * 获得X方向像素坐标 + */ getX(): number; + /** + * 获得Y方向像素坐标 + */ getY(): number; + /** + * 当前像素坐标与传入像素坐标是否相等 + * @param point 目标像素坐标 + */ equals(point: Pixel): boolean; + /** + * 以字符串形式返回像素坐标对象 + */ toString(): string; // internal diff --git a/types/amap-js-api/size.d.ts b/types/amap-js-api/size.d.ts index 12a1e25423..f13c2fff0b 100644 --- a/types/amap-js-api/size.d.ts +++ b/types/amap-js-api/size.d.ts @@ -1,9 +1,24 @@ declare namespace AMap { class Size { + /** + * 地物对象的像素尺寸 + * @param width 宽度像素 + * @param height 长度像素 + */ constructor(width: number, height: number); + /** + * 获得宽度 + */ getWidth(): number; + /** + * 获得高度 + */ getHeight(): number; + /** + * 以字符串形式返回尺寸大小对象 + */ toString(): string; + // internal contains(size: { x: number; y: number }): boolean; } diff --git a/types/amap-js-api/util.d.ts b/types/amap-js-api/util.d.ts index 70b48c31d1..ee275d66b5 100644 --- a/types/amap-js-api/util.d.ts +++ b/types/amap-js-api/util.d.ts @@ -1,25 +1,64 @@ declare namespace AMap { namespace Util { + /** + * 将颜色名转换为16进制RGB颜色值 + * @param colorName 颜色名 + */ function colorNameToHex(colorName: string): string; - + /** + * 将16进制RGB转为rgba(R,G,B,A) + * @param hex 16进制RGB + */ function rgbHex2Rgba(hex: string): string; - + /** + * 将16进制RGBA转为rgba(R,G,B,A) + * @param hex 16进制RGBA + */ function argbHex2Rgba(hex: string): string; - + /** + * 判断一个对象是都为空 + * @param obj 目标对象 + */ function isEmpty(obj: object): boolean; - + /** + * 从数组删除元素 + * @param array 数组 + * @param item 元素 + */ function deleteItemFromArray(array: T[], item: T): T[]; - + /** + * 按索引删除数组元素 + * @param array 数组 + * @param index 索引 + */ function deleteItemFromArrayByIndex(array: T[], index: number): T[]; - + /** + * 返回元素索引 + * @param array 数组 + * @param item 元素 + */ function indexOf(array: T[], item: T): number; - + /** + * 保留小数点后指定位 + * @param floatNumber 数值 + * @param digits 小数点位数 + */ function format(floatNumber: number, digits?: number): number; - + /** + * 判断是否数组 + * @param data 判断对象 + */ function isArray(data: any): data is any[]; - + /** + * 判断参数是否为DOM元素 + * @param data 判断对象 + */ function isDOM(data: any): data is HTMLElement; - + /** + * 判断数组是否包含某个元素 + * @param array 数组 + * @param item 元素 + */ function includes(array: T[], item: T): boolean; function requestIdleCallback(callback: (...args: any[]) => any, options?: { timeout?: number }): number; diff --git a/types/amap-js-api/view2D.d.ts b/types/amap-js-api/view2D.d.ts index d662b4c50e..f246c5c67f 100644 --- a/types/amap-js-api/view2D.d.ts +++ b/types/amap-js-api/view2D.d.ts @@ -1,13 +1,29 @@ declare namespace AMap { namespace View2D { interface Options { + /** + * 地图中心点坐标值 + */ center?: LocationValue; + /** + * 地图顺时针旋转角度 + */ rotation?: number; + /** + * 地图显示的缩放级别 + */ zoom?: number; + /** + * 地图显示的参考坐标系 + */ crs?: 'EPGS3857' | 'EPGS3395' | 'EPGS4326'; } } class View2D extends EventEmitter { + /** + * 二维地图显示视口,用于定义二维地图静态显示属性 + * @param options 选项 + */ constructor(options?: View2D.Options); } } diff --git a/types/amazon-product-api/tslint.json b/types/amazon-product-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amazon-product-api/tslint.json +++ b/types/amazon-product-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amplitude-js/tslint.json b/types/amplitude-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amplitude-js/tslint.json +++ b/types/amplitude-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amqp-rpc/tslint.json b/types/amqp-rpc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amqp-rpc/tslint.json +++ b/types/amqp-rpc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-agility/tslint.json b/types/angular-agility/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-agility/tslint.json +++ b/types/angular-agility/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-animate/tslint.json b/types/angular-animate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-animate/tslint.json +++ b/types/angular-animate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-bootstrap-calendar/tslint.json b/types/angular-bootstrap-calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-bootstrap-calendar/tslint.json +++ b/types/angular-bootstrap-calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-bootstrap-lightbox/tslint.json +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-breadcrumb/tslint.json b/types/angular-breadcrumb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-breadcrumb/tslint.json +++ b/types/angular-breadcrumb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-clipboard/tslint.json b/types/angular-clipboard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-clipboard/tslint.json +++ b/types/angular-clipboard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-cookie/tslint.json b/types/angular-cookie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-cookie/tslint.json +++ b/types/angular-cookie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-cookies/tslint.json b/types/angular-cookies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-cookies/tslint.json +++ b/types/angular-cookies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-deferred-bootstrap/tslint.json b/types/angular-deferred-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-deferred-bootstrap/tslint.json +++ b/types/angular-deferred-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-dialog-service/tslint.json b/types/angular-dialog-service/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-dialog-service/tslint.json +++ b/types/angular-dialog-service/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-dynamic-locale/tslint.json b/types/angular-dynamic-locale/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-dynamic-locale/tslint.json +++ b/types/angular-dynamic-locale/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-environment/tslint.json b/types/angular-environment/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-environment/tslint.json +++ b/types/angular-environment/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-es/tslint.json b/types/angular-es/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-es/tslint.json +++ b/types/angular-es/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-feature-flags/tslint.json b/types/angular-feature-flags/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-feature-flags/tslint.json +++ b/types/angular-feature-flags/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-file-saver/tslint.json b/types/angular-file-saver/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-file-saver/tslint.json +++ b/types/angular-file-saver/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-formly/tslint.json b/types/angular-formly/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-formly/tslint.json +++ b/types/angular-formly/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-fullscreen/tslint.json b/types/angular-fullscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-fullscreen/tslint.json +++ b/types/angular-fullscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-gettext/tslint.json b/types/angular-gettext/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-gettext/tslint.json +++ b/types/angular-gettext/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-google-analytics/tslint.json b/types/angular-google-analytics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-google-analytics/tslint.json +++ b/types/angular-google-analytics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-growl-v2/tslint.json b/types/angular-growl-v2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-growl-v2/tslint.json +++ b/types/angular-growl-v2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-http-auth/tslint.json b/types/angular-http-auth/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-http-auth/tslint.json +++ b/types/angular-http-auth/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-httpi/tslint.json b/types/angular-httpi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-httpi/tslint.json +++ b/types/angular-httpi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-idle/tslint.json b/types/angular-idle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-idle/tslint.json +++ b/types/angular-idle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-jwt/tslint.json b/types/angular-jwt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-jwt/tslint.json +++ b/types/angular-jwt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-load/tslint.json b/types/angular-load/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-load/tslint.json +++ b/types/angular-load/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-loading-bar/tslint.json b/types/angular-loading-bar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-loading-bar/tslint.json +++ b/types/angular-loading-bar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-local-storage/tslint.json b/types/angular-local-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-local-storage/tslint.json +++ b/types/angular-local-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-localforage/tslint.json b/types/angular-localforage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-localforage/tslint.json +++ b/types/angular-localforage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-locker/tslint.json b/types/angular-locker/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-locker/tslint.json +++ b/types/angular-locker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-media-queries/tslint.json b/types/angular-media-queries/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-media-queries/tslint.json +++ b/types/angular-media-queries/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-meteor/tslint.json +++ b/types/angular-meteor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-modal/tslint.json b/types/angular-modal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-modal/tslint.json +++ b/types/angular-modal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-notifications/tslint.json b/types/angular-notifications/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-notifications/tslint.json +++ b/types/angular-notifications/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-notify/tslint.json b/types/angular-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-notify/tslint.json +++ b/types/angular-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-odata-resources/tslint.json b/types/angular-odata-resources/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-odata-resources/tslint.json +++ b/types/angular-odata-resources/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-permission/tslint.json b/types/angular-permission/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-permission/tslint.json +++ b/types/angular-permission/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-promise-tracker/tslint.json b/types/angular-promise-tracker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-promise-tracker/tslint.json +++ b/types/angular-promise-tracker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-q-spread/tslint.json b/types/angular-q-spread/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-q-spread/tslint.json +++ b/types/angular-q-spread/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-route/tslint.json b/types/angular-route/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-route/tslint.json +++ b/types/angular-route/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-sanitize/tslint.json b/types/angular-sanitize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-sanitize/tslint.json +++ b/types/angular-sanitize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-scenario/tslint.json b/types/angular-scenario/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-scenario/tslint.json +++ b/types/angular-scenario/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-scroll/tslint.json b/types/angular-scroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-scroll/tslint.json +++ b/types/angular-scroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-signalr-hub/tslint.json b/types/angular-signalr-hub/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-signalr-hub/tslint.json +++ b/types/angular-signalr-hub/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-spinner/tslint.json b/types/angular-spinner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-spinner/tslint.json +++ b/types/angular-spinner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-storage/tslint.json b/types/angular-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-storage/tslint.json +++ b/types/angular-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-toastr/tslint.json b/types/angular-toastr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-toastr/tslint.json +++ b/types/angular-toastr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-toasty/tslint.json b/types/angular-toasty/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-toasty/tslint.json +++ b/types/angular-toasty/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-translate/tslint.json b/types/angular-translate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-translate/tslint.json +++ b/types/angular-translate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-bootstrap/tslint.json b/types/angular-ui-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-bootstrap/tslint.json +++ b/types/angular-ui-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-notification/tslint.json b/types/angular-ui-notification/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-notification/tslint.json +++ b/types/angular-ui-notification/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-router/tslint.json b/types/angular-ui-router/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-router/tslint.json +++ b/types/angular-ui-router/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-scroll/tslint.json b/types/angular-ui-scroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-scroll/tslint.json +++ b/types/angular-ui-scroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-sortable/tslint.json b/types/angular-ui-sortable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-sortable/tslint.json +++ b/types/angular-ui-sortable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-tree/tslint.json b/types/angular-ui-tree/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-ui-tree/tslint.json +++ b/types/angular-ui-tree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-wizard/tslint.json +++ b/types/angular-wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-xeditable/tslint.json b/types/angular-xeditable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-xeditable/tslint.json +++ b/types/angular-xeditable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular.throttle/tslint.json b/types/angular.throttle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular.throttle/tslint.json +++ b/types/angular.throttle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angularfire/tslint.json b/types/angularfire/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angularfire/tslint.json +++ b/types/angularfire/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angularlocalstorage/tslint.json b/types/angularlocalstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angularlocalstorage/tslint.json +++ b/types/angularlocalstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angulartics/tslint.json b/types/angulartics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angulartics/tslint.json +++ b/types/angulartics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/animation-frame/tslint.json b/types/animation-frame/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/animation-frame/tslint.json +++ b/types/animation-frame/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ansi-styles/tslint.json b/types/ansi-styles/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ansi-styles/tslint.json +++ b/types/ansi-styles/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ansicolors/tslint.json b/types/ansicolors/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ansicolors/tslint.json +++ b/types/ansicolors/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/any-db-transaction/tslint.json b/types/any-db-transaction/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/any-db-transaction/tslint.json +++ b/types/any-db-transaction/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/any-db/tslint.json b/types/any-db/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/any-db/tslint.json +++ b/types/any-db/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aphrodite/tslint.json b/types/aphrodite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aphrodite/tslint.json +++ b/types/aphrodite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/api-error-handler/tslint.json b/types/api-error-handler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/api-error-handler/tslint.json +++ b/types/api-error-handler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/apigee-access/tslint.json b/types/apigee-access/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/apigee-access/tslint.json +++ b/types/apigee-access/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/app-root-path/tslint.json b/types/app-root-path/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/app-root-path/tslint.json +++ b/types/app-root-path/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/appframework/tslint.json b/types/appframework/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/appframework/tslint.json +++ b/types/appframework/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/appletvjs/tslint.json b/types/appletvjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/appletvjs/tslint.json +++ b/types/appletvjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arbiter/tslint.json b/types/arbiter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/arbiter/tslint.json +++ b/types/arbiter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arcgis-js-api/tslint.json b/types/arcgis-js-api/tslint.json index e3610fefae..89955128d5 100644 --- a/types/arcgis-js-api/tslint.json +++ b/types/arcgis-js-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index a9cafca24b..a25b018c11 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -41,6 +41,8 @@ declare namespace archiver { class ArchiverError extends Error { code: string; // Since archiver format support is modular, we cannot enumerate all possible error codes, as the modules can throw arbitrary ones. data: any; + path?: any; + constructor(code: string, data: any); } diff --git a/types/archy/tslint.json b/types/archy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/archy/tslint.json +++ b/types/archy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/argv/tslint.json b/types/argv/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/argv/tslint.json +++ b/types/argv/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/array-foreach/tslint.json b/types/array-foreach/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/array-foreach/tslint.json +++ b/types/array-foreach/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asana/tslint.json b/types/asana/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asana/tslint.json +++ b/types/asana/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asciify/tslint.json b/types/asciify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asciify/tslint.json +++ b/types/asciify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asn1js/tslint.json b/types/asn1js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asn1js/tslint.json +++ b/types/asn1js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aspnet-identity-pw/tslint.json b/types/aspnet-identity-pw/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aspnet-identity-pw/tslint.json +++ b/types/aspnet-identity-pw/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/assertsharp/tslint.json b/types/assertsharp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/assertsharp/tslint.json +++ b/types/assertsharp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/async-polling/tslint.json b/types/async-polling/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/async-polling/tslint.json +++ b/types/async-polling/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/async-writer/tslint.json b/types/async-writer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/async-writer/tslint.json +++ b/types/async-writer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/atmosphere.js/tslint.json b/types/atmosphere.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/atmosphere.js/tslint.json +++ b/types/atmosphere.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/atpl/tslint.json b/types/atpl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/atpl/tslint.json +++ b/types/atpl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0-angular/tslint.json b/types/auth0-angular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0-angular/tslint.json +++ b/types/auth0-angular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0.widget/tslint.json b/types/auth0.widget/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0.widget/tslint.json +++ b/types/auth0.widget/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0/tslint.json b/types/auth0/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0/tslint.json +++ b/types/auth0/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autolinker/tslint.json b/types/autolinker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/autolinker/tslint.json +++ b/types/autolinker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autoprefixer-core/tslint.json b/types/autoprefixer-core/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/autoprefixer-core/tslint.json +++ b/types/autoprefixer-core/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/avoscloud-sdk/tslint.json b/types/avoscloud-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/avoscloud-sdk/tslint.json +++ b/types/avoscloud-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aws-iot-device-sdk/tslint.json b/types/aws-iot-device-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aws-iot-device-sdk/tslint.json +++ b/types/aws-iot-device-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aws4/tslint.json b/types/aws4/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aws4/tslint.json +++ b/types/aws4/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/axel/tslint.json b/types/axel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/axel/tslint.json +++ b/types/axel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure-mobile-services-client/tslint.json b/types/azure-mobile-services-client/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure-mobile-services-client/tslint.json +++ b/types/azure-mobile-services-client/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure-sb/tslint.json b/types/azure-sb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure-sb/tslint.json +++ b/types/azure-sb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure/tslint.json b/types/azure/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure/tslint.json +++ b/types/azure/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/babelify/tslint.json b/types/babelify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/babelify/tslint.json +++ b/types/babelify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/babyparse/tslint.json b/types/babyparse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/babyparse/tslint.json +++ b/types/babyparse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-associations/tslint.json b/types/backbone-associations/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone-associations/tslint.json +++ b/types/backbone-associations/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-fetch-cache/tslint.json b/types/backbone-fetch-cache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone-fetch-cache/tslint.json +++ b/types/backbone-fetch-cache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-relational/tslint.json b/types/backbone-relational/tslint.json index 65e27fce52..fd5f6a3567 100644 --- a/types/backbone-relational/tslint.json +++ b/types/backbone-relational/tslint.json @@ -4,6 +4,7 @@ "array-type": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "jsdoc-format": false, "max-line-length": false, diff --git a/types/backbone.layoutmanager/tslint.json b/types/backbone.layoutmanager/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/backbone.layoutmanager/tslint.json +++ b/types/backbone.layoutmanager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.localstorage/tslint.json b/types/backbone.localstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.localstorage/tslint.json +++ b/types/backbone.localstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.paginator/tslint.json b/types/backbone.paginator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.paginator/tslint.json +++ b/types/backbone.paginator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.radio/tslint.json b/types/backbone.radio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.radio/tslint.json +++ b/types/backbone.radio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json index f5ae3a6788..ab605d9227 100644 --- a/types/backbone/tslint.json +++ b/types/backbone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "export-just-namespace": false, "interface-name": false, "jsdoc-format": false, diff --git a/types/backgrid/tslint.json b/types/backgrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backgrid/tslint.json +++ b/types/backgrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backlog-js/tslint.json b/types/backlog-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backlog-js/tslint.json +++ b/types/backlog-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/baconjs/tslint.json b/types/baconjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/baconjs/tslint.json +++ b/types/baconjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/baidumap-web-sdk/tslint.json b/types/baidumap-web-sdk/tslint.json index eccb336643..43797d8dd7 100644 --- a/types/baidumap-web-sdk/tslint.json +++ b/types/baidumap-web-sdk/tslint.json @@ -7,6 +7,7 @@ "ban-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "max-line-length": false, "member-access": false, diff --git a/types/barcode/tslint.json b/types/barcode/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/barcode/tslint.json +++ b/types/barcode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bardjs/tslint.json b/types/bardjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bardjs/tslint.json +++ b/types/bardjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/base16/tslint.json b/types/base16/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/base16/tslint.json +++ b/types/base16/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bases/tslint.json b/types/bases/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bases/tslint.json +++ b/types/bases/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/batch-stream/tslint.json b/types/batch-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/batch-stream/tslint.json +++ b/types/batch-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bazinga-translator/tslint.json b/types/bazinga-translator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bazinga-translator/tslint.json +++ b/types/bazinga-translator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcrypt-nodejs/tslint.json b/types/bcrypt-nodejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcrypt-nodejs/tslint.json +++ b/types/bcrypt-nodejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcrypt/tslint.json b/types/bcrypt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcrypt/tslint.json +++ b/types/bcrypt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcryptjs/tslint.json b/types/bcryptjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcryptjs/tslint.json +++ b/types/bcryptjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/benchmark/tslint.json b/types/benchmark/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/benchmark/tslint.json +++ b/types/benchmark/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/better-curry/tslint.json b/types/better-curry/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/better-curry/tslint.json +++ b/types/better-curry/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bezier-js/tslint.json b/types/bezier-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bezier-js/tslint.json +++ b/types/bezier-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bgiframe/tslint.json b/types/bgiframe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bgiframe/tslint.json +++ b/types/bgiframe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bigint/tslint.json b/types/bigint/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bigint/tslint.json +++ b/types/bigint/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bignum/tslint.json b/types/bignum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bignum/tslint.json +++ b/types/bignum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bigscreen/tslint.json b/types/bigscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bigscreen/tslint.json +++ b/types/bigscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bind-ponyfill/tslint.json b/types/bind-ponyfill/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bind-ponyfill/tslint.json +++ b/types/bind-ponyfill/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bintrees/tslint.json b/types/bintrees/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bintrees/tslint.json +++ b/types/bintrees/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bip21/tslint.json b/types/bip21/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bip21/tslint.json +++ b/types/bip21/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bit-array/tslint.json b/types/bit-array/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bit-array/tslint.json +++ b/types/bit-array/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bl/tslint.json b/types/bl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bl/tslint.json +++ b/types/bl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blazy/tslint.json b/types/blazy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blazy/tslint.json +++ b/types/blazy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bleno/tslint.json b/types/bleno/tslint.json index 0f5eeaf557..d895c355d8 100644 --- a/types/bleno/tslint.json +++ b/types/bleno/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "dt-header": false, + "npm-naming": false, "unified-signatures": false } } diff --git a/types/blessed/tslint.json b/types/blessed/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blessed/tslint.json +++ b/types/blessed/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blissfuljs/tslint.json b/types/blissfuljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blissfuljs/tslint.json +++ b/types/blissfuljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blob-stream/tslint.json b/types/blob-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blob-stream/tslint.json +++ b/types/blob-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blocks/tslint.json b/types/blocks/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blocks/tslint.json +++ b/types/blocks/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blue-tape/tslint.json b/types/blue-tape/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blue-tape/tslint.json +++ b/types/blue-tape/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blueimp-md5/tslint.json b/types/blueimp-md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blueimp-md5/tslint.json +++ b/types/blueimp-md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bookshelf/tslint.json b/types/bookshelf/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/bookshelf/tslint.json +++ b/types/bookshelf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/boolify-string/tslint.json b/types/boolify-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/boolify-string/tslint.json +++ b/types/boolify-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootbox/tslint.json b/types/bootbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootbox/tslint.json +++ b/types/bootbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootpag/tslint.json b/types/bootpag/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootpag/tslint.json +++ b/types/bootpag/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-datepicker/tslint.json b/types/bootstrap-datepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-datepicker/tslint.json +++ b/types/bootstrap-datepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-fileinput/tslint.json b/types/bootstrap-fileinput/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-fileinput/tslint.json +++ b/types/bootstrap-fileinput/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-maxlength/tslint.json b/types/bootstrap-maxlength/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-maxlength/tslint.json +++ b/types/bootstrap-maxlength/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-notify/tslint.json b/types/bootstrap-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-notify/tslint.json +++ b/types/bootstrap-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-select/tslint.json b/types/bootstrap-select/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-select/tslint.json +++ b/types/bootstrap-select/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-switch/tslint.json b/types/bootstrap-switch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-switch/tslint.json +++ b/types/bootstrap-switch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-table/tslint.json b/types/bootstrap-table/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-table/tslint.json +++ b/types/bootstrap-table/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-touchspin/tslint.json b/types/bootstrap-touchspin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-touchspin/tslint.json +++ b/types/bootstrap-touchspin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap.paginator/tslint.json b/types/bootstrap.paginator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap.paginator/tslint.json +++ b/types/bootstrap.paginator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap.timepicker/tslint.json b/types/bootstrap.timepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap.timepicker/tslint.json +++ b/types/bootstrap.timepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bounce.js/tslint.json b/types/bounce.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bounce.js/tslint.json +++ b/types/bounce.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/box2d/tslint.json b/types/box2d/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/box2d/tslint.json +++ b/types/box2d/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/braintree-web/tslint.json b/types/braintree-web/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/braintree-web/tslint.json +++ b/types/braintree-web/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/breeze/tslint.json b/types/breeze/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/breeze/tslint.json +++ b/types/breeze/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/brorand/tslint.json b/types/brorand/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/brorand/tslint.json +++ b/types/brorand/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-harness/tslint.json b/types/browser-harness/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-harness/tslint.json +++ b/types/browser-harness/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-pack/tslint.json b/types/browser-pack/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-pack/tslint.json +++ b/types/browser-pack/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-report/tslint.json b/types/browser-report/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-report/tslint.json +++ b/types/browser-report/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-resolve/tslint.json b/types/browser-resolve/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-resolve/tslint.json +++ b/types/browser-resolve/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-sync/tslint.json b/types/browser-sync/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-sync/tslint.json +++ b/types/browser-sync/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browserify/tslint.json b/types/browserify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browserify/tslint.json +++ b/types/browserify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bson/tslint.json b/types/bson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bson/tslint.json +++ b/types/bson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bucks/tslint.json b/types/bucks/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bucks/tslint.json +++ b/types/bucks/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffer-compare/tslint.json b/types/buffer-compare/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffer-compare/tslint.json +++ b/types/buffer-compare/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffer-equal/tslint.json b/types/buffer-equal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffer-equal/tslint.json +++ b/types/buffer-equal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffers/tslint.json b/types/buffers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffers/tslint.json +++ b/types/buffers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 5297eadb19..07de38e05d 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -13,6 +13,7 @@ // Dan Manastireanu // Kjell-Morten Bratsberg Thorsen // Christian D. +// Silas Rech // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -114,6 +115,9 @@ declare namespace Bull { type JobId = number | string; + type ProcessCallbackFunction = (job: Job, done: DoneCallback) => void; + type ProcessPromiseFunction = (job: Job) => Promise; + interface Job { id: JobId; @@ -397,6 +401,8 @@ declare namespace Bull { */ isReady(): Promise; + /* tslint:disable:unified-signatures */ + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -414,7 +420,9 @@ declare namespace Bull { * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. */ - process(callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(callback: ProcessCallbackFunction): void; + process(callback: ProcessPromiseFunction): void; + process(callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -435,7 +443,9 @@ declare namespace Bull { * * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(concurrency: number, callback: ProcessCallbackFunction): void; + process(concurrency: number, callback: ProcessPromiseFunction): void; + process(concurrency: number, callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -456,8 +466,9 @@ declare namespace Bull { * * @param name Bull will only call the handler if the job name matches */ - // tslint:disable-next-line:unified-signatures - process(name: string, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(name: string, callback: ProcessCallbackFunction): void; + process(name: string, callback: ProcessPromiseFunction): void; + process(name: string, callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -479,7 +490,11 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(name: string, concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(name: string, concurrency: number, callback: ProcessCallbackFunction): void; + process(name: string, concurrency: number, callback: ProcessPromiseFunction): void; + process(name: string, concurrency: number, callback: string): void; + + /* tslint:enable:unified-signatures */ /** * Creates a new job and adds it to the queue. @@ -598,7 +613,7 @@ declare namespace Bull { * Returns a promise that will return an array of job instances of the given types. * Optional parameters for range and ordering are provided. */ - getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise; + getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise>>; /** * Returns a promise that resolves with the job counts for the given queue. diff --git a/types/bunyan-config/tslint.json b/types/bunyan-config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-config/tslint.json +++ b/types/bunyan-config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-logentries/tslint.json b/types/bunyan-logentries/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-logentries/tslint.json +++ b/types/bunyan-logentries/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-prettystream/tslint.json b/types/bunyan-prettystream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-prettystream/tslint.json +++ b/types/bunyan-prettystream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/busboy/tslint.json b/types/busboy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/busboy/tslint.json +++ b/types/busboy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/business-rules-engine/tslint.json b/types/business-rules-engine/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/business-rules-engine/tslint.json +++ b/types/business-rules-engine/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bwip-js/tslint.json b/types/bwip-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bwip-js/tslint.json +++ b/types/bwip-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/byline/tslint.json b/types/byline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/byline/tslint.json +++ b/types/byline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bytebuffer/tslint.json b/types/bytebuffer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bytebuffer/tslint.json +++ b/types/bytebuffer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cache-manager/tslint.json b/types/cache-manager/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cache-manager/tslint.json +++ b/types/cache-manager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cal-heatmap/tslint.json b/types/cal-heatmap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cal-heatmap/tslint.json +++ b/types/cal-heatmap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/callsite/tslint.json b/types/callsite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/callsite/tslint.json +++ b/types/callsite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/calq/tslint.json b/types/calq/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/calq/tslint.json +++ b/types/calq/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/camljs/tslint.json b/types/camljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/camljs/tslint.json +++ b/types/camljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/camo/tslint.json b/types/camo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/camo/tslint.json +++ b/types/camo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cannon/tslint.json b/types/cannon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cannon/tslint.json +++ b/types/cannon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/canvas-gauges/tslint.json b/types/canvas-gauges/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/canvas-gauges/tslint.json +++ b/types/canvas-gauges/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cash/tslint.json b/types/cash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cash/tslint.json +++ b/types/cash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cbor/tslint.json b/types/cbor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cbor/tslint.json +++ b/types/cbor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-as-promised/tslint.json b/types/chai-as-promised/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-as-promised/tslint.json +++ b/types/chai-as-promised/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-datetime/tslint.json b/types/chai-datetime/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-datetime/tslint.json +++ b/types/chai-datetime/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-dom/tslint.json b/types/chai-dom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-dom/tslint.json +++ b/types/chai-dom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-enzyme/tslint.json b/types/chai-enzyme/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-enzyme/tslint.json +++ b/types/chai-enzyme/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-fuzzy/tslint.json b/types/chai-fuzzy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-fuzzy/tslint.json +++ b/types/chai-fuzzy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-jquery/tslint.json b/types/chai-jquery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-jquery/tslint.json +++ b/types/chai-jquery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-spies/tslint.json b/types/chai-spies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-spies/tslint.json +++ b/types/chai-spies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-string/tslint.json b/types/chai-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-string/tslint.json +++ b/types/chai-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-things/tslint.json b/types/chai-things/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-things/tslint.json +++ b/types/chai-things/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chance/tslint.json b/types/chance/tslint.json index 2ef6444ebb..a2a331133e 100644 --- a/types/chance/tslint.json +++ b/types/chance/tslint.json @@ -3,6 +3,7 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, + "npm-naming": false, "no-declare-current-package": false, "no-single-declare-module": false, "no-unnecessary-generics": false, diff --git a/types/change-emitter/tslint.json b/types/change-emitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/change-emitter/tslint.json +++ b/types/change-emitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 5a3116618d..8fa3a42ef9 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -512,7 +512,7 @@ declare namespace Chart { hoverBorderWidth?: number | number[]; label?: string; lineTension?: number; - steppedLine?: 'before' | 'after' | boolean; + steppedLine?: 'before' | 'after' | 'middle' | boolean; pointBorderColor?: ChartColor | ChartColor[]; pointBackgroundColor?: ChartColor | ChartColor[]; pointBorderWidth?: number | number[]; diff --git a/types/chartist/tslint.json b/types/chartist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chartist/tslint.json +++ b/types/chartist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/checksum/tslint.json b/types/checksum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/checksum/tslint.json +++ b/types/checksum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cheerio/tslint.json b/types/cheerio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cheerio/tslint.json +++ b/types/cheerio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/child-process-promise/child-process-promise-tests.ts b/types/child-process-promise/child-process-promise-tests.ts new file mode 100644 index 0000000000..365e7e8f60 --- /dev/null +++ b/types/child-process-promise/child-process-promise-tests.ts @@ -0,0 +1,15 @@ +import * as cpp from "child-process-promise"; + +import { + ChildProcess +} from 'child_process'; + +const a = cpp.exec("echo \"Hello world!\""); +a.childProcess; // $ExpectType ChildProcess + +(async () => { + const at = await a; + at.childProcess; // $ExpectType ChildProcess + at.stdout; // $ExpectType string + at.stderr; // $ExpectType string +})(); diff --git a/types/child-process-promise/index.d.ts b/types/child-process-promise/index.d.ts new file mode 100644 index 0000000000..344657f4f1 --- /dev/null +++ b/types/child-process-promise/index.d.ts @@ -0,0 +1,104 @@ +// Type definitions for child-process-promise 2.2 +// Project: https://github.com/patrick-steele-idem/child-process-promise +// Definitions by: Luis Paulo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import { + ChildProcess, + ExecFileOptionsWithBufferEncoding, ExecFileOptionsWithOtherEncoding, + ExecFileOptionsWithStringEncoding, + ExecOptions, + ForkOptions, + SpawnOptions +} from 'child_process'; + +/** + * Simple wrapper around the child_process module that makes use of promises + */ + +export interface PromiseResult { + childProcess: ChildProcess; + stdout: Enc; + stderr: Enc; +} + +export interface SpawnPromiseResult extends PromiseResult { + code: number; +} + +export interface ChildProcessPromise extends Promise { + childProcess: ChildProcess; +} + +export interface Options { + /** + * Pass an additional capture option to buffer the result of stdout and/or stderr + * Default: [] + */ + capture?: []|['stdout'|'stderr']|['stdout', 'stderr']|['stderr', 'stdout']; + /** + * Array of the numbers that should be interpreted as successful execution codes + * Default: [0] + */ + successfulExitCodes?: number[]; +} + +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options?: Readonly +): ChildProcessPromise>; + +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args: ReadonlyArray | null, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args: ReadonlyArray | null, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args?: ReadonlyArray | null, + options?: Readonly +): ChildProcessPromise>; + +export function spawn( + command: Readonly, + args?: ReadonlyArray | null, + options?: Readonly +): ChildProcessPromise; + +export function fork( + modulePath: string, + args?: ReadonlyArray, + options?: Readonly +): ChildProcessPromise; diff --git a/types/child-process-promise/tsconfig.json b/types/child-process-promise/tsconfig.json new file mode 100644 index 0000000000..b0f60c39eb --- /dev/null +++ b/types/child-process-promise/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", + "child-process-promise-tests.ts" + ] +} diff --git a/types/child-process-promise/tslint.json b/types/child-process-promise/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/child-process-promise/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chocolatechipjs/tslint.json b/types/chocolatechipjs/tslint.json index 9969e961d1..c5bc46f555 100644 --- a/types/chocolatechipjs/tslint.json +++ b/types/chocolatechipjs/tslint.json @@ -5,6 +5,7 @@ "adjacent-overload-signatures": false, "ban-types": false, "dt-header": false, + "npm-naming": false, "no-any-union": false, "unified-signatures": false, "no-unnecessary-generics": false, diff --git a/types/chrome-apps/tslint.json b/types/chrome-apps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chrome-apps/tslint.json +++ b/types/chrome-apps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chrome/tslint.json b/types/chrome/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/chrome/tslint.json +++ b/types/chrome/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chui/tslint.json b/types/chui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chui/tslint.json +++ b/types/chui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cldrjs/tslint.json b/types/cldrjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cldrjs/tslint.json +++ b/types/cldrjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cli-color/tslint.json b/types/cli-color/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cli-color/tslint.json +++ b/types/cli-color/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cli/tslint.json b/types/cli/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cli/tslint.json +++ b/types/cli/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cliff/tslint.json b/types/cliff/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cliff/tslint.json +++ b/types/cliff/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clipboard-js/tslint.json b/types/clipboard-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/clipboard-js/tslint.json +++ b/types/clipboard-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clone/tslint.json b/types/clone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/clone/tslint.json +++ b/types/clone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/closure-compiler/tslint.json b/types/closure-compiler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/closure-compiler/tslint.json +++ b/types/closure-compiler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cloud-env/tslint.json b/types/cloud-env/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cloud-env/tslint.json +++ b/types/cloud-env/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/co-body/tslint.json b/types/co-body/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/co-body/tslint.json +++ b/types/co-body/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/codemirror/tslint.json b/types/codemirror/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/codemirror/tslint.json +++ b/types/codemirror/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/coffeeify/tslint.json b/types/coffeeify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/coffeeify/tslint.json +++ b/types/coffeeify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/collections/tslint.json b/types/collections/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/collections/tslint.json +++ b/types/collections/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/colorbrewer/tslint.json b/types/colorbrewer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/colorbrewer/tslint.json +++ b/types/colorbrewer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/com.darktalker.cordova.screenshot/tslint.json b/types/com.darktalker.cordova.screenshot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/com.darktalker.cordova.screenshot/tslint.json +++ b/types/com.darktalker.cordova.screenshot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/combokeys/tslint.json b/types/combokeys/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/combokeys/tslint.json +++ b/types/combokeys/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/command-line-commands/tslint.json b/types/command-line-commands/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/command-line-commands/tslint.json +++ b/types/command-line-commands/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/commangular/tslint.json b/types/commangular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/commangular/tslint.json +++ b/types/commangular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compare-version/tslint.json b/types/compare-version/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compare-version/tslint.json +++ b/types/compare-version/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/component-emitter/tslint.json b/types/component-emitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/component-emitter/tslint.json +++ b/types/component-emitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compose-function/tslint.json b/types/compose-function/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compose-function/tslint.json +++ b/types/compose-function/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compression/tslint.json b/types/compression/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compression/tslint.json +++ b/types/compression/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/concaveman/tslint.json b/types/concaveman/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/concaveman/tslint.json +++ b/types/concaveman/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/confidence/tslint.json b/types/confidence/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/confidence/tslint.json +++ b/types/confidence/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/config/tslint.json b/types/config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/config/tslint.json +++ b/types/config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/confit/tslint.json b/types/confit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/confit/tslint.json +++ b/types/confit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-flash/tslint.json b/types/connect-flash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-flash/tslint.json +++ b/types/connect-flash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-livereload/tslint.json b/types/connect-livereload/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-livereload/tslint.json +++ b/types/connect-livereload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-modrewrite/tslint.json b/types/connect-modrewrite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-modrewrite/tslint.json +++ b/types/connect-modrewrite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-mongo/tslint.json b/types/connect-mongo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-mongo/tslint.json +++ b/types/connect-mongo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-mongodb-session/tslint.json b/types/connect-mongodb-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-mongodb-session/tslint.json +++ b/types/connect-mongodb-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-redis/tslint.json b/types/connect-redis/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-redis/tslint.json +++ b/types/connect-redis/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-slashes/tslint.json b/types/connect-slashes/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-slashes/tslint.json +++ b/types/connect-slashes/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-timeout/tslint.json b/types/connect-timeout/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-timeout/tslint.json +++ b/types/connect-timeout/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect/tslint.json b/types/connect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect/tslint.json +++ b/types/connect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/console-stamp/tslint.json b/types/console-stamp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/console-stamp/tslint.json +++ b/types/console-stamp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a403f5da2b..69c84d8f83 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -9,6 +9,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/consul/tslint.json b/types/consul/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/consul/tslint.json +++ b/types/consul/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/contentful-resolve-response/tslint.json b/types/contentful-resolve-response/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/contentful-resolve-response/tslint.json +++ b/types/contentful-resolve-response/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/contextjs/tslint.json b/types/contextjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/contextjs/tslint.json +++ b/types/contextjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cookie-session/tslint.json b/types/cookie-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cookie-session/tslint.json +++ b/types/cookie-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cookie_js/tslint.json b/types/cookie_js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cookie_js/tslint.json +++ b/types/cookie_js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/copy-paste/tslint.json b/types/copy-paste/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/copy-paste/tslint.json +++ b/types/copy-paste/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-ionic/tslint.json b/types/cordova-ionic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-ionic/tslint.json +++ b/types/cordova-ionic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-app-version/tslint.json b/types/cordova-plugin-app-version/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-app-version/tslint.json +++ b/types/cordova-plugin-app-version/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-background-mode/tslint.json b/types/cordova-plugin-background-mode/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-background-mode/tslint.json +++ b/types/cordova-plugin-background-mode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ble-central/tslint.json b/types/cordova-plugin-ble-central/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ble-central/tslint.json +++ b/types/cordova-plugin-ble-central/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-device-name/tslint.json b/types/cordova-plugin-device-name/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-device-name/tslint.json +++ b/types/cordova-plugin-device-name/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-email-composer/tslint.json b/types/cordova-plugin-email-composer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-email-composer/tslint.json +++ b/types/cordova-plugin-email-composer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ibeacon/tslint.json b/types/cordova-plugin-ibeacon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ibeacon/tslint.json +++ b/types/cordova-plugin-ibeacon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-insomnia/tslint.json b/types/cordova-plugin-insomnia/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-insomnia/tslint.json +++ b/types/cordova-plugin-insomnia/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-keyboard/tslint.json b/types/cordova-plugin-keyboard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-keyboard/tslint.json +++ b/types/cordova-plugin-keyboard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-mapsforge/tslint.json b/types/cordova-plugin-mapsforge/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-mapsforge/tslint.json +++ b/types/cordova-plugin-mapsforge/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ms-adal/tslint.json b/types/cordova-plugin-ms-adal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ms-adal/tslint.json +++ b/types/cordova-plugin-ms-adal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ouralabs/tslint.json b/types/cordova-plugin-ouralabs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ouralabs/tslint.json +++ b/types/cordova-plugin-ouralabs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-qrscanner/tslint.json b/types/cordova-plugin-qrscanner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-qrscanner/tslint.json +++ b/types/cordova-plugin-qrscanner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-spinner/tslint.json b/types/cordova-plugin-spinner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-spinner/tslint.json +++ b/types/cordova-plugin-spinner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-websql/tslint.json b/types/cordova-plugin-websql/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-websql/tslint.json +++ b/types/cordova-plugin-websql/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-x-socialsharing/tslint.json b/types/cordova-plugin-x-socialsharing/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-x-socialsharing/tslint.json +++ b/types/cordova-plugin-x-socialsharing/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova/tslint.json b/types/cordova/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/cordova/tslint.json +++ b/types/cordova/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova_app_version_plugin/tslint.json b/types/cordova_app_version_plugin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova_app_version_plugin/tslint.json +++ b/types/cordova_app_version_plugin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordovarduino/tslint.json b/types/cordovarduino/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordovarduino/tslint.json +++ b/types/cordovarduino/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cors/tslint.json b/types/cors/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cors/tslint.json +++ b/types/cors/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/couchbase/tslint.json b/types/couchbase/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/couchbase/tslint.json +++ b/types/couchbase/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/countdown/tslint.json b/types/countdown/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/countdown/tslint.json +++ b/types/countdown/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cradle/tslint.json b/types/cradle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cradle/tslint.json +++ b/types/cradle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/create-error/tslint.json b/types/create-error/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/create-error/tslint.json +++ b/types/create-error/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/createjs-lib/tslint.json b/types/createjs-lib/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/createjs-lib/tslint.json +++ b/types/createjs-lib/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/createjs/tslint.json b/types/createjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/createjs/tslint.json +++ b/types/createjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/credential/tslint.json b/types/credential/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/credential/tslint.json +++ b/types/credential/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/credit-card-type/tslint.json b/types/credit-card-type/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/credit-card-type/tslint.json +++ b/types/credit-card-type/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cron/tslint.json b/types/cron/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cron/tslint.json +++ b/types/cron/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cross-storage/tslint.json b/types/cross-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cross-storage/tslint.json +++ b/types/cross-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crossfilter/tslint.json b/types/crossfilter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crossfilter/tslint.json +++ b/types/crossfilter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crossroads/tslint.json b/types/crossroads/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crossroads/tslint.json +++ b/types/crossroads/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crypto-js/tslint.json b/types/crypto-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crypto-js/tslint.json +++ b/types/crypto-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cryptojs/tslint.json b/types/cryptojs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cryptojs/tslint.json +++ b/types/cryptojs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cson/tslint.json b/types/cson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cson/tslint.json +++ b/types/cson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/css-modules-require-hook/tslint.json b/types/css-modules-require-hook/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/css-modules-require-hook/tslint.json +++ b/types/css-modules-require-hook/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/css/tslint.json b/types/css/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/css/tslint.json +++ b/types/css/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cssbeautify/tslint.json b/types/cssbeautify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cssbeautify/tslint.json +++ b/types/cssbeautify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/csurf/tslint.json b/types/csurf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/csurf/tslint.json +++ b/types/csurf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cuid/tslint.json b/types/cuid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cuid/tslint.json +++ b/types/cuid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/custom-error-generator/tslint.json b/types/custom-error-generator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/custom-error-generator/tslint.json +++ b/types/custom-error-generator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cybozulabs-md5/tslint.json b/types/cybozulabs-md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cybozulabs-md5/tslint.json +++ b/types/cybozulabs-md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-box/tslint.json b/types/d3-box/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-box/tslint.json +++ b/types/d3-box/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-cloud/tslint.json b/types/d3-cloud/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-cloud/tslint.json +++ b/types/d3-cloud/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-tip/tslint.json b/types/d3-tip/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-tip/tslint.json +++ b/types/d3-tip/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3.slider/tslint.json b/types/d3.slider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3.slider/tslint.json +++ b/types/d3.slider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3pie/tslint.json b/types/d3pie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3pie/tslint.json +++ b/types/d3pie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dat.gui/tslint.json b/types/dat.gui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dat.gui/tslint.json +++ b/types/dat.gui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/data-driven/tslint.json b/types/data-driven/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/data-driven/tslint.json +++ b/types/data-driven/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/date-arithmetic/tslint.json b/types/date-arithmetic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/date-arithmetic/tslint.json +++ b/types/date-arithmetic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/date.format.js/tslint.json b/types/date.format.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/date.format.js/tslint.json +++ b/types/date.format.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/datejs/tslint.json b/types/datejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/datejs/tslint.json +++ b/types/datejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/db-migrate-base/tslint.json b/types/db-migrate-base/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/db-migrate-base/tslint.json +++ b/types/db-migrate-base/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/db-migrate-pg/tslint.json b/types/db-migrate-pg/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/db-migrate-pg/tslint.json +++ b/types/db-migrate-pg/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/db.js/tslint.json b/types/db.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/db.js/tslint.json +++ b/types/db.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dc/tslint.json b/types/dc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dc/tslint.json +++ b/types/dc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/decorum/tslint.json b/types/decorum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/decorum/tslint.json +++ b/types/decorum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/defaults/tslint.json b/types/defaults/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/defaults/tslint.json +++ b/types/defaults/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/deku/tslint.json b/types/deku/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/deku/tslint.json +++ b/types/deku/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/denodeify/tslint.json b/types/denodeify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/denodeify/tslint.json +++ b/types/denodeify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/deoxxa-content-type/tslint.json b/types/deoxxa-content-type/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/deoxxa-content-type/tslint.json +++ b/types/deoxxa-content-type/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/deployjava/tslint.json b/types/deployjava/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/deployjava/tslint.json +++ b/types/deployjava/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/devexpress-web/tslint.json b/types/devexpress-web/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/devexpress-web/tslint.json +++ b/types/devexpress-web/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/devtools-detect/tslint.json b/types/devtools-detect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/devtools-detect/tslint.json +++ b/types/devtools-detect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/df-visible/tslint.json b/types/df-visible/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/df-visible/tslint.json +++ b/types/df-visible/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dhtmlxgantt/tslint.json b/types/dhtmlxgantt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dhtmlxgantt/tslint.json +++ b/types/dhtmlxgantt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dhtmlxscheduler/tslint.json b/types/dhtmlxscheduler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dhtmlxscheduler/tslint.json +++ b/types/dhtmlxscheduler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/di-lite/tslint.json b/types/di-lite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/di-lite/tslint.json +++ b/types/di-lite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/diff/index.d.ts b/types/diff/index.d.ts index 5afb72192e..08ac3c3171 100644 --- a/types/diff/index.d.ts +++ b/types/diff/index.d.ts @@ -142,6 +142,7 @@ export interface Hunk { newStart: number; newLines: number; lines: string[]; + linedelimiters: string[]; } export interface BestPath { diff --git a/types/diff2html/tslint.json b/types/diff2html/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/diff2html/tslint.json +++ b/types/diff2html/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/disposable-email-domains/tslint.json b/types/disposable-email-domains/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/disposable-email-domains/tslint.json +++ b/types/disposable-email-domains/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/doccookies/tslint.json b/types/doccookies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/doccookies/tslint.json +++ b/types/doccookies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dock-spawn/tslint.json b/types/dock-spawn/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dock-spawn/tslint.json +++ b/types/dock-spawn/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/docopt/tslint.json b/types/docopt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/docopt/tslint.json +++ b/types/docopt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/doctrine/tslint.json b/types/doctrine/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/doctrine/tslint.json +++ b/types/doctrine/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/documentdb-server/tslint.json b/types/documentdb-server/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/documentdb-server/tslint.json +++ b/types/documentdb-server/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dojo/tslint.json b/types/dojo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dojo/tslint.json +++ b/types/dojo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dom4/tslint.json b/types/dom4/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dom4/tslint.json +++ b/types/dom4/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/domo/tslint.json b/types/domo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/domo/tslint.json +++ b/types/domo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dompurify/tslint.json b/types/dompurify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dompurify/tslint.json +++ b/types/dompurify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/domurl/tslint.json b/types/domurl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/domurl/tslint.json +++ b/types/domurl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/donna/tslint.json b/types/donna/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/donna/tslint.json +++ b/types/donna/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dotdotdot/tslint.json b/types/dotdotdot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dotdotdot/tslint.json +++ b/types/dotdotdot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/doublearray/tslint.json b/types/doublearray/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/doublearray/tslint.json +++ b/types/doublearray/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/draft-js/tslint.json b/types/draft-js/tslint.json index e3610fefae..89955128d5 100644 --- a/types/draft-js/tslint.json +++ b/types/draft-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dragula/tslint.json b/types/dragula/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dragula/tslint.json +++ b/types/dragula/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dropboxjs/tslint.json b/types/dropboxjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dropboxjs/tslint.json +++ b/types/dropboxjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dropzone/tslint.json b/types/dropzone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dropzone/tslint.json +++ b/types/dropzone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dsv/tslint.json b/types/dsv/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dsv/tslint.json +++ b/types/dsv/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dts-bundle/tslint.json b/types/dts-bundle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dts-bundle/tslint.json +++ b/types/dts-bundle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/durandal/tslint.json b/types/durandal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/durandal/tslint.json +++ b/types/durandal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dustjs-linkedin/tslint.json b/types/dustjs-linkedin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dustjs-linkedin/tslint.json +++ b/types/dustjs-linkedin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dvtng-jss/tslint.json b/types/dvtng-jss/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dvtng-jss/tslint.json +++ b/types/dvtng-jss/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dw-bxslider-4/tslint.json b/types/dw-bxslider-4/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dw-bxslider-4/tslint.json +++ b/types/dw-bxslider-4/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dygraphs/tslint.json b/types/dygraphs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dygraphs/tslint.json +++ b/types/dygraphs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dymo-label-framework/tslint.json b/types/dymo-label-framework/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dymo-label-framework/tslint.json +++ b/types/dymo-label-framework/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dynatable/tslint.json b/types/dynatable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dynatable/tslint.json +++ b/types/dynatable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/each/tslint.json b/types/each/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/each/tslint.json +++ b/types/each/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easeljs/tslint.json b/types/easeljs/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/easeljs/tslint.json +++ b/types/easeljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easy-api-request/tslint.json b/types/easy-api-request/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/easy-api-request/tslint.json +++ b/types/easy-api-request/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easy-jsend/tslint.json b/types/easy-jsend/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/easy-jsend/tslint.json +++ b/types/easy-jsend/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easy-session/tslint.json b/types/easy-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/easy-session/tslint.json +++ b/types/easy-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easy-table/tslint.json b/types/easy-table/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/easy-table/tslint.json +++ b/types/easy-table/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easy-xapi-utils/tslint.json b/types/easy-xapi-utils/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/easy-xapi-utils/tslint.json +++ b/types/easy-xapi-utils/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/easy-xapi/tslint.json b/types/easy-xapi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/easy-xapi/tslint.json +++ b/types/easy-xapi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index 41b3fe801f..ca93cc10ac 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -972,17 +972,21 @@ declare namespace echarts { sublink?: string, subtarget?: string, subtextStyle?: object, + textAlign?: string, + textVerticalAlign?: string, + triggerEvent?: boolean, padding?: number, itemGap?: number, zlevel?: number, z?: number, - left?: string, - top?: string, - right?: string, - bottom?: string, + left?: string | number, + top?: string | number, + right?: string | number, + bottom?: string | number, backgroundColor?: string, borderColor?: string, borderWidth?: number, + borderRadius?: number | number[], shadowBlur?: number, shadowColor?: number, shadowOffsetX?: number, diff --git a/types/echarts/tslint.json b/types/echarts/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/echarts/tslint.json +++ b/types/echarts/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/egg.js/tslint.json b/types/egg.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/egg.js/tslint.json +++ b/types/egg.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ejs-locals/tslint.json b/types/ejs-locals/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ejs-locals/tslint.json +++ b/types/ejs-locals/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ejson/tslint.json b/types/ejson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ejson/tslint.json +++ b/types/ejson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/elastic.js/tslint.json b/types/elastic.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/elastic.js/tslint.json +++ b/types/elastic.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/electron-debug/tslint.json b/types/electron-debug/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/electron-debug/tslint.json +++ b/types/electron-debug/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/electron-devtools-installer/tslint.json b/types/electron-devtools-installer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/electron-devtools-installer/tslint.json +++ b/types/electron-devtools-installer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/electron-notifications/tslint.json b/types/electron-notifications/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/electron-notifications/tslint.json +++ b/types/electron-notifications/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/electron-notify/tslint.json b/types/electron-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/electron-notify/tslint.json +++ b/types/electron-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/electron-window-state/tslint.json b/types/electron-window-state/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/electron-window-state/tslint.json +++ b/types/electron-window-state/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/element-resize-event/tslint.json b/types/element-resize-event/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/element-resize-event/tslint.json +++ b/types/element-resize-event/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/elm/tslint.json b/types/elm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/elm/tslint.json +++ b/types/elm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ember-testing-helpers/tslint.json b/types/ember-testing-helpers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ember-testing-helpers/tslint.json +++ b/types/ember-testing-helpers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/emissary/tslint.json b/types/emissary/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/emissary/tslint.json +++ b/types/emissary/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/empower/tslint.json b/types/empower/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/empower/tslint.json +++ b/types/empower/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/emscripten/tslint.json b/types/emscripten/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/emscripten/tslint.json +++ b/types/emscripten/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/encoding-japanese/tslint.json b/types/encoding-japanese/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/encoding-japanese/tslint.json +++ b/types/encoding-japanese/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/enhanced-resolve/tslint.json b/types/enhanced-resolve/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/enhanced-resolve/tslint.json +++ b/types/enhanced-resolve/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ent/tslint.json b/types/ent/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ent/tslint.json +++ b/types/ent/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/envify/tslint.json b/types/envify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/envify/tslint.json +++ b/types/envify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/enzyme/tslint.json b/types/enzyme/tslint.json index 67c3be0ed0..a5f1f5a4c3 100644 --- a/types/enzyme/tslint.json +++ b/types/enzyme/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-duplicate-imports": false, "no-unnecessary-generics": false } diff --git a/types/eonasdan-bootstrap-datetimepicker/tslint.json b/types/eonasdan-bootstrap-datetimepicker/tslint.json index b6afb8acee..4017299a0e 100644 --- a/types/eonasdan-bootstrap-datetimepicker/tslint.json +++ b/types/eonasdan-bootstrap-datetimepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/epiceditor/tslint.json b/types/epiceditor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/epiceditor/tslint.json +++ b/types/epiceditor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/epub/tslint.json b/types/epub/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/epub/tslint.json +++ b/types/epub/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/eq.js/tslint.json b/types/eq.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/eq.js/tslint.json +++ b/types/eq.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/errorhandler/tslint.json b/types/errorhandler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/errorhandler/tslint.json +++ b/types/errorhandler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/es6-collections/tslint.json b/types/es6-collections/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/es6-collections/tslint.json +++ b/types/es6-collections/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/es6-shim/tslint.json b/types/es6-shim/tslint.json index 637071b426..592fc9bcaa 100644 --- a/types/es6-shim/tslint.json +++ b/types/es6-shim/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/escape-html/tslint.json b/types/escape-html/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/escape-html/tslint.json +++ b/types/escape-html/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/escape-latex/tslint.json b/types/escape-latex/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/escape-latex/tslint.json +++ b/types/escape-latex/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/escape-string-regexp/tslint.json b/types/escape-string-regexp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/escape-string-regexp/tslint.json +++ b/types/escape-string-regexp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/escodegen/tslint.json b/types/escodegen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/escodegen/tslint.json +++ b/types/escodegen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/esprima-walk/tslint.json b/types/esprima-walk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/esprima-walk/tslint.json +++ b/types/esprima-walk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/estraverse/tslint.json b/types/estraverse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/estraverse/tslint.json +++ b/types/estraverse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/estree/tslint.json b/types/estree/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/estree/tslint.json +++ b/types/estree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/event-loop-lag/tslint.json b/types/event-loop-lag/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/event-loop-lag/tslint.json +++ b/types/event-loop-lag/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/event-stream/tslint.json b/types/event-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/event-stream/tslint.json +++ b/types/event-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/event-to-promise/tslint.json b/types/event-to-promise/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/event-to-promise/tslint.json +++ b/types/event-to-promise/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/evernote/tslint.json b/types/evernote/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/evernote/tslint.json +++ b/types/evernote/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/exit/tslint.json b/types/exit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/exit/tslint.json +++ b/types/exit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/exorcist/tslint.json b/types/exorcist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/exorcist/tslint.json +++ b/types/exorcist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/expect.js/tslint.json b/types/expect.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/expect.js/tslint.json +++ b/types/expect.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/expectations/tslint.json b/types/expectations/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/expectations/tslint.json +++ b/types/expectations/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 88e6ae9fd6..b051946110 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2616,7 +2616,7 @@ export interface SvgCommonProps { strokeWidth?: number | string; strokeOpacity?: number | string; strokeLinecap?: string; - strokeLineJoin?: string; + strokeLinejoin?: string; strokeDasharray?: any[]; strokeDashoffset?: any; transform?: string | object; diff --git a/types/express-brute-memcached/tslint.json b/types/express-brute-memcached/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-brute-memcached/tslint.json +++ b/types/express-brute-memcached/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-brute-mongo/tslint.json b/types/express-brute-mongo/tslint.json index 81e3db2614..1134194a62 100644 --- a/types/express-brute-mongo/tslint.json +++ b/types/express-brute-mongo/tslint.json @@ -4,6 +4,7 @@ // TODOs "ban-types": false, "dt-header": false, + "npm-naming": false, "no-unnecessary-class": false } } diff --git a/types/express-brute/tslint.json b/types/express-brute/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-brute/tslint.json +++ b/types/express-brute/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-debug/tslint.json b/types/express-debug/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-debug/tslint.json +++ b/types/express-debug/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-domain-middleware/tslint.json b/types/express-domain-middleware/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-domain-middleware/tslint.json +++ b/types/express-domain-middleware/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-handlebars/tslint.json b/types/express-handlebars/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-handlebars/tslint.json +++ b/types/express-handlebars/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-jwt/tslint.json b/types/express-jwt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-jwt/tslint.json +++ b/types/express-jwt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-less/tslint.json b/types/express-less/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-less/tslint.json +++ b/types/express-less/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-minify/tslint.json b/types/express-minify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-minify/tslint.json +++ b/types/express-minify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-mung/tslint.json b/types/express-mung/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-mung/tslint.json +++ b/types/express-mung/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-myconnection/tslint.json b/types/express-myconnection/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-myconnection/tslint.json +++ b/types/express-myconnection/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-openapi/tslint.json b/types/express-openapi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-openapi/tslint.json +++ b/types/express-openapi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-partials/tslint.json b/types/express-partials/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-partials/tslint.json +++ b/types/express-partials/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-route-fs/tslint.json b/types/express-route-fs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-route-fs/tslint.json +++ b/types/express-route-fs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-unless/tslint.json b/types/express-unless/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-unless/tslint.json +++ b/types/express-unless/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/express-useragent/tslint.json b/types/express-useragent/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/express-useragent/tslint.json +++ b/types/express-useragent/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/extjs/tslint.json b/types/extjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/extjs/tslint.json +++ b/types/extjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/eyes/tslint.json b/types/eyes/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/eyes/tslint.json +++ b/types/eyes/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 5b2a7c13af..96034c0b5f 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -3642,6 +3642,9 @@ export class Polyline extends Object { * @param [skipOffset] Whether points offsetting should be skipped */ constructor(points: Array<{ x: number; y: number }>, options?: IPolylineOptions); + + pathOffset: Point; + /** * List of attribute names to account for when parsing SVG element (used by `fabric.Polygon.fromElement`) */ diff --git a/types/facebook-js-sdk/tslint.json b/types/facebook-js-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/facebook-js-sdk/tslint.json +++ b/types/facebook-js-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/facebook-pixel/tslint.json b/types/facebook-pixel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/facebook-pixel/tslint.json +++ b/types/facebook-pixel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/faker/tslint.json b/types/faker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/faker/tslint.json +++ b/types/faker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/falcor-express/tslint.json b/types/falcor-express/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/falcor-express/tslint.json +++ b/types/falcor-express/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/falcor-http-datasource/tslint.json b/types/falcor-http-datasource/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/falcor-http-datasource/tslint.json +++ b/types/falcor-http-datasource/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/falcor-json-graph/tslint.json b/types/falcor-json-graph/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/falcor-json-graph/tslint.json +++ b/types/falcor-json-graph/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/falcor-router/tslint.json b/types/falcor-router/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/falcor-router/tslint.json +++ b/types/falcor-router/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/famous/tslint.json b/types/famous/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/famous/tslint.json +++ b/types/famous/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/farbtastic/tslint.json b/types/farbtastic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/farbtastic/tslint.json +++ b/types/farbtastic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fast-levenshtein/tslint.json b/types/fast-levenshtein/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fast-levenshtein/tslint.json +++ b/types/fast-levenshtein/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fast-stats/tslint.json b/types/fast-stats/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fast-stats/tslint.json +++ b/types/fast-stats/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fastclick/tslint.json b/types/fastclick/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fastclick/tslint.json +++ b/types/fastclick/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/favico.js/tslint.json b/types/favico.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/favico.js/tslint.json +++ b/types/favico.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fb/tslint.json b/types/fb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fb/tslint.json +++ b/types/fb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fbemitter/tslint.json b/types/fbemitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fbemitter/tslint.json +++ b/types/fbemitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/featherlight/tslint.json b/types/featherlight/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/featherlight/tslint.json +++ b/types/featherlight/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fhir/tslint.json b/types/fhir/tslint.json index e87060ef20..9f58325d7f 100644 --- a/types/fhir/tslint.json +++ b/types/fhir/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fibers/tslint.json b/types/fibers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fibers/tslint.json +++ b/types/fibers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/field/tslint.json b/types/field/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/field/tslint.json +++ b/types/field/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/filesystem/tslint.json b/types/filesystem/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/filesystem/tslint.json +++ b/types/filesystem/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/filewriter/tslint.json b/types/filewriter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/filewriter/tslint.json +++ b/types/filewriter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fill-pdf/tslint.json b/types/fill-pdf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fill-pdf/tslint.json +++ b/types/fill-pdf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/finalhandler/tslint.json b/types/finalhandler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/finalhandler/tslint.json +++ b/types/finalhandler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/finch/tslint.json b/types/finch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/finch/tslint.json +++ b/types/finch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fingerprintjs/tslint.json b/types/fingerprintjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fingerprintjs/tslint.json +++ b/types/fingerprintjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/firebase-client/tslint.json b/types/firebase-client/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/firebase-client/tslint.json +++ b/types/firebase-client/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/firebase-token-generator/tslint.json b/types/firebase-token-generator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/firebase-token-generator/tslint.json +++ b/types/firebase-token-generator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/firefox/tslint.json b/types/firefox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/firefox/tslint.json +++ b/types/firefox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fixed-data-table/tslint.json b/types/fixed-data-table/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fixed-data-table/tslint.json +++ b/types/fixed-data-table/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flake-idgen/tslint.json b/types/flake-idgen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flake-idgen/tslint.json +++ b/types/flake-idgen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flat/tslint.json b/types/flat/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flat/tslint.json +++ b/types/flat/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flexslider/tslint.json b/types/flexslider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flexslider/tslint.json +++ b/types/flexslider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flight/tslint.json b/types/flight/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flight/tslint.json +++ b/types/flight/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flightplan/tslint.json b/types/flightplan/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flightplan/tslint.json +++ b/types/flightplan/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flipsnap/tslint.json b/types/flipsnap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flipsnap/tslint.json +++ b/types/flipsnap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flot/tslint.json b/types/flot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flot/tslint.json +++ b/types/flot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/flowjs/tslint.json b/types/flowjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/flowjs/tslint.json +++ b/types/flowjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fluxxor/tslint.json b/types/fluxxor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fluxxor/tslint.json +++ b/types/fluxxor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fontfaceobserver/tslint.json b/types/fontfaceobserver/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fontfaceobserver/tslint.json +++ b/types/fontfaceobserver/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fontoxml/tslint.json b/types/fontoxml/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fontoxml/tslint.json +++ b/types/fontoxml/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/forge-di/tslint.json b/types/forge-di/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/forge-di/tslint.json +++ b/types/forge-di/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/form-serializer/tslint.json b/types/form-serializer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/form-serializer/tslint.json +++ b/types/form-serializer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/formidable/tslint.json b/types/formidable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/formidable/tslint.json +++ b/types/formidable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fossil-delta/tslint.json b/types/fossil-delta/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fossil-delta/tslint.json +++ b/types/fossil-delta/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/foundation/tslint.json b/types/foundation/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/foundation/tslint.json +++ b/types/foundation/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fpsmeter/tslint.json b/types/fpsmeter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fpsmeter/tslint.json +++ b/types/fpsmeter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/freedom/tslint.json b/types/freedom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/freedom/tslint.json +++ b/types/freedom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/from/tslint.json b/types/from/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/from/tslint.json +++ b/types/from/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fromjs/tslint.json b/types/fromjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fromjs/tslint.json +++ b/types/fromjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fromnow/tslint.json b/types/fromnow/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fromnow/tslint.json +++ b/types/fromnow/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fs-ext/tslint.json b/types/fs-ext/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fs-ext/tslint.json +++ b/types/fs-ext/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fs-finder/tslint.json b/types/fs-finder/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fs-finder/tslint.json +++ b/types/fs-finder/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fs-mock/tslint.json b/types/fs-mock/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fs-mock/tslint.json +++ b/types/fs-mock/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ftdomdelegate/tslint.json b/types/ftdomdelegate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ftdomdelegate/tslint.json +++ b/types/ftdomdelegate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ftp/tslint.json b/types/ftp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ftp/tslint.json +++ b/types/ftp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ftpd/tslint.json b/types/ftpd/tslint.json index b6afb8acee..4017299a0e 100644 --- a/types/ftpd/tslint.json +++ b/types/ftpd/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fullname/tslint.json b/types/fullname/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fullname/tslint.json +++ b/types/fullname/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fullpage.js/tslint.json b/types/fullpage.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fullpage.js/tslint.json +++ b/types/fullpage.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fuzzaldrin-plus/tslint.json b/types/fuzzaldrin-plus/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fuzzaldrin-plus/tslint.json +++ b/types/fuzzaldrin-plus/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/fxn/tslint.json b/types/fxn/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/fxn/tslint.json +++ b/types/fxn/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gae.channel.api/tslint.json b/types/gae.channel.api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gae.channel.api/tslint.json +++ b/types/gae.channel.api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gamequery/tslint.json b/types/gamequery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gamequery/tslint.json +++ b/types/gamequery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gandi-livedns/tslint.json b/types/gandi-livedns/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gandi-livedns/tslint.json +++ b/types/gandi-livedns/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.analytics/tslint.json b/types/gapi.analytics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.analytics/tslint.json +++ b/types/gapi.analytics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.calendar/tslint.json b/types/gapi.calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.calendar/tslint.json +++ b/types/gapi.calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.drive/tslint.json b/types/gapi.drive/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.drive/tslint.json +++ b/types/gapi.drive/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.pagespeedonline/tslint.json b/types/gapi.pagespeedonline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.pagespeedonline/tslint.json +++ b/types/gapi.pagespeedonline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.people/tslint.json b/types/gapi.people/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.people/tslint.json +++ b/types/gapi.people/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.plus/tslint.json b/types/gapi.plus/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.plus/tslint.json +++ b/types/gapi.plus/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.translate/tslint.json b/types/gapi.translate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.translate/tslint.json +++ b/types/gapi.translate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.urlshortener/tslint.json b/types/gapi.urlshortener/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.urlshortener/tslint.json +++ b/types/gapi.urlshortener/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.youtube/tslint.json b/types/gapi.youtube/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.youtube/tslint.json +++ b/types/gapi.youtube/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi.youtubeanalytics/tslint.json b/types/gapi.youtubeanalytics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi.youtubeanalytics/tslint.json +++ b/types/gapi.youtubeanalytics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gapi/tslint.json b/types/gapi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gapi/tslint.json +++ b/types/gapi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/generic-functions/tslint.json b/types/generic-functions/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/generic-functions/tslint.json +++ b/types/generic-functions/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gently/tslint.json b/types/gently/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gently/tslint.json +++ b/types/gently/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/geoip-lite/tslint.json b/types/geoip-lite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/geoip-lite/tslint.json +++ b/types/geoip-lite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/geojson2osm/tslint.json b/types/geojson2osm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/geojson2osm/tslint.json +++ b/types/geojson2osm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/geometry-dom/tslint.json b/types/geometry-dom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/geometry-dom/tslint.json +++ b/types/geometry-dom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gijgo/tslint.json b/types/gijgo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gijgo/tslint.json +++ b/types/gijgo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/giraffe/tslint.json b/types/giraffe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/giraffe/tslint.json +++ b/types/giraffe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/git-config/tslint.json b/types/git-config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/git-config/tslint.json +++ b/types/git-config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/git/tslint.json b/types/git/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/git/tslint.json +++ b/types/git/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gl-matrix/tslint.json b/types/gl-matrix/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gl-matrix/tslint.json +++ b/types/gl-matrix/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gldatepicker/tslint.json b/types/gldatepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gldatepicker/tslint.json +++ b/types/gldatepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/glidejs/tslint.json b/types/glidejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/glidejs/tslint.json +++ b/types/glidejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/glob-expand/tslint.json b/types/glob-expand/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/glob-expand/tslint.json +++ b/types/glob-expand/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/glob-stream/tslint.json b/types/glob-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/glob-stream/tslint.json +++ b/types/glob-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/globalize-compiler/tslint.json b/types/globalize-compiler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/globalize-compiler/tslint.json +++ b/types/globalize-compiler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/globalize/tslint.json b/types/globalize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/globalize/tslint.json +++ b/types/globalize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/go/tslint.json b/types/go/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/go/tslint.json +++ b/types/go/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google-apps-script/google-apps-script.base.d.ts b/types/google-apps-script/google-apps-script.base.d.ts index 5c2a8d9155..be1bad95d5 100644 --- a/types/google-apps-script/google-apps-script.base.d.ts +++ b/types/google-apps-script/google-apps-script.base.d.ts @@ -326,3 +326,4 @@ declare var Logger: GoogleAppsScript.Base.Logger; // conflicts with MimeType in lib.d.ts // declare var MimeType: GoogleAppsScript.Base.MimeType; declare var Session: GoogleAppsScript.Base.Session; +declare var console: GoogleAppsScript.Base.console; diff --git a/types/google-apps-script/tslint.json b/types/google-apps-script/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google-apps-script/tslint.json +++ b/types/google-apps-script/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google-closure-compiler/tslint.json b/types/google-closure-compiler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google-closure-compiler/tslint.json +++ b/types/google-closure-compiler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google-cloud__text-to-speech/google-cloud__text-to-speech-tests.ts b/types/google-cloud__text-to-speech/google-cloud__text-to-speech-tests.ts new file mode 100644 index 0000000000..79c368c8e3 --- /dev/null +++ b/types/google-cloud__text-to-speech/google-cloud__text-to-speech-tests.ts @@ -0,0 +1,56 @@ +import textToSpeech from "@google-cloud/text-to-speech"; + +const client = new textToSpeech.TextToSpeechClient({}); + +/* listVoices */ + +client.listVoices({}); + +client.listVoices({}, (err, res) => { + if (res) { + res.map(voice => + console.log( + voice.language_codes, + voice.name, + voice.naturalSampleRateHertz, + voice.ssmlGender + ) + ); + } +}); + +client.listVoices({ languageCode: "en-GB" }).then(res => { + res[0].map(voice => + console.log( + voice.language_codes, + voice.name, + voice.naturalSampleRateHertz, + voice.ssmlGender + ) + ); +}); + +/* synthesizeSpeech */ + +client.synthesizeSpeech( + { + input: { text: "Hello world." }, + audioConfig: { audioEncoding: "MP3" }, + voice: { name: "Alice" } + }, + (err, res) => { + if (res) { + console.log(res.audioContent); + } + } +); + +client + .synthesizeSpeech({ + input: { ssml: "Hello world." }, + audioConfig: { audioEncoding: "OGG_OPUS" }, + voice: { name: "Bob", languageCode: "en-GB" } + }) + .then(res => { + console.log(res[0].audioContent); + }); diff --git a/types/google-cloud__text-to-speech/index.d.ts b/types/google-cloud__text-to-speech/index.d.ts new file mode 100644 index 0000000000..9e0c80cac2 --- /dev/null +++ b/types/google-cloud__text-to-speech/index.d.ts @@ -0,0 +1,123 @@ +// Type definitions for google-cloud__text-to-speech 0.5 +// Project: https://github.com/googleapis/nodejs-text-to-speech +// Definitions by: Ben James +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.8 + +/// + +export type GoogleError = any; + +export type APICallback = ( + err: GoogleError | null, + response?: T +) => void; + +export interface PromiseLike extends Promise { + /** + * Cancel the ongoing promise + */ + cancel(): void; +} + +export interface MethodOverload { + (data: T, options?: CallOptions): PromiseLike<[R]>; + (data: T, options: CallOptions, callback: APICallback): void; + (data: T, callback: APICallback): void; +} + +export interface CallOptions { + timeout?: number; + retry?: any; + autoPaginate?: boolean; + pageToken?: any; + isBundling: boolean; + longrunning?: any; + promise?: any; +} + +export interface ClientOptionsCredentials { + client_email: string; + private_key: string; +} + +export interface ClientOptions { + credentials?: ClientOptionsCredentials; + email?: string; + keyFilename?: string; + port?: number; + projectId?: string; + promise?: any; + servicePath?: string; +} + +export interface ListVoicesRequest { + languageCode?: string; +} + +export type ListVoicesOptions = CallOptions; + +export type SsmlVoiceGender = + | "SSML_VOICE_GENDER_UNSPECIFIED" + | "MALE" + | "FEMALE" + | "NEUTRAL"; + +export interface Voice { + language_codes: string[]; + name: string; + ssmlGender: SsmlVoiceGender; + naturalSampleRateHertz: number; +} + +export type ListVoicesResponse = Voice[]; + +export type SynthesisInput = { text: string } | { ssml: string }; + +export interface VoiceSelectionParams { + languageCode?: string; + name?: string; + ssmlGender?: SsmlVoiceGender; +} + +export type AudioEncoding = + | "AUDIO_ENCODING_UNSPECIFIED" + | "LINEAR16" + | "MP3" + | "OGG_OPUS"; + +export interface AudioConfig { + audioEncoding: AudioEncoding; + effectsProfileId?: string[]; + pitch?: number; + sampleRateHertz?: number; + speakingRate?: number; + volumeGainDb?: number; +} + +export interface SynthesizeSpeechRequest { + input: SynthesisInput; + voice: VoiceSelectionParams; + audioConfig: AudioConfig; +} + +export type SynthesizeSpeechOptions = CallOptions; + +export interface SynthesizeSpeechResponse { + audioContent: Buffer; +} + +declare class TextToSpeechClient { + constructor(options?: ClientOptions); + + listVoices: MethodOverload; + synthesizeSpeech: MethodOverload< + SynthesizeSpeechRequest, + SynthesizeSpeechResponse + >; +} + +declare const TextToSpeech: { TextToSpeechClient: typeof TextToSpeechClient }; + +export default TextToSpeech; diff --git a/types/google-cloud__text-to-speech/tsconfig.json b/types/google-cloud__text-to-speech/tsconfig.json new file mode 100644 index 0000000000..a682d930a1 --- /dev/null +++ b/types/google-cloud__text-to-speech/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@google-cloud/text-to-speech": ["google-cloud__text-to-speech"] + } + }, + "files": ["index.d.ts", "google-cloud__text-to-speech-tests.ts"] +} diff --git a/types/google-cloud__text-to-speech/tslint.json b/types/google-cloud__text-to-speech/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/google-cloud__text-to-speech/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/google-drive-realtime-api/tslint.json b/types/google-drive-realtime-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google-drive-realtime-api/tslint.json +++ b/types/google-drive-realtime-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google-earth/tslint.json b/types/google-earth/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google-earth/tslint.json +++ b/types/google-earth/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google-libphonenumber/tslint.json b/types/google-libphonenumber/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google-libphonenumber/tslint.json +++ b/types/google-libphonenumber/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google-maps/tslint.json b/types/google-maps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google-maps/tslint.json +++ b/types/google-maps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google.analytics/tslint.json b/types/google.analytics/tslint.json index d802652174..8c0a18b10a 100644 --- a/types/google.analytics/tslint.json +++ b/types/google.analytics/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "dt-header": false, + "npm-naming": false, "ban-types": false, "unified-signatures": false, "no-unnecessary-generics": false diff --git a/types/google.feeds/tslint.json b/types/google.feeds/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google.feeds/tslint.json +++ b/types/google.feeds/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google.geolocation/tslint.json b/types/google.geolocation/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google.geolocation/tslint.json +++ b/types/google.geolocation/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google.picker/tslint.json b/types/google.picker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google.picker/tslint.json +++ b/types/google.picker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/google.visualization/tslint.json b/types/google.visualization/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/google.visualization/tslint.json +++ b/types/google.visualization/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/googlemaps.infobubble/tslint.json b/types/googlemaps.infobubble/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/googlemaps.infobubble/tslint.json +++ b/types/googlemaps.infobubble/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/googlemaps/tslint.json b/types/googlemaps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/googlemaps/tslint.json +++ b/types/googlemaps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/graham_scan/tslint.json b/types/graham_scan/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/graham_scan/tslint.json +++ b/types/graham_scan/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/graphlib/tslint.json b/types/graphlib/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/graphlib/tslint.json +++ b/types/graphlib/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/graphviz/tslint.json b/types/graphviz/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/graphviz/tslint.json +++ b/types/graphviz/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gravatar/tslint.json b/types/gravatar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gravatar/tslint.json +++ b/types/gravatar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gregorian-calendar/tslint.json b/types/gregorian-calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gregorian-calendar/tslint.json +++ b/types/gregorian-calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gridfs-stream/tslint.json b/types/gridfs-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gridfs-stream/tslint.json +++ b/types/gridfs-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gridstack/tslint.json b/types/gridstack/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/gridstack/tslint.json +++ b/types/gridstack/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/grunt/tslint.json b/types/grunt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/grunt/tslint.json +++ b/types/grunt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gsap/tslint.json b/types/gsap/tslint.json index 9081f7897d..972c8224ab 100644 --- a/types/gsap/tslint.json +++ b/types/gsap/tslint.json @@ -3,6 +3,7 @@ "rules": { // All are TODOs "dt-header": false, + "npm-naming": false, "jsdoc-format": false, "max-line-length": false, "no-consecutive-blank-lines": false, diff --git a/types/gulp-angular-templatecache/tslint.json b/types/gulp-angular-templatecache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-angular-templatecache/tslint.json +++ b/types/gulp-angular-templatecache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-autoprefixer/tslint.json b/types/gulp-autoprefixer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-autoprefixer/tslint.json +++ b/types/gulp-autoprefixer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-babel/tslint.json b/types/gulp-babel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-babel/tslint.json +++ b/types/gulp-babel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-cache/tslint.json b/types/gulp-cache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-cache/tslint.json +++ b/types/gulp-cache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-cached/tslint.json b/types/gulp-cached/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-cached/tslint.json +++ b/types/gulp-cached/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-changed/tslint.json b/types/gulp-changed/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-changed/tslint.json +++ b/types/gulp-changed/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-cheerio/tslint.json b/types/gulp-cheerio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-cheerio/tslint.json +++ b/types/gulp-cheerio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-coffeeify/tslint.json b/types/gulp-coffeeify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-coffeeify/tslint.json +++ b/types/gulp-coffeeify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-coffeelint/tslint.json b/types/gulp-coffeelint/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-coffeelint/tslint.json +++ b/types/gulp-coffeelint/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-concat/tslint.json b/types/gulp-concat/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-concat/tslint.json +++ b/types/gulp-concat/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-copy/tslint.json b/types/gulp-copy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-copy/tslint.json +++ b/types/gulp-copy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-csso/tslint.json b/types/gulp-csso/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-csso/tslint.json +++ b/types/gulp-csso/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-debug/tslint.json b/types/gulp-debug/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-debug/tslint.json +++ b/types/gulp-debug/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-dtsm/tslint.json b/types/gulp-dtsm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-dtsm/tslint.json +++ b/types/gulp-dtsm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-espower/tslint.json b/types/gulp-espower/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-espower/tslint.json +++ b/types/gulp-espower/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-file-include/tslint.json b/types/gulp-file-include/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-file-include/tslint.json +++ b/types/gulp-file-include/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-filter/tslint.json b/types/gulp-filter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-filter/tslint.json +++ b/types/gulp-filter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-flatten/tslint.json b/types/gulp-flatten/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-flatten/tslint.json +++ b/types/gulp-flatten/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-gh-pages/tslint.json b/types/gulp-gh-pages/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-gh-pages/tslint.json +++ b/types/gulp-gh-pages/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-gzip/tslint.json b/types/gulp-gzip/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-gzip/tslint.json +++ b/types/gulp-gzip/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-help-doc/tslint.json b/types/gulp-help-doc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-help-doc/tslint.json +++ b/types/gulp-help-doc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-help/tslint.json b/types/gulp-help/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-help/tslint.json +++ b/types/gulp-help/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-html-replace/tslint.json b/types/gulp-html-replace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-html-replace/tslint.json +++ b/types/gulp-html-replace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-htmlmin/tslint.json b/types/gulp-htmlmin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-htmlmin/tslint.json +++ b/types/gulp-htmlmin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-if/tslint.json b/types/gulp-if/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-if/tslint.json +++ b/types/gulp-if/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-inject/tslint.json b/types/gulp-inject/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-inject/tslint.json +++ b/types/gulp-inject/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-insert/tslint.json b/types/gulp-insert/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-insert/tslint.json +++ b/types/gulp-insert/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-install/tslint.json b/types/gulp-install/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-install/tslint.json +++ b/types/gulp-install/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-istanbul/tslint.json b/types/gulp-istanbul/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-istanbul/tslint.json +++ b/types/gulp-istanbul/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-jade/tslint.json b/types/gulp-jade/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-jade/tslint.json +++ b/types/gulp-jade/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-jasmine-browser/tslint.json b/types/gulp-jasmine-browser/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-jasmine-browser/tslint.json +++ b/types/gulp-jasmine-browser/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-json-editor/tslint.json b/types/gulp-json-editor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-json-editor/tslint.json +++ b/types/gulp-json-editor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-jspm/tslint.json b/types/gulp-jspm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-jspm/tslint.json +++ b/types/gulp-jspm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-less/tslint.json b/types/gulp-less/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-less/tslint.json +++ b/types/gulp-less/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-load-plugins/tslint.json b/types/gulp-load-plugins/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-load-plugins/tslint.json +++ b/types/gulp-load-plugins/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-minify-css/tslint.json b/types/gulp-minify-css/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-minify-css/tslint.json +++ b/types/gulp-minify-css/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-minify-html/tslint.json b/types/gulp-minify-html/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-minify-html/tslint.json +++ b/types/gulp-minify-html/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-mocha/tslint.json b/types/gulp-mocha/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-mocha/tslint.json +++ b/types/gulp-mocha/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-newer/tslint.json b/types/gulp-newer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-newer/tslint.json +++ b/types/gulp-newer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-ng-annotate/tslint.json b/types/gulp-ng-annotate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-ng-annotate/tslint.json +++ b/types/gulp-ng-annotate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-nodemon/tslint.json b/types/gulp-nodemon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-nodemon/tslint.json +++ b/types/gulp-nodemon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-plumber/tslint.json b/types/gulp-plumber/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-plumber/tslint.json +++ b/types/gulp-plumber/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-protractor/tslint.json b/types/gulp-protractor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-protractor/tslint.json +++ b/types/gulp-protractor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-remember/tslint.json b/types/gulp-remember/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-remember/tslint.json +++ b/types/gulp-remember/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-rename/tslint.json b/types/gulp-rename/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-rename/tslint.json +++ b/types/gulp-rename/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-replace/tslint.json b/types/gulp-replace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-replace/tslint.json +++ b/types/gulp-replace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-rev-replace/tslint.json b/types/gulp-rev-replace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-rev-replace/tslint.json +++ b/types/gulp-rev-replace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-rev/tslint.json b/types/gulp-rev/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-rev/tslint.json +++ b/types/gulp-rev/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-ruby-sass/tslint.json b/types/gulp-ruby-sass/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-ruby-sass/tslint.json +++ b/types/gulp-ruby-sass/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-sass/tslint.json b/types/gulp-sass/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-sass/tslint.json +++ b/types/gulp-sass/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-shell/tslint.json b/types/gulp-shell/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-shell/tslint.json +++ b/types/gulp-shell/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-sort/tslint.json b/types/gulp-sort/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-sort/tslint.json +++ b/types/gulp-sort/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-sourcemaps/tslint.json b/types/gulp-sourcemaps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-sourcemaps/tslint.json +++ b/types/gulp-sourcemaps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-strip-debug/tslint.json b/types/gulp-strip-debug/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-strip-debug/tslint.json +++ b/types/gulp-strip-debug/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-svg-sprite/tslint.json b/types/gulp-svg-sprite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-svg-sprite/tslint.json +++ b/types/gulp-svg-sprite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-task-listing/tslint.json b/types/gulp-task-listing/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-task-listing/tslint.json +++ b/types/gulp-task-listing/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-tsd/tslint.json b/types/gulp-tsd/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-tsd/tslint.json +++ b/types/gulp-tsd/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-useref/tslint.json b/types/gulp-useref/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-useref/tslint.json +++ b/types/gulp-useref/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp-watch/tslint.json b/types/gulp-watch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/gulp-watch/tslint.json +++ b/types/gulp-watch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/gulp/tslint.json b/types/gulp/tslint.json index 0ba754a19a..19067f25e6 100644 --- a/types/gulp/tslint.json +++ b/types/gulp/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-object-literal-type-assertion": false } } diff --git a/types/h2o2/tslint.json b/types/h2o2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/h2o2/tslint.json +++ b/types/h2o2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/halfred/tslint.json b/types/halfred/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/halfred/tslint.json +++ b/types/halfred/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hammerjs/tslint.json b/types/hammerjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hammerjs/tslint.json +++ b/types/hammerjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hapi-auth-basic/tslint.json b/types/hapi-auth-basic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hapi-auth-basic/tslint.json +++ b/types/hapi-auth-basic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hapi-decorators/tslint.json b/types/hapi-decorators/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hapi-decorators/tslint.json +++ b/types/hapi-decorators/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/harmony-proxy/tslint.json b/types/harmony-proxy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/harmony-proxy/tslint.json +++ b/types/harmony-proxy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hasher/tslint.json b/types/hasher/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hasher/tslint.json +++ b/types/hasher/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hashids/tslint.json b/types/hashids/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hashids/tslint.json +++ b/types/hashids/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hashmap/tslint.json b/types/hashmap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hashmap/tslint.json +++ b/types/hashmap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hashset/tslint.json b/types/hashset/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hashset/tslint.json +++ b/types/hashset/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hashtable/tslint.json b/types/hashtable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hashtable/tslint.json +++ b/types/hashtable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/he/tslint.json b/types/he/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/he/tslint.json +++ b/types/he/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/headroom/tslint.json b/types/headroom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/headroom/tslint.json +++ b/types/headroom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/heap/tslint.json b/types/heap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/heap/tslint.json +++ b/types/heap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hellosign-embedded/tslint.json b/types/hellosign-embedded/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hellosign-embedded/tslint.json +++ b/types/hellosign-embedded/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/helmet/tslint.json b/types/helmet/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/helmet/tslint.json +++ b/types/helmet/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/highcharts-ng/tslint.json b/types/highcharts-ng/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/highcharts-ng/tslint.json +++ b/types/highcharts-ng/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index b3900154cd..8001ab7884 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -5,6 +5,7 @@ // Albert Ozimek // Juliën Hanssens // Johns Gresham +// ArunkeshavaReddy Sankaramaddi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -4458,7 +4459,10 @@ declare namespace Highcharts { * @default 'Solid' */ dashStyle?: string; - dataLabels?: DataLabels; + /** + * Gantt charts use one or more data labels for each series, for showing multiple date periods. + */ + dataLabels?: DataLabels | DataLabels[]; /** * Enable or disable the mouse tracking for a specific series. This includes point tooltips and click events on * graphs and points. For large datasets it improves performance. @@ -5984,6 +5988,7 @@ declare namespace Highcharts { interface ColumnRangeChartSeriesOptions extends IndividualSeriesOptions, ColumnRangeChart { } interface ErrorBarChartSeriesOptions extends IndividualSeriesOptions, ErrorBarChart { } interface FunnelChartSeriesOptions extends IndividualSeriesOptions, FunnelChart { } + interface GanttChartSeriesOptions extends IndividualSeriesOptions, SeriesChart { } interface GaugeChartSeriesOptions extends IndividualSeriesOptions, GaugeChart { } interface HeatMapSeriesOptions extends IndividualSeriesOptions, HeatMapChart { } interface LineChartSeriesOptions extends IndividualSeriesOptions, LineChart { } @@ -6023,11 +6028,11 @@ declare namespace Highcharts { * The id of a series in the drilldown.series array to use for a drilldown for this point. * @since 3.0.8 */ - drilldown?: string; - /** - * The end value of the point. For gantt datetime axes, the end value is the timestamp in milliseconds since 1970. - */ - end?: number; + drilldown?: string; + /** + * The end value of the point. For gantt datetime axes, the end value is the timestamp in milliseconds since 1970. + */ + end?: number; /** * Individual point events */ @@ -6106,11 +6111,11 @@ declare namespace Highcharts { * Whether to display a slice offset from the center. * @default false */ - sliced?: boolean; - /** - * The start value of the point. For gantt datetime axes, the start value is the timestamp in milliseconds since 1970. - */ - start?: number; + sliced?: boolean; + /** + * The start value of the point. For gantt datetime axes, the start value is the timestamp in milliseconds since 1970. + */ + start?: number; /** * The value of the point, resulting in a relative area of the point in the treemap. */ @@ -6686,6 +6691,16 @@ declare namespace Highcharts { yAxis?: AxisOptions[] | AxisOptions; } + /** + * The Gantt chart uses different plot options than the base Highcharts chart Options. + */ + interface GanttOptions extends Options { + /** + * The specific Gantt Series to append the GanttChart. + */ + series?: GanttChartSeriesOptions[]; + } + interface GlobalOptions extends Options { /** * Global options that don't apply to each chart. These options, like the lang options, must be set using the @@ -7269,11 +7284,11 @@ declare namespace Highcharts { * As Highcharts.Chart, but without need for the new keyword. * @since 4.2.0 */ - chart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; - /** - * Highcharts ganttChart which doesn't require the new keyword. Required Highcharts Gantt module. - */ - ganttChart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; + chart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; + /** + * Highcharts ganttChart which doesn't require the new keyword. Required Highcharts Gantt module. + */ + ganttChart(renderTo: string | HTMLElement, options: GanttOptions, callback?: (chart: ChartObject) => void): ChartObject; /** * An array containing the current chart objects in the page. A chart's position in the array is preserved * throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined. diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts index 9ac03d1f81..358064b877 100644 --- a/types/highcharts/test/index.ts +++ b/types/highcharts/test/index.ts @@ -2886,3 +2886,46 @@ function test_GanttChart() { }], }); } + +// Tests DataLabels types for Highcharts.ganttChart, which uses the Gantt module +function test_GanttChartDataLabels() { + Highcharts.ganttChart('ganttChartContainer', { + xAxis: { + min: Date.UTC(2014, 9, 18), + max: Date.UTC(2014, 12, 20) + }, + series: [{ + name: 'Project 1', + data: [ + { + name: 'Lemon Tea', + start: Date.UTC(2014, 10, 18), + end: Date.UTC(2014, 11, 20) + }, + { + name: 'Stapler', + start: Date.UTC(2014, 11, 18), + end: Date.UTC(2014, 12, 20) + }, + { + name: 'Sierra', + start: Date.UTC(2014, 12, 18), + end: Date.UTC(2014, 12, 20) + }, + ], + dataLabels: [{ + enabled: true, + format: 'Data Label Left', + useHTML: true, + align: 'left', + allowOverlap: true, + }, { + enabled: true, + format: 'Data Label Right', + useHTML: true, + align: 'right', + allowOverlap: true, + }] + }], + }); +} diff --git a/types/highland/tslint.json b/types/highland/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/highland/tslint.json +++ b/types/highland/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/highlight.js/tslint.json b/types/highlight.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/highlight.js/tslint.json +++ b/types/highlight.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/history.js/tslint.json b/types/history.js/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/history.js/tslint.json +++ b/types/history.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/history/tslint.json b/types/history/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/history/tslint.json +++ b/types/history/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hooker/tslint.json b/types/hooker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hooker/tslint.json +++ b/types/hooker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hopscotch/tslint.json b/types/hopscotch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hopscotch/tslint.json +++ b/types/hopscotch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/howler/tslint.json b/types/howler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/howler/tslint.json +++ b/types/howler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/html-entities/tslint.json b/types/html-entities/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/html-entities/tslint.json +++ b/types/html-entities/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/html-pdf/tslint.json b/types/html-pdf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/html-pdf/tslint.json +++ b/types/html-pdf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/html-to-text/tslint.json b/types/html-to-text/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/html-to-text/tslint.json +++ b/types/html-to-text/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/html2canvas/tslint.json b/types/html2canvas/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/html2canvas/tslint.json +++ b/types/html2canvas/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/htmlescape/tslint.json b/types/htmlescape/tslint.json index cb07a85b4e..6439f14555 100644 --- a/types/htmlescape/tslint.json +++ b/types/htmlescape/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODO "dt-header": false, + "npm-naming": false, "no-duplicate-imports": false } } diff --git a/types/htmlhint/tslint.json b/types/htmlhint/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/htmlhint/tslint.json +++ b/types/htmlhint/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/htmlparser2/tslint.json b/types/htmlparser2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/htmlparser2/tslint.json +++ b/types/htmlparser2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/htmltojsx/tslint.json b/types/htmltojsx/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/htmltojsx/tslint.json +++ b/types/htmltojsx/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/http-status/tslint.json b/types/http-status/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/http-status/tslint.json +++ b/types/http-status/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/http-string-parser/tslint.json b/types/http-string-parser/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/http-string-parser/tslint.json +++ b/types/http-string-parser/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/httperr/tslint.json b/types/httperr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/httperr/tslint.json +++ b/types/httperr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hubspot-pace/tslint.json b/types/hubspot-pace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hubspot-pace/tslint.json +++ b/types/hubspot-pace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/humane/tslint.json b/types/humane/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/humane/tslint.json +++ b/types/humane/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/humanparser/tslint.json b/types/humanparser/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/humanparser/tslint.json +++ b/types/humanparser/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/humps/tslint.json b/types/humps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/humps/tslint.json +++ b/types/humps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hyperscript/tslint.json b/types/hyperscript/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hyperscript/tslint.json +++ b/types/hyperscript/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/hypertext-application-language/tslint.json b/types/hypertext-application-language/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/hypertext-application-language/tslint.json +++ b/types/hypertext-application-language/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/i18next-express-middleware/tslint.json b/types/i18next-express-middleware/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/i18next-express-middleware/tslint.json +++ b/types/i18next-express-middleware/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/i18next-node-fs-backend/tslint.json b/types/i18next-node-fs-backend/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/i18next-node-fs-backend/tslint.json +++ b/types/i18next-node-fs-backend/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/i18next-sprintf-postprocessor/tslint.json b/types/i18next-sprintf-postprocessor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/i18next-sprintf-postprocessor/tslint.json +++ b/types/i18next-sprintf-postprocessor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/i2c-bus/tslint.json b/types/i2c-bus/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/i2c-bus/tslint.json +++ b/types/i2c-bus/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/iban/tslint.json b/types/iban/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/iban/tslint.json +++ b/types/iban/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ibm-mobilefirst/tslint.json b/types/ibm-mobilefirst/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ibm-mobilefirst/tslint.json +++ b/types/ibm-mobilefirst/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/icepick/tslint.json b/types/icepick/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/icepick/tslint.json +++ b/types/icepick/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/icheck/tslint.json b/types/icheck/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/icheck/tslint.json +++ b/types/icheck/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/iconv/tslint.json b/types/iconv/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/iconv/tslint.json +++ b/types/iconv/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ignite-ui/tslint.json b/types/ignite-ui/tslint.json index b8160f687d..26a2f9209a 100644 --- a/types/ignite-ui/tslint.json +++ b/types/ignite-ui/tslint.json @@ -4,6 +4,7 @@ // All are TODOs "array-type": false, "dt-header": false, + "npm-naming": false, "ban-types": false, "callable-types": false, "no-empty-interface": false, diff --git a/types/imagemagick-native/tslint.json b/types/imagemagick-native/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imagemagick-native/tslint.json +++ b/types/imagemagick-native/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/imagemagick/tslint.json b/types/imagemagick/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imagemagick/tslint.json +++ b/types/imagemagick/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/imagemapster/tslint.json b/types/imagemapster/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imagemapster/tslint.json +++ b/types/imagemapster/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/imagesloaded/tslint.json b/types/imagesloaded/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imagesloaded/tslint.json +++ b/types/imagesloaded/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/imap-simple/tslint.json b/types/imap-simple/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imap-simple/tslint.json +++ b/types/imap-simple/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/imap/tslint.json b/types/imap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imap/tslint.json +++ b/types/imap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/imgur-rest-api/tslint.json b/types/imgur-rest-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/imgur-rest-api/tslint.json +++ b/types/imgur-rest-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/impress/tslint.json b/types/impress/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/impress/tslint.json +++ b/types/impress/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/incremental-dom/tslint.json b/types/incremental-dom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/incremental-dom/tslint.json +++ b/types/incremental-dom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/inflected/tslint.json b/types/inflected/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/inflected/tslint.json +++ b/types/inflected/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/inflection/tslint.json b/types/inflection/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/inflection/tslint.json +++ b/types/inflection/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/inherits/tslint.json b/types/inherits/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/inherits/tslint.json +++ b/types/inherits/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ini/tslint.json b/types/ini/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ini/tslint.json +++ b/types/ini/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/iniparser/tslint.json b/types/iniparser/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/iniparser/tslint.json +++ b/types/iniparser/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/inline-css/tslint.json b/types/inline-css/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/inline-css/tslint.json +++ b/types/inline-css/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 74aee08ed3..d61b2adde4 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Inquirer.js +// Type definitions for Inquirer.js 6.x // Project: https://github.com/SBoudrias/Inquirer.js // Definitions by: Qubo // Parvez @@ -9,27 +9,26 @@ // Justin Rockwood // Keith Kelly // Junyoung Clare Jang +// Richard Lea // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 -/// +// TypeScript Version: 2.8 import through = require('through'); +import { Observable } from 'rxjs'; +import * as readline from 'readline'; declare namespace inquirer { - type Prompts = { [name: string]: PromptModule }; + type Prompts = { [name: string]: prompts.Base }; type ChoiceType = string | objects.ChoiceOption | objects.Separator; type Questions = | Question | ReadonlyArray> - | Rx.Observable>; - interface OutputStreamOption { - output: NodeJS.WriteStream - } - interface InputStreamOption { - input: NodeJS.ReadStream - } - type StreamOptions = InputStreamOption | OutputStreamOption | (InputStreamOption & OutputStreamOption); + | Observable>; + type StreamOptions = { + input?: NodeJS.ReadStream, + output?: NodeJS.WriteStream, + }; interface Inquirer { restoreDefaultPrompts(): void; @@ -47,28 +46,25 @@ declare namespace inquirer { /** * Public CLI helper interface * @param questions Questions settings array - * @param cb Callback being passed the user answers * @return */ - prompt(questions: Questions, cb: (answers: T) => any): ui.Prompt; - prompt(questions: Questions): Promise; + prompt: PromptModule; prompts: Prompts; Separator: objects.SeparatorStatic; ui: { BottomBar: ui.BottomBar; - Prompt: ui.Prompt; + Prompt: ui.PromptUI; }; } interface PromptModule { - (questions: Questions): Promise; - (questions: Questions, cb: (answers: T) => any): ui.Prompt; + (questions: Questions): Promise & { ui: ui.PromptUI }; /** * Register a prompt type * @param name Prompt type name * @param prompt Prompt constructor */ - registerPrompt(name: string, prompt: PromptModule): ui.Prompt; + registerPrompt(name: string, prompt: prompts.Base): PromptModule; /** * Register the defaults provider prompts */ @@ -111,9 +107,9 @@ declare namespace inquirer { * (to save in the answers hash). Values can also be a Separator. */ choices?: - | ReadonlyArray - | ((answers: T) => ReadonlyArray) - | ((answers: T) => Promise>); + | ReadonlyArray + | ((answers: T) => ReadonlyArray) + | ((answers: T) => Promise>); /** * Receive the user input and should return true if the value is valid, and an error message (String) * otherwise. If false is returned, a default error message is provided. @@ -161,32 +157,88 @@ declare namespace inquirer { [key: string]: any; } + /** + * Corresponding to the answer object creation in: + * https://github.com/SBoudrias/Inquirer.js/blob/ff075f587ef78504f0eae4ee5ca0656432429026/packages/inquirer/lib/ui/prompt.js#L88 + */ + interface Answer { + name: string, + answer: any, + } + + namespace prompts { + /** + * Base prompt implementation + * Should be extended by prompt types. + * + * @interface Base + */ + interface Base { + new (question: Question, rl: readline.Interface, answers: Answers): Base; + /** + * Start the Inquiry session and manage output value filtering + * + * @returns {Promise} + * @memberof Base + */ + run(): Promise; + /** + * Called when the UI closes. Override to do any specific cleanup necessary + */ + close(): void; + /** + * Generate the prompt question string + */ + getQuestion(): string; + } + } + namespace ui { + /** * Base interface class other can inherits from */ - interface Prompt extends BaseUI { - new (promptModule: Prompts): Prompt; + interface BaseUI { + rl: readline.Interface; + new(opt: StreamOptions): BaseUI; + /** + * Handle the ^C exit + * @return {null} + */ + onForceClose(): void; + /** + * Close the interface and cleanup listeners + */ + close(): void; + } + /** + * Base interface class other can inherits from + */ + interface PromptUI extends BaseUI { + process: Observable; + new(prompts: Prompts, opt: StreamOptions): PromptUI; + run(questions: Questions): Promise; /** * Once all prompt are over */ onCompletion(): void; - processQuestion(question: Question): any; - fetchAnswer(question: Question): any; - setDefaultType(question: Question): any; - filterIfRunnable(question: Question): any; + processQuestion(question: Question): Observable>; + fetchAnswer(question: Question): Observable>; + setDefaultType(question: Question): Observable>; + filterIfRunnable(question: Question): Observable>; } /** * Sticky bottom bar user interface */ - interface BottomBar extends BaseUI { - new (opt?: BottomBarOption): BottomBar; + interface BottomBar extends BaseUI { + new(opt?: StreamOptions & { bottomBar?: string }): BottomBar; /** * Render the prompt to screen * @return self */ render(): BottomBar; + clean(): BottomBar; /** * Update the bottom bar content and rerender * @param bottomBar Bottom bar content @@ -194,10 +246,11 @@ declare namespace inquirer { */ updateBottomBar(bottomBar: string): BottomBar; /** - * Rerender the prompt + * Write out log data + * @param {String} data - The log data to be output * @return self */ - writeLog(data: any): BottomBar; + writeLog(data: string): BottomBar; /** * Make sure line end on a line feed * @param str Input string @@ -212,36 +265,6 @@ declare namespace inquirer { log: through.ThroughStream; } - interface BottomBarOption { - bottomBar?: string; - } - /** - * Base interface class other can inherits from - */ - interface BaseUI { - new (opt: TOpt): void; - /** - * Handle the ^C exit - * @return {null} - */ - onForceClose(): void; - /** - * Close the interface and cleanup listeners - */ - close(): void; - /** - * Handle and propagate keypress events - */ - onKeypress(s: string, key: Key): void; - } - - interface Key { - sequence: string; - name: string; - meta: boolean; - shift: boolean; - ctrl: boolean; - } } namespace objects { diff --git a/types/inquirer/inquirer-tests.ts b/types/inquirer/inquirer-tests.ts index 4c8ba9491f..95f8d442a6 100644 --- a/types/inquirer/inquirer-tests.ts +++ b/types/inquirer/inquirer-tests.ts @@ -3,11 +3,10 @@ import inquirer = require("inquirer"); inquirer.prompt( [ /* Pass your questions in here */ - ], - function(answers: inquirer.Answers) { - // Use user feedback for... whatever!! - } -); + ] +).then((answers: inquirer.Answers) => { + // Use user feedback for... whatever!! +}); // // examples/bottom-bar.js @@ -87,11 +86,10 @@ inquirer.prompt<{ toppings: string }>( return true; } } - ], - function(answers) { - console.log(JSON.stringify(answers, null, " ")); - } -); + ] +).then(answers => { + console.log(JSON.stringify(answers, null, " ")); +}); // // examples/expand.js @@ -134,11 +132,10 @@ inquirer.prompt( } ] } - ], - function(answers: inquirer.Answers) { - console.log(JSON.stringify(answers, null, " ")); - } -); + ] +).then((answers: inquirer.Answers) => { + console.log(JSON.stringify(answers, null, " ")); +}); // // examples/input.js @@ -184,9 +181,9 @@ var questions = [ } ]; -inquirer.prompt(questions, function(answers) { - console.log(JSON.stringify(answers, null, " ")); -}); +inquirer.prompt(questions).then( + answers => console.log(JSON.stringify(answers, null, " ")) +); // // examples/list.js @@ -222,11 +219,10 @@ inquirer.prompt( return val.toLowerCase(); } } - ], - function(answers: inquirer.Answers) { - console.log(JSON.stringify(answers, null, " ")); - } -); + ] +).then((answers: inquirer.Answers) => { + console.log(JSON.stringify(answers, null, " ")); +}); // // examples/long-list.js @@ -263,11 +259,10 @@ inquirer.prompt( paginated: true, choices: choices } - ], - function(answers: inquirer.Answers) { - console.log(JSON.stringify(answers, null, " ")); - } -); + ] +).then((answers: inquirer.Answers) => { + console.log(JSON.stringify(answers, null, " ")); +}); // // examples/nested-call.js @@ -286,16 +281,15 @@ inquirer.prompt( name: "chocolate", message: "What's your favorite chocolate?", choices: ["Mars", "Oh Henry", "Hershey"] - }, - function(answers: inquirer.Answers) { - inquirer.prompt({ - type: "list", - name: "beverage", - message: "And your favorite beverage?", - choices: ["Pepsi", "Coke", "7up", "Mountain Dew", "Red Bull"] - }); } -); +).then((answers: inquirer.Answers) => { + inquirer.prompt({ + type: "list", + name: "beverage", + message: "And your favorite beverage?", + choices: ["Pepsi", "Coke", "7up", "Mountain Dew", "Red Bull"] + }); +}); // // examples/password.js @@ -315,11 +309,10 @@ inquirer.prompt( message: "Enter your git password", name: "password" } - ], - function(answers: inquirer.Answers) { - console.log(JSON.stringify(answers, null, " ")); - } -); + ] +).then((answers: inquirer.Answers) => { + console.log(JSON.stringify(answers, null, " ")); +}); // // examples/pizza.js @@ -421,7 +414,7 @@ var questions2 = [ } ]; -inquirer.prompt(questions, function(answers) { +inquirer.prompt(questions).then(answers => { console.log("\nOrder receipt:"); console.log(JSON.stringify(answers, null, " ")); }); @@ -460,11 +453,10 @@ inquirer.prompt( return val.toLowerCase(); } } - ], - function(answers: inquirer.Answers) { - console.log(JSON.stringify(answers, null, " ")); - } -); + ] +).then((answers: inquirer.Answers) => { + console.log(JSON.stringify(answers, null, " ")); +}); // // examples/recursive.js @@ -495,9 +487,8 @@ var questions3 = [ ]; function ask() { - inquirer.prompt<{ tvShow: string; askAgain: boolean }>(questions3, function( - answers - ) { + inquirer.prompt<{ tvShow: string; askAgain: boolean }>(questions3) + .then((answers) => { output2.push(answers.tvShow); if (answers.askAgain) { ask(); @@ -560,7 +551,7 @@ function likesFood(aFood: string) { }; } -inquirer.prompt(questions, function(answers) { +inquirer.prompt(questions).then(answers => { console.log(JSON.stringify(answers, null, " ")); }); @@ -579,11 +570,10 @@ inquirer.prompt( message: 'What do you want to do?', choices: immutableChoices } - ], - function(answers: inquirer.Answers) { - console.log(JSON.stringify(answers, null, ' ')); - } -); + ] +).then((answers: inquirer.Answers) => { + console.log(JSON.stringify(answers, null, ' ')); +}); // // Other tests not covered in the examples provided with inquirer @@ -667,9 +657,10 @@ var questions = [ } ]; -inquirer.createPromptModule({ output: process.stderr })(questions, function(answers) { - console.log(JSON.stringify(answers, null, " ")); -}); +inquirer.createPromptModule({ output: process.stderr })(questions) + .then(answers => { + console.log(JSON.stringify(answers, null, " ")); + }); // Work with JS inquirer but rejected by typing. inquirer.prompt([ diff --git a/types/inquirer/package.json b/types/inquirer/package.json new file mode 100644 index 0000000000..021b40d754 --- /dev/null +++ b/types/inquirer/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "rxjs": ">=6.4.0" + } +} diff --git a/types/inquirer/tslint.json b/types/inquirer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/inquirer/tslint.json +++ b/types/inquirer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/insight/tslint.json b/types/insight/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/insight/tslint.json +++ b/types/insight/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/intercomjs/tslint.json b/types/intercomjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/intercomjs/tslint.json +++ b/types/intercomjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/intro.js/tslint.json b/types/intro.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/intro.js/tslint.json +++ b/types/intro.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/invariant/tslint.json b/types/invariant/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/invariant/tslint.json +++ b/types/invariant/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/inversify-devtools/tslint.json b/types/inversify-devtools/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/inversify-devtools/tslint.json +++ b/types/inversify-devtools/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/irc/tslint.json b/types/irc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/irc/tslint.json +++ b/types/irc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/is-my-json-valid/tslint.json b/types/is-my-json-valid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/is-my-json-valid/tslint.json +++ b/types/is-my-json-valid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/is-url/tslint.json b/types/is-url/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/is-url/tslint.json +++ b/types/is-url/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/is/tslint.json b/types/is/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/is/tslint.json +++ b/types/is/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/iscroll/tslint.json b/types/iscroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/iscroll/tslint.json +++ b/types/iscroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/iso8601-localizer/tslint.json b/types/iso8601-localizer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/iso8601-localizer/tslint.json +++ b/types/iso8601-localizer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/istanbul-middleware/tslint.json b/types/istanbul-middleware/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/istanbul-middleware/tslint.json +++ b/types/istanbul-middleware/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/istanbul/tslint.json b/types/istanbul/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/istanbul/tslint.json +++ b/types/istanbul/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ix.js/tslint.json b/types/ix.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ix.js/tslint.json +++ b/types/ix.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jade/tslint.json b/types/jade/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jade/tslint.json +++ b/types/jade/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jake/tslint.json b/types/jake/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jake/tslint.json +++ b/types/jake/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jasmine-es6-promise-matchers/tslint.json b/types/jasmine-es6-promise-matchers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jasmine-es6-promise-matchers/tslint.json +++ b/types/jasmine-es6-promise-matchers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jasmine-jquery/tslint.json b/types/jasmine-jquery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jasmine-jquery/tslint.json +++ b/types/jasmine-jquery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jasmine-matchers/tslint.json b/types/jasmine-matchers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jasmine-matchers/tslint.json +++ b/types/jasmine-matchers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jasmine-node/tslint.json b/types/jasmine-node/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jasmine-node/tslint.json +++ b/types/jasmine-node/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jasmine-promise-matchers/tslint.json b/types/jasmine-promise-matchers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jasmine-promise-matchers/tslint.json +++ b/types/jasmine-promise-matchers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/java-applet/tslint.json b/types/java-applet/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/java-applet/tslint.json +++ b/types/java-applet/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/java/tslint.json b/types/java/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/java/tslint.json +++ b/types/java/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/javascript-astar/tslint.json b/types/javascript-astar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/javascript-astar/tslint.json +++ b/types/javascript-astar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/javascript-bignum/tslint.json b/types/javascript-bignum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/javascript-bignum/tslint.json +++ b/types/javascript-bignum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/javascript-obfuscator/tslint.json b/types/javascript-obfuscator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/javascript-obfuscator/tslint.json +++ b/types/javascript-obfuscator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jbinary/tslint.json b/types/jbinary/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jbinary/tslint.json +++ b/types/jbinary/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jcanvas/tslint.json b/types/jcanvas/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jcanvas/tslint.json +++ b/types/jcanvas/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jdataview/tslint.json b/types/jdataview/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jdataview/tslint.json +++ b/types/jdataview/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jdenticon/tslint.json b/types/jdenticon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jdenticon/tslint.json +++ b/types/jdenticon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jee-jsf/tslint.json b/types/jee-jsf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jee-jsf/tslint.json +++ b/types/jee-jsf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jest/tslint.json b/types/jest/tslint.json index 86d51194e9..e7a54c4021 100644 --- a/types/jest/tslint.json +++ b/types/jest/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-mergeable-namespace": false, "no-void-expression": false, "no-unnecessary-generics": false diff --git a/types/jfp/tslint.json b/types/jfp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jfp/tslint.json +++ b/types/jfp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jjv/tslint.json b/types/jjv/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jjv/tslint.json +++ b/types/jjv/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jjve/tslint.json b/types/jjve/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jjve/tslint.json +++ b/types/jjve/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/johnny-five/tslint.json b/types/johnny-five/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/johnny-five/tslint.json +++ b/types/johnny-five/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jpm/tslint.json b/types/jpm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jpm/tslint.json +++ b/types/jpm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jqgrid/tslint.json b/types/jqgrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jqgrid/tslint.json +++ b/types/jqgrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jqrangeslider/tslint.json b/types/jqrangeslider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jqrangeslider/tslint.json +++ b/types/jqrangeslider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-ajax-chain/tslint.json b/types/jquery-ajax-chain/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-ajax-chain/tslint.json +++ b/types/jquery-ajax-chain/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-alertable/tslint.json b/types/jquery-alertable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-alertable/tslint.json +++ b/types/jquery-alertable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-backstretch/tslint.json b/types/jquery-backstretch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-backstretch/tslint.json +++ b/types/jquery-backstretch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-cropbox/tslint.json b/types/jquery-cropbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-cropbox/tslint.json +++ b/types/jquery-cropbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-deparam/tslint.json b/types/jquery-deparam/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-deparam/tslint.json +++ b/types/jquery-deparam/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-easy-loading/tslint.json b/types/jquery-easy-loading/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-easy-loading/tslint.json +++ b/types/jquery-easy-loading/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-fullscreen/tslint.json b/types/jquery-fullscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-fullscreen/tslint.json +++ b/types/jquery-fullscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-galleria/tslint.json b/types/jquery-galleria/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-galleria/tslint.json +++ b/types/jquery-galleria/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-handsontable/tslint.json b/types/jquery-handsontable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-handsontable/tslint.json +++ b/types/jquery-handsontable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-jsonrpcclient/tslint.json b/types/jquery-jsonrpcclient/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-jsonrpcclient/tslint.json +++ b/types/jquery-jsonrpcclient/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-knob/tslint.json b/types/jquery-knob/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-knob/tslint.json +++ b/types/jquery-knob/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-mockjax/tslint.json b/types/jquery-mockjax/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-mockjax/tslint.json +++ b/types/jquery-mockjax/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-mousewheel/tslint.json b/types/jquery-mousewheel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-mousewheel/tslint.json +++ b/types/jquery-mousewheel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-param/tslint.json b/types/jquery-param/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-param/tslint.json +++ b/types/jquery-param/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-sortable/tslint.json b/types/jquery-sortable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-sortable/tslint.json +++ b/types/jquery-sortable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-steps/tslint.json b/types/jquery-steps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-steps/tslint.json +++ b/types/jquery-steps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-timeentry/tslint.json b/types/jquery-timeentry/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-timeentry/tslint.json +++ b/types/jquery-timeentry/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-truncate-html/tslint.json b/types/jquery-truncate-html/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-truncate-html/tslint.json +++ b/types/jquery-truncate-html/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-urlparam/tslint.json b/types/jquery-urlparam/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-urlparam/tslint.json +++ b/types/jquery-urlparam/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery-validation-unobtrusive/tslint.json b/types/jquery-validation-unobtrusive/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery-validation-unobtrusive/tslint.json +++ b/types/jquery-validation-unobtrusive/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.address/tslint.json b/types/jquery.address/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.address/tslint.json +++ b/types/jquery.address/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.are-you-sure/tslint.json b/types/jquery.are-you-sure/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.are-you-sure/tslint.json +++ b/types/jquery.are-you-sure/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.autosize/tslint.json b/types/jquery.autosize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.autosize/tslint.json +++ b/types/jquery.autosize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.base64/tslint.json b/types/jquery.base64/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.base64/tslint.json +++ b/types/jquery.base64/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.bbq/tslint.json b/types/jquery.bbq/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.bbq/tslint.json +++ b/types/jquery.bbq/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.blockui/tslint.json b/types/jquery.blockui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.blockui/tslint.json +++ b/types/jquery.blockui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.bootstrap.wizard/tslint.json b/types/jquery.bootstrap.wizard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.bootstrap.wizard/tslint.json +++ b/types/jquery.bootstrap.wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.cleditor/tslint.json b/types/jquery.cleditor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.cleditor/tslint.json +++ b/types/jquery.cleditor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.clientsidelogging/tslint.json b/types/jquery.clientsidelogging/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.clientsidelogging/tslint.json +++ b/types/jquery.clientsidelogging/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.color/tslint.json b/types/jquery.color/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.color/tslint.json +++ b/types/jquery.color/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.colorbox/tslint.json b/types/jquery.colorbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.colorbox/tslint.json +++ b/types/jquery.colorbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.colorpicker/tslint.json b/types/jquery.colorpicker/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/jquery.colorpicker/tslint.json +++ b/types/jquery.colorpicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.contextmenu/tslint.json b/types/jquery.contextmenu/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.contextmenu/tslint.json +++ b/types/jquery.contextmenu/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.cookie/tslint.json b/types/jquery.cookie/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/jquery.cookie/tslint.json +++ b/types/jquery.cookie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.customselect/tslint.json b/types/jquery.customselect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.customselect/tslint.json +++ b/types/jquery.customselect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.cycle/tslint.json b/types/jquery.cycle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.cycle/tslint.json +++ b/types/jquery.cycle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.cycle2/tslint.json b/types/jquery.cycle2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.cycle2/tslint.json +++ b/types/jquery.cycle2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.dropotron/tslint.json b/types/jquery.dropotron/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.dropotron/tslint.json +++ b/types/jquery.dropotron/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.dynatree/tslint.json b/types/jquery.dynatree/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.dynatree/tslint.json +++ b/types/jquery.dynatree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.elang/tslint.json b/types/jquery.elang/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.elang/tslint.json +++ b/types/jquery.elang/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.fancytree/tslint.json b/types/jquery.fancytree/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/jquery.fancytree/tslint.json +++ b/types/jquery.fancytree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.fileupload/tslint.json b/types/jquery.fileupload/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/jquery.fileupload/tslint.json +++ b/types/jquery.fileupload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.filtertable/tslint.json b/types/jquery.filtertable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.filtertable/tslint.json +++ b/types/jquery.filtertable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.finger/tslint.json b/types/jquery.finger/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.finger/tslint.json +++ b/types/jquery.finger/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.flagstrap/tslint.json b/types/jquery.flagstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.flagstrap/tslint.json +++ b/types/jquery.flagstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.form/tslint.json b/types/jquery.form/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.form/tslint.json +++ b/types/jquery.form/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.fullscreen/tslint.json b/types/jquery.fullscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.fullscreen/tslint.json +++ b/types/jquery.fullscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.gridster/tslint.json b/types/jquery.gridster/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.gridster/tslint.json +++ b/types/jquery.gridster/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.highlight-bartaz/tslint.json b/types/jquery.highlight-bartaz/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.highlight-bartaz/tslint.json +++ b/types/jquery.highlight-bartaz/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.jnotify/tslint.json b/types/jquery.jnotify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.jnotify/tslint.json +++ b/types/jquery.jnotify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.joyride/tslint.json b/types/jquery.joyride/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.joyride/tslint.json +++ b/types/jquery.joyride/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.jsignature/tslint.json b/types/jquery.jsignature/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.jsignature/tslint.json +++ b/types/jquery.jsignature/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.leanmodal/tslint.json b/types/jquery.leanmodal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.leanmodal/tslint.json +++ b/types/jquery.leanmodal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.livestampjs/tslint.json b/types/jquery.livestampjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.livestampjs/tslint.json +++ b/types/jquery.livestampjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.menuaim/tslint.json b/types/jquery.menuaim/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.menuaim/tslint.json +++ b/types/jquery.menuaim/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.mmenu/tslint.json b/types/jquery.mmenu/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.mmenu/tslint.json +++ b/types/jquery.mmenu/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.notifybar/tslint.json b/types/jquery.notifybar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.notifybar/tslint.json +++ b/types/jquery.notifybar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.noty/tslint.json b/types/jquery.noty/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.noty/tslint.json +++ b/types/jquery.noty/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.payment/tslint.json b/types/jquery.payment/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.payment/tslint.json +++ b/types/jquery.payment/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.pjax/tslint.json b/types/jquery.pjax/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/jquery.pjax/tslint.json +++ b/types/jquery.pjax/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.placeholder/tslint.json b/types/jquery.placeholder/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.placeholder/tslint.json +++ b/types/jquery.placeholder/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.pnotify/tslint.json b/types/jquery.pnotify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.pnotify/tslint.json +++ b/types/jquery.pnotify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.postmessage/tslint.json b/types/jquery.postmessage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.postmessage/tslint.json +++ b/types/jquery.postmessage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.prettyphoto/tslint.json b/types/jquery.prettyphoto/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.prettyphoto/tslint.json +++ b/types/jquery.prettyphoto/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.qrcode/tslint.json b/types/jquery.qrcode/tslint.json index b6afb8acee..4017299a0e 100644 --- a/types/jquery.qrcode/tslint.json +++ b/types/jquery.qrcode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.rateit/tslint.json b/types/jquery.rateit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.rateit/tslint.json +++ b/types/jquery.rateit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.rowgrid/tslint.json b/types/jquery.rowgrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.rowgrid/tslint.json +++ b/types/jquery.rowgrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.scrollto/tslint.json b/types/jquery.scrollto/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.scrollto/tslint.json +++ b/types/jquery.scrollto/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.simplemodal/tslint.json b/types/jquery.simplemodal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.simplemodal/tslint.json +++ b/types/jquery.simplemodal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.simplepagination/tslint.json b/types/jquery.simplepagination/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.simplepagination/tslint.json +++ b/types/jquery.simplepagination/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.simulate/tslint.json b/types/jquery.simulate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.simulate/tslint.json +++ b/types/jquery.simulate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.slimscroll/tslint.json b/types/jquery.slimscroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.slimscroll/tslint.json +++ b/types/jquery.slimscroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.sortelements/tslint.json b/types/jquery.sortelements/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.sortelements/tslint.json +++ b/types/jquery.sortelements/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.superlink/tslint.json b/types/jquery.superlink/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.superlink/tslint.json +++ b/types/jquery.superlink/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.tagsmanager/tslint.json b/types/jquery.tagsmanager/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.tagsmanager/tslint.json +++ b/types/jquery.tagsmanager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.tile/tslint.json b/types/jquery.tile/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.tile/tslint.json +++ b/types/jquery.tile/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.timeago/tslint.json b/types/jquery.timeago/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.timeago/tslint.json +++ b/types/jquery.timeago/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.timepicker/tslint.json b/types/jquery.timepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.timepicker/tslint.json +++ b/types/jquery.timepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.timer/tslint.json b/types/jquery.timer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.timer/tslint.json +++ b/types/jquery.timer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.tinycarousel/tslint.json b/types/jquery.tinycarousel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.tinycarousel/tslint.json +++ b/types/jquery.tinycarousel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.tinyscrollbar/tslint.json b/types/jquery.tinyscrollbar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.tinyscrollbar/tslint.json +++ b/types/jquery.tinyscrollbar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.tipsy/tslint.json b/types/jquery.tipsy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.tipsy/tslint.json +++ b/types/jquery.tipsy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.total-storage/tslint.json b/types/jquery.total-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.total-storage/tslint.json +++ b/types/jquery.total-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.transit/tslint.json b/types/jquery.transit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.transit/tslint.json +++ b/types/jquery.transit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.ui.datetimepicker/tslint.json b/types/jquery.ui.datetimepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.ui.datetimepicker/tslint.json +++ b/types/jquery.ui.datetimepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.ui.layout/tslint.json b/types/jquery.ui.layout/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.ui.layout/tslint.json +++ b/types/jquery.ui.layout/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.uniform/tslint.json b/types/jquery.uniform/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.uniform/tslint.json +++ b/types/jquery.uniform/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.watermark/tslint.json b/types/jquery.watermark/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.watermark/tslint.json +++ b/types/jquery.watermark/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery.window/tslint.json b/types/jquery.window/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquery.window/tslint.json +++ b/types/jquery.window/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquerymobile/tslint.json b/types/jquerymobile/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jquerymobile/tslint.json +++ b/types/jquerymobile/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jqueryui/tslint.json b/types/jqueryui/tslint.json index ca9116c788..e44e1809ea 100644 --- a/types/jqueryui/tslint.json +++ b/types/jqueryui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-beautify/tslint.json b/types/js-beautify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-beautify/tslint.json +++ b/types/js-beautify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-clipper/tslint.json b/types/js-clipper/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-clipper/tslint.json +++ b/types/js-clipper/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-combinatorics/tslint.json b/types/js-combinatorics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-combinatorics/tslint.json +++ b/types/js-combinatorics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-data-angular/tslint.json b/types/js-data-angular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-data-angular/tslint.json +++ b/types/js-data-angular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-fixtures/tslint.json b/types/js-fixtures/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-fixtures/tslint.json +++ b/types/js-fixtures/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-git/tslint.json b/types/js-git/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-git/tslint.json +++ b/types/js-git/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-money/tslint.json b/types/js-money/tslint.json index 42522eff7e..8973569ed3 100644 --- a/types/js-money/tslint.json +++ b/types/js-money/tslint.json @@ -3,6 +3,7 @@ "rules": { // All are TODOs "dt-header": false, + "npm-naming": false, "eofline": false, "no-unnecessary-qualifier": false } diff --git a/types/js-priority-queue/tslint.json b/types/js-priority-queue/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-priority-queue/tslint.json +++ b/types/js-priority-queue/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-schema/tslint.json b/types/js-schema/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-schema/tslint.json +++ b/types/js-schema/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-search/tslint.json b/types/js-search/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/js-search/tslint.json +++ b/types/js-search/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/js-url/tslint.json b/types/js-url/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/js-url/tslint.json +++ b/types/js-url/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsbn/tslint.json b/types/jsbn/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsbn/tslint.json +++ b/types/jsbn/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jscrollpane/tslint.json b/types/jscrollpane/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jscrollpane/tslint.json +++ b/types/jscrollpane/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsdeferred/tslint.json b/types/jsdeferred/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsdeferred/tslint.json +++ b/types/jsdeferred/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsen/tslint.json b/types/jsen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsen/tslint.json +++ b/types/jsen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsend/tslint.json b/types/jsend/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsend/tslint.json +++ b/types/jsend/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsesc/tslint.json b/types/jsesc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsesc/tslint.json +++ b/types/jsesc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsfl/tslint.json b/types/jsfl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsfl/tslint.json +++ b/types/jsfl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsgraph/tslint.json b/types/jsgraph/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsgraph/tslint.json +++ b/types/jsgraph/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jshamcrest/tslint.json b/types/jshamcrest/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jshamcrest/tslint.json +++ b/types/jshamcrest/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsmockito/tslint.json b/types/jsmockito/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsmockito/tslint.json +++ b/types/jsmockito/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json-editor/tslint.json b/types/json-editor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/json-editor/tslint.json +++ b/types/json-editor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json-merge-patch/tslint.json b/types/json-merge-patch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/json-merge-patch/tslint.json +++ b/types/json-merge-patch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json-patch-gen/tslint.json b/types/json-patch-gen/tslint.json index ece4c342d1..e72b3d5a6b 100644 --- a/types/json-patch-gen/tslint.json +++ b/types/json-patch-gen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json-patch/tslint.json b/types/json-patch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/json-patch/tslint.json +++ b/types/json-patch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json-pointer/tslint.json b/types/json-pointer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/json-pointer/tslint.json +++ b/types/json-pointer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json-socket/tslint.json b/types/json-socket/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/json-socket/tslint.json +++ b/types/json-socket/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/json5/tslint.json b/types/json5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/json5/tslint.json +++ b/types/json5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsoneditor/tslint.json b/types/jsoneditor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsoneditor/tslint.json +++ b/types/jsoneditor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsoneditoronline/tslint.json b/types/jsoneditoronline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsoneditoronline/tslint.json +++ b/types/jsoneditoronline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsonminify/tslint.json b/types/jsonminify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsonminify/tslint.json +++ b/types/jsonminify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsonnet/tslint.json b/types/jsonnet/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsonnet/tslint.json +++ b/types/jsonnet/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsonpath/tslint.json b/types/jsonpath/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsonpath/tslint.json +++ b/types/jsonpath/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsonstream/tslint.json b/types/jsonstream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsonstream/tslint.json +++ b/types/jsonstream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsrender/tslint.json b/types/jsrender/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsrender/tslint.json +++ b/types/jsrender/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jstimezonedetect/tslint.json b/types/jstimezonedetect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jstimezonedetect/tslint.json +++ b/types/jstimezonedetect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jstorage/tslint.json b/types/jstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jstorage/tslint.json +++ b/types/jstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jstree/tslint.json b/types/jstree/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jstree/tslint.json +++ b/types/jstree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsts/tslint.json b/types/jsts/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsts/tslint.json +++ b/types/jsts/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsuite/tslint.json b/types/jsuite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsuite/tslint.json +++ b/types/jsuite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsuri/tslint.json b/types/jsuri/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsuri/tslint.json +++ b/types/jsuri/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsurl/tslint.json b/types/jsurl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsurl/tslint.json +++ b/types/jsurl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsx-chai/tslint.json b/types/jsx-chai/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jsx-chai/tslint.json +++ b/types/jsx-chai/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jug/tslint.json b/types/jug/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jug/tslint.json +++ b/types/jug/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jwt-client/tslint.json b/types/jwt-client/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jwt-client/tslint.json +++ b/types/jwt-client/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jwt-simple/tslint.json b/types/jwt-simple/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/jwt-simple/tslint.json +++ b/types/jwt-simple/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/karma-chai-sinon/tslint.json b/types/karma-chai-sinon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/karma-chai-sinon/tslint.json +++ b/types/karma-chai-sinon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/karma-coverage/tslint.json b/types/karma-coverage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/karma-coverage/tslint.json +++ b/types/karma-coverage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/karma-jasmine/tslint.json b/types/karma-jasmine/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/karma-jasmine/tslint.json +++ b/types/karma-jasmine/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/katex/tslint.json b/types/katex/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/katex/tslint.json +++ b/types/katex/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/kefir/tslint.json b/types/kefir/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/kefir/tslint.json +++ b/types/kefir/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/kendo-ui/tslint.json b/types/kendo-ui/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/kendo-ui/tslint.json +++ b/types/kendo-ui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/keyboardjs/tslint.json b/types/keyboardjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/keyboardjs/tslint.json +++ b/types/keyboardjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/keymaster/tslint.json b/types/keymaster/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/keymaster/tslint.json +++ b/types/keymaster/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/keymirror/tslint.json b/types/keymirror/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/keymirror/tslint.json +++ b/types/keymirror/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/keytar/tslint.json b/types/keytar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/keytar/tslint.json +++ b/types/keytar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/kii-cloud-sdk/tslint.json b/types/kii-cloud-sdk/tslint.json index 4184ebb791..228bf293f4 100644 --- a/types/kii-cloud-sdk/tslint.json +++ b/types/kii-cloud-sdk/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-unnecessary-class": false, "no-unnecessary-generics": false } diff --git a/types/kik-browser/tslint.json b/types/kik-browser/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/kik-browser/tslint.json +++ b/types/kik-browser/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/kineticjs/tslint.json b/types/kineticjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/kineticjs/tslint.json +++ b/types/kineticjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/klaw/tslint.json b/types/klaw/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/klaw/tslint.json +++ b/types/klaw/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockback/tslint.json b/types/knockback/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockback/tslint.json +++ b/types/knockback/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout-amd-helpers/tslint.json b/types/knockout-amd-helpers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout-amd-helpers/tslint.json +++ b/types/knockout-amd-helpers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout-postbox/tslint.json b/types/knockout-postbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout-postbox/tslint.json +++ b/types/knockout-postbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout-secure-binding/tslint.json b/types/knockout-secure-binding/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout-secure-binding/tslint.json +++ b/types/knockout-secure-binding/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout-transformations/tslint.json b/types/knockout-transformations/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout-transformations/tslint.json +++ b/types/knockout-transformations/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.deferred.updates/tslint.json b/types/knockout.deferred.updates/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.deferred.updates/tslint.json +++ b/types/knockout.deferred.updates/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.editables/tslint.json b/types/knockout.editables/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.editables/tslint.json +++ b/types/knockout.editables/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.es5/tslint.json b/types/knockout.es5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.es5/tslint.json +++ b/types/knockout.es5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.kogrid/tslint.json b/types/knockout.kogrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.kogrid/tslint.json +++ b/types/knockout.kogrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.mapper/tslint.json b/types/knockout.mapper/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.mapper/tslint.json +++ b/types/knockout.mapper/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.mapping/tslint.json b/types/knockout.mapping/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.mapping/tslint.json +++ b/types/knockout.mapping/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.projections/tslint.json b/types/knockout.projections/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.projections/tslint.json +++ b/types/knockout.projections/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.punches/tslint.json b/types/knockout.punches/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.punches/tslint.json +++ b/types/knockout.punches/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.rx/tslint.json b/types/knockout.rx/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.rx/tslint.json +++ b/types/knockout.rx/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.validation/tslint.json b/types/knockout.validation/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.validation/tslint.json +++ b/types/knockout.validation/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout.viewmodel/tslint.json b/types/knockout.viewmodel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockout.viewmodel/tslint.json +++ b/types/knockout.viewmodel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockout/tslint.json b/types/knockout/tslint.json index 9d9f6dd3b9..a1d60043bc 100644 --- a/types/knockout/tslint.json +++ b/types/knockout/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/knockstrap/tslint.json b/types/knockstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/knockstrap/tslint.json +++ b/types/knockstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ko.plus/tslint.json b/types/ko.plus/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ko.plus/tslint.json +++ b/types/ko.plus/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-bouncer/tslint.json b/types/koa-bouncer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-bouncer/tslint.json +++ b/types/koa-bouncer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-compress/tslint.json b/types/koa-compress/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-compress/tslint.json +++ b/types/koa-compress/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-favicon/tslint.json b/types/koa-favicon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-favicon/tslint.json +++ b/types/koa-favicon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-hbs/tslint.json b/types/koa-hbs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-hbs/tslint.json +++ b/types/koa-hbs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-json/tslint.json b/types/koa-json/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-json/tslint.json +++ b/types/koa-json/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-router/tslint.json b/types/koa-router/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-router/tslint.json +++ b/types/koa-router/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa-session-minimal/tslint.json b/types/koa-session-minimal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa-session-minimal/tslint.json +++ b/types/koa-session-minimal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/koa/tslint.json b/types/koa/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/koa/tslint.json +++ b/types/koa/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/kolite/tslint.json b/types/kolite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/kolite/tslint.json +++ b/types/kolite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/konami.js/tslint.json b/types/konami.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/konami.js/tslint.json +++ b/types/konami.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/kue/tslint.json b/types/kue/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/kue/tslint.json +++ b/types/kue/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lab/tslint.json b/types/lab/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lab/tslint.json +++ b/types/lab/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ladda/tslint.json b/types/ladda/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ladda/tslint.json +++ b/types/ladda/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/latinize/tslint.json b/types/latinize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/latinize/tslint.json +++ b/types/latinize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/launchpad/tslint.json b/types/launchpad/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/launchpad/tslint.json +++ b/types/launchpad/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lazy.js/tslint.json b/types/lazy.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lazy.js/tslint.json +++ b/types/lazy.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lazypipe/tslint.json b/types/lazypipe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lazypipe/tslint.json +++ b/types/lazypipe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ldapjs/tslint.json b/types/ldapjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ldapjs/tslint.json +++ b/types/ldapjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/leadfoot/tslint.json b/types/leadfoot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/leadfoot/tslint.json +++ b/types/leadfoot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/leapmotionts/tslint.json b/types/leapmotionts/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/leapmotionts/tslint.json +++ b/types/leapmotionts/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/less-middleware/tslint.json b/types/less-middleware/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/less-middleware/tslint.json +++ b/types/less-middleware/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/less/tslint.json b/types/less/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/less/tslint.json +++ b/types/less/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/level-sublevel/tslint.json b/types/level-sublevel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/level-sublevel/tslint.json +++ b/types/level-sublevel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/levenshtein/tslint.json b/types/levenshtein/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/levenshtein/tslint.json +++ b/types/levenshtein/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lime-js/tslint.json b/types/lime-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lime-js/tslint.json +++ b/types/lime-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/line-reader/tslint.json b/types/line-reader/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/line-reader/tslint.json +++ b/types/line-reader/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lingui__core/i18n.d.ts b/types/lingui__core/i18n.d.ts index a74ae7a7a0..6757b08142 100644 --- a/types/lingui__core/i18n.d.ts +++ b/types/lingui__core/i18n.d.ts @@ -6,6 +6,13 @@ export interface MessageOptions { formats?: object; } +export interface MessageDescriptor { + id: string; + defaults?: string; + values?: object; + formats?: object; +} + export interface LanguageData { plurals?: (n: number, pluralType?: "cardinal" | "ordinal") => string; } @@ -62,6 +69,7 @@ export class I18n { use(language: string): I18n; _(id: string, values?: object, messageOptions?: MessageOptions): string; + _(id: MessageDescriptor): string; pluralForm(n: number, pluralType?: "cardinal" | "ordinal"): string; } diff --git a/types/lingui__core/index.d.ts b/types/lingui__core/index.d.ts index c2243ba558..efb0fed409 100644 --- a/types/lingui__core/index.d.ts +++ b/types/lingui__core/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for @lingui/core 2.2 +// Type definitions for @lingui/core 2.7 // Project: https://lingui.github.io/js-lingui/, https://github.com/lingui/js-lingui // Definitions by: Jeow Li Huan // Definitions: https://github.com/huan086/lingui-typings @@ -9,6 +9,7 @@ export { setupI18n, Catalog, Catalogs, + MessageDescriptor, MessageOptions, LanguageData, I18n diff --git a/types/lingui__core/lingui__core-tests.ts b/types/lingui__core/lingui__core-tests.ts index 09af3e1e4f..69a7a87a6e 100644 --- a/types/lingui__core/lingui__core-tests.ts +++ b/types/lingui__core/lingui__core-tests.ts @@ -4,6 +4,7 @@ import { Catalog, Catalogs, MessageOptions, + MessageDescriptor, LanguageData, I18n, date, @@ -16,6 +17,13 @@ const templateResult: string = i18n.t`${age} years old`; const templateIdResult: string = i18n.t('templateId')`${age} years old`; const translateResult: string = i18n._('age', { age }, { defaults: '{age} years old' }); +const descriptorBasicResult = i18n._({ id: 'basicDescriptor' }); +const descriptorResult = i18n._({ + id: 'ageDescriptor', + defaults: '{age} years old', + values: { age } +}); + const count = 42; const pluralResult: string = i18n.plural({ diff --git a/types/lingui__macro/index.d.ts b/types/lingui__macro/index.d.ts index e433b43ec7..8a6679323d 100644 --- a/types/lingui__macro/index.d.ts +++ b/types/lingui__macro/index.d.ts @@ -4,30 +4,31 @@ // Definitions: https://github.com/huan086/lingui-typings // TypeScript Version: 2.8 +import { MessageDescriptor } from '@lingui/core'; import { ComponentClass } from 'react'; import { FormatPropsWithoutI18n } from './createFormat'; import { SelectProps, PluralProps } from "./select"; // JS -export function t(strings: TemplateStringsArray, ...values: any[]): string; +export function t(strings: TemplateStringsArray, ...values: any[]): MessageDescriptor; -export function t(id: string): (strings: TemplateStringsArray, ...values: any[]) => string; +export function t(id: string): (strings: TemplateStringsArray, ...values: any[]) => MessageDescriptor; -export function select(config: SelectProps): string; +export function select(config: SelectProps): MessageDescriptor; -export function select(id: string, config: SelectProps): string; +export function select(id: string, config: SelectProps): MessageDescriptor; -export function plural(config: PluralProps): string; +export function plural(config: PluralProps): MessageDescriptor; -export function plural(id: string, config: PluralProps): string; +export function plural(id: string, config: PluralProps): MessageDescriptor; -export function selectOrdinal(config: PluralProps): string; +export function selectOrdinal(config: PluralProps): MessageDescriptor; -export function selectOrdinal(id: string, config: PluralProps): string; +export function selectOrdinal(id: string, config: PluralProps): MessageDescriptor; -export function date(value: Date, format?: Intl.DateTimeFormatOptions): string; +export function date(value: Date, format?: Intl.DateTimeFormatOptions): MessageDescriptor; -export function number(value: number, format?: Intl.NumberFormatOptions): string; +export function number(value: number, format?: Intl.NumberFormatOptions): MessageDescriptor; // JSX export { default as Trans } from './Trans'; diff --git a/types/lingui__macro/lingui__macro-tests.tsx b/types/lingui__macro/lingui__macro-tests.tsx index a60c5fd2d7..583729e9bc 100644 --- a/types/lingui__macro/lingui__macro-tests.tsx +++ b/types/lingui__macro/lingui__macro-tests.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { MessageDescriptor } from '@lingui/core'; import { t, select, @@ -16,25 +17,25 @@ import { // JS const age = 12; -const templateResult: string = t`${age} years old`; -const templateIdResult: string = t('templateId')`${age} years old`; +const templateResult: MessageDescriptor = t`${age} years old`; +const templateIdResult: MessageDescriptor = t('templateId')`${age} years old`; const count = 42; -const pluralResult: string = plural({ +const pluralResult: MessageDescriptor = plural({ value: count, 0: 'no books', one: '# book', other: '# books' }); -const pluralIdResult: string = plural('pluralId', { +const pluralIdResult: MessageDescriptor = plural('pluralId', { value: count, 0: 'no books', one: '# book', other: '# books' }); -const selectOrdinalResult: string = selectOrdinal({ +const selectOrdinalResult: MessageDescriptor = selectOrdinal({ value: count, 0: 'Zeroth book', one: '#st book', @@ -42,7 +43,7 @@ const selectOrdinalResult: string = selectOrdinal({ few: '#rd book', other: '#th book' }); -const selectOrdinalIdResult: string = selectOrdinal('selectOrdinalId', { +const selectOrdinalIdResult: MessageDescriptor = selectOrdinal('selectOrdinalId', { value: count, 0: 'Zeroth book', one: '#st book', @@ -60,10 +61,10 @@ const selectResult = select({ female: plural({ value: numOfGuests, offset: 1, - 0: t`${host} does not give a party.`, - 1: t`${host} invites ${guest} to her party.`, - 2: t`${host} invites ${guest} and one other person to her party.`, - other: t`${host} invites ${guest} and # other people to her party.` + 0: `${host} does not give a party.`, + 1: `${host} invites ${guest} to her party.`, + 2: `${host} invites ${guest} and one other person to her party.`, + other: `${host} invites ${guest} and # other people to her party.` }), male: 'male', other: 'other' @@ -76,8 +77,8 @@ const selectIdResult = select('selectId', { other: 'other' }); -const formattedDate: string = date(new Date(), { timeZone: 'UTC' }); -const formattedNumber: string = number(1234.56, { style: 'currency', currency: 'EUR' }); +const formattedDate: MessageDescriptor = date(new Date(), { timeZone: 'UTC' }); +const formattedNumber: MessageDescriptor = number(1234.56, { style: 'currency', currency: 'EUR' }); // JSX const App = () => { diff --git a/types/lingui__macro/select.d.ts b/types/lingui__macro/select.d.ts index 6a2eb51db9..a182ace000 100644 --- a/types/lingui__macro/select.d.ts +++ b/types/lingui__macro/select.d.ts @@ -1,11 +1,13 @@ +import { MessageDescriptor } from "@lingui/core"; + export interface PluralForms { - zero?: string; - one?: string; - two?: string; - few?: string; - many?: string; - other: string; - [exact: number]: string; + zero?: string | MessageDescriptor; + one?: string | MessageDescriptor; + two?: string | MessageDescriptor; + few?: string | MessageDescriptor; + many?: string | MessageDescriptor; + other: string | MessageDescriptor; + [exact: number]: string | MessageDescriptor; } export interface PluralProps extends PluralForms { @@ -15,6 +17,6 @@ export interface PluralProps extends PluralForms { export interface SelectProps { value: string; - other: string; - [selectForm: string]: string; + other: string | MessageDescriptor; + [selectForm: string]: string | MessageDescriptor; } diff --git a/types/lingui__macro/tsconfig.json b/types/lingui__macro/tsconfig.json index 5d58b08dad..82f2639036 100644 --- a/types/lingui__macro/tsconfig.json +++ b/types/lingui__macro/tsconfig.json @@ -20,6 +20,9 @@ "paths": { "@lingui/macro": [ "lingui__macro" + ], + "@lingui/core": [ + "lingui__core" ] } }, diff --git a/types/lls/tslint.json b/types/lls/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lls/tslint.json +++ b/types/lls/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/loader-runner/tslint.json b/types/loader-runner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/loader-runner/tslint.json +++ b/types/loader-runner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lobibox/tslint.json b/types/lobibox/tslint.json index 22ecc7ce6f..af76f91db4 100644 --- a/types/lobibox/tslint.json +++ b/types/lobibox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lockr/tslint.json b/types/lockr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lockr/tslint.json +++ b/types/lockr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/locutus/tslint.json b/types/locutus/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/locutus/tslint.json +++ b/types/locutus/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/logg/tslint.json b/types/logg/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/logg/tslint.json +++ b/types/logg/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/loggly/tslint.json b/types/loggly/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/loggly/tslint.json +++ b/types/loggly/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/logrotate-stream/tslint.json b/types/logrotate-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/logrotate-stream/tslint.json +++ b/types/logrotate-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lokijs/tslint.json b/types/lokijs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lokijs/tslint.json +++ b/types/lokijs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lolex/tslint.json b/types/lolex/tslint.json index 2fd2e55629..67fd12a0f5 100644 --- a/types/lolex/tslint.json +++ b/types/lolex/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/long/tslint.json b/types/long/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/long/tslint.json +++ b/types/long/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lory.js/tslint.json b/types/lory.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lory.js/tslint.json +++ b/types/lory.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lowlight/tslint.json b/types/lowlight/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lowlight/tslint.json +++ b/types/lowlight/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lscache/tslint.json b/types/lscache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lscache/tslint.json +++ b/types/lscache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/luaparse/tslint.json b/types/luaparse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/luaparse/tslint.json +++ b/types/luaparse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/lwip/tslint.json b/types/lwip/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/lwip/tslint.json +++ b/types/lwip/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/magic-number/tslint.json b/types/magic-number/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/magic-number/tslint.json +++ b/types/magic-number/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/magicsuggest/tslint.json b/types/magicsuggest/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/magicsuggest/tslint.json +++ b/types/magicsuggest/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mailcheck/tslint.json b/types/mailcheck/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mailcheck/tslint.json +++ b/types/mailcheck/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/maildev/tslint.json b/types/maildev/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/maildev/tslint.json +++ b/types/maildev/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/main-bower-files/tslint.json b/types/main-bower-files/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/main-bower-files/tslint.json +++ b/types/main-bower-files/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mainloop.js/tslint.json b/types/mainloop.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mainloop.js/tslint.json +++ b/types/mainloop.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/maker.js/tslint.json b/types/maker.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/maker.js/tslint.json +++ b/types/maker.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mandrill-api/tslint.json b/types/mandrill-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mandrill-api/tslint.json +++ b/types/mandrill-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mapbox-gl/tslint.json b/types/mapbox-gl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mapbox-gl/tslint.json +++ b/types/mapbox-gl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mapsjs/tslint.json b/types/mapsjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mapsjs/tslint.json +++ b/types/mapsjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mariasql/tslint.json b/types/mariasql/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mariasql/tslint.json +++ b/types/mariasql/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/markdown-it/tslint.json b/types/markdown-it/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/markdown-it/tslint.json +++ b/types/markdown-it/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/marker-animate-unobtrusive/tslint.json b/types/marker-animate-unobtrusive/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/marker-animate-unobtrusive/tslint.json +++ b/types/marker-animate-unobtrusive/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/markitup/tslint.json b/types/markitup/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/markitup/tslint.json +++ b/types/markitup/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/maskedinput/tslint.json b/types/maskedinput/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/maskedinput/tslint.json +++ b/types/maskedinput/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/match-media-mock/tslint.json b/types/match-media-mock/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/match-media-mock/tslint.json +++ b/types/match-media-mock/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/material-design-lite/tslint.json b/types/material-design-lite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/material-design-lite/tslint.json +++ b/types/material-design-lite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/material-ui-pagination/tslint.json b/types/material-ui-pagination/tslint.json index 3b5bb97e03..1735f3a66f 100644 --- a/types/material-ui-pagination/tslint.json +++ b/types/material-ui-pagination/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-duplicate-imports": false, "use-default-type-parameter": false } diff --git a/types/mathjax/tslint.json b/types/mathjax/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mathjax/tslint.json +++ b/types/mathjax/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/matter-js/tslint.json b/types/matter-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/matter-js/tslint.json +++ b/types/matter-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mcustomscrollbar/tslint.json b/types/mcustomscrollbar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mcustomscrollbar/tslint.json +++ b/types/mcustomscrollbar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/md5/tslint.json b/types/md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/md5/tslint.json +++ b/types/md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mdns/tslint.json b/types/mdns/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mdns/tslint.json +++ b/types/mdns/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/medium-editor/tslint.json b/types/medium-editor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/medium-editor/tslint.json +++ b/types/medium-editor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/memory-fs/tslint.json b/types/memory-fs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/memory-fs/tslint.json +++ b/types/memory-fs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/memwatch-next/tslint.json b/types/memwatch-next/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/memwatch-next/tslint.json +++ b/types/memwatch-next/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/menubar/tslint.json b/types/menubar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/menubar/tslint.json +++ b/types/menubar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meshblu/tslint.json b/types/meshblu/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meshblu/tslint.json +++ b/types/meshblu/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mess/tslint.json b/types/mess/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mess/tslint.json +++ b/types/mess/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/messenger/tslint.json b/types/messenger/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/messenger/tslint.json +++ b/types/messenger/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor-accounts-phone/tslint.json b/types/meteor-accounts-phone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor-accounts-phone/tslint.json +++ b/types/meteor-accounts-phone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor-jboulhous-dev/tslint.json b/types/meteor-jboulhous-dev/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor-jboulhous-dev/tslint.json +++ b/types/meteor-jboulhous-dev/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor-persistent-session/tslint.json b/types/meteor-persistent-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor-persistent-session/tslint.json +++ b/types/meteor-persistent-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor-prime8consulting-oauth2/tslint.json b/types/meteor-prime8consulting-oauth2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor-prime8consulting-oauth2/tslint.json +++ b/types/meteor-prime8consulting-oauth2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor-publish-composite/tslint.json b/types/meteor-publish-composite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor-publish-composite/tslint.json +++ b/types/meteor-publish-composite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor-roles/tslint.json b/types/meteor-roles/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor-roles/tslint.json +++ b/types/meteor-roles/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/meteor/tslint.json b/types/meteor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/meteor/tslint.json +++ b/types/meteor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/method-override/tslint.json b/types/method-override/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/method-override/tslint.json +++ b/types/method-override/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/metric-suffix/tslint.json b/types/metric-suffix/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/metric-suffix/tslint.json +++ b/types/metric-suffix/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/microsoft-ajax/tslint.json b/types/microsoft-ajax/tslint.json index 529accfb4e..74158a19aa 100644 --- a/types/microsoft-ajax/tslint.json +++ b/types/microsoft-ajax/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/microsoft-live-connect/tslint.json b/types/microsoft-live-connect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/microsoft-live-connect/tslint.json +++ b/types/microsoft-live-connect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/microsoft-sdk-soap/tslint.json b/types/microsoft-sdk-soap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/microsoft-sdk-soap/tslint.json +++ b/types/microsoft-sdk-soap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/milkcocoa/tslint.json b/types/milkcocoa/tslint.json index 22ecc7ce6f..af76f91db4 100644 --- a/types/milkcocoa/tslint.json +++ b/types/milkcocoa/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/milliseconds/tslint.json b/types/milliseconds/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/milliseconds/tslint.json +++ b/types/milliseconds/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mime-db/tslint.json b/types/mime-db/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mime-db/tslint.json +++ b/types/mime-db/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mimos/tslint.json b/types/mimos/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mimos/tslint.json +++ b/types/mimos/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/minilog/tslint.json b/types/minilog/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/minilog/tslint.json +++ b/types/minilog/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/minimist/tslint.json b/types/minimist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/minimist/tslint.json +++ b/types/minimist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mitm/tslint.json b/types/mitm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mitm/tslint.json +++ b/types/mitm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mixto/tslint.json b/types/mixto/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mixto/tslint.json +++ b/types/mixto/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mkpath/tslint.json b/types/mkpath/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mkpath/tslint.json +++ b/types/mkpath/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mmmagic/tslint.json b/types/mmmagic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mmmagic/tslint.json +++ b/types/mmmagic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mocha-phantomjs/tslint.json b/types/mocha-phantomjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mocha-phantomjs/tslint.json +++ b/types/mocha-phantomjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mock-fs/tslint.json b/types/mock-fs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mock-fs/tslint.json +++ b/types/mock-fs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mock-require/tslint.json b/types/mock-require/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mock-require/tslint.json +++ b/types/mock-require/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mockery/tslint.json b/types/mockery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mockery/tslint.json +++ b/types/mockery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mockjs/tslint.json b/types/mockjs/tslint.json index faeaedf2e5..401697e6a2 100644 --- a/types/mockjs/tslint.json +++ b/types/mockjs/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "dt-header": false, + "npm-naming": false, "export-just-namespace": false, "no-bad-reference": true } diff --git a/types/moment-jalaali/tslint.json b/types/moment-jalaali/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/moment-jalaali/tslint.json +++ b/types/moment-jalaali/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-auto-increment/tslint.json b/types/mongoose-auto-increment/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-auto-increment/tslint.json +++ b/types/mongoose-auto-increment/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-deep-populate/tslint.json b/types/mongoose-deep-populate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-deep-populate/tslint.json +++ b/types/mongoose-deep-populate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-mock/tslint.json b/types/mongoose-mock/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-mock/tslint.json +++ b/types/mongoose-mock/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-paginate/tslint.json b/types/mongoose-paginate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-paginate/tslint.json +++ b/types/mongoose-paginate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-promise/tslint.json b/types/mongoose-promise/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-promise/tslint.json +++ b/types/mongoose-promise/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-seeder/tslint.json b/types/mongoose-seeder/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-seeder/tslint.json +++ b/types/mongoose-seeder/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose-sequence/tslint.json b/types/mongoose-sequence/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mongoose-sequence/tslint.json +++ b/types/mongoose-sequence/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mongoose/tslint.json b/types/mongoose/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/mongoose/tslint.json +++ b/types/mongoose/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/morris.js/tslint.json b/types/morris.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/morris.js/tslint.json +++ b/types/morris.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mousetrap/tslint.json b/types/mousetrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mousetrap/tslint.json +++ b/types/mousetrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/moviedb/tslint.json b/types/moviedb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/moviedb/tslint.json +++ b/types/moviedb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mpromise/tslint.json b/types/mpromise/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mpromise/tslint.json +++ b/types/mpromise/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ms/tslint.json b/types/ms/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ms/tslint.json +++ b/types/ms/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/msgpack/tslint.json b/types/msgpack/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/msgpack/tslint.json +++ b/types/msgpack/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/msgpack5/tslint.json b/types/msgpack5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/msgpack5/tslint.json +++ b/types/msgpack5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/msnodesql/tslint.json b/types/msnodesql/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/msnodesql/tslint.json +++ b/types/msnodesql/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/msportalfx-test/tslint.json b/types/msportalfx-test/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/msportalfx-test/tslint.json +++ b/types/msportalfx-test/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index 085ab122c1..4c12f876c1 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -7,6 +7,7 @@ // Jørgen Elgaard Larsen // Peter Keuter // David Gasperoni +// Jeff Wooden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -281,6 +282,8 @@ export declare class Request extends events.EventEmitter { public bulk(table: Table): Promise; public bulk(table: Table, callback: (err: Error, rowCount: any) => void): void; public cancel(): void; + public pause(): boolean; + public resume(): boolean; } export declare class RequestError implements Error { diff --git a/types/mssql/tslint.json b/types/mssql/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mssql/tslint.json +++ b/types/mssql/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mu2/tslint.json b/types/mu2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mu2/tslint.json +++ b/types/mu2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/multiparty/tslint.json b/types/multiparty/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/multiparty/tslint.json +++ b/types/multiparty/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/multiplexjs/tslint.json b/types/multiplexjs/tslint.json index ece4c342d1..e72b3d5a6b 100644 --- a/types/multiplexjs/tslint.json +++ b/types/multiplexjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/murmurhash-js/tslint.json b/types/murmurhash-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/murmurhash-js/tslint.json +++ b/types/murmurhash-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/murmurhash3js/tslint.json b/types/murmurhash3js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/murmurhash3js/tslint.json +++ b/types/murmurhash3js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/musicmetadata/tslint.json b/types/musicmetadata/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/musicmetadata/tslint.json +++ b/types/musicmetadata/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mustache/tslint.json b/types/mustache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mustache/tslint.json +++ b/types/mustache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/mz/tslint.json b/types/mz/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/mz/tslint.json +++ b/types/mz/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nanoajax/tslint.json b/types/nanoajax/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nanoajax/tslint.json +++ b/types/nanoajax/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nanp/tslint.json b/types/nanp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nanp/tslint.json +++ b/types/nanp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/natural-sort/tslint.json b/types/natural-sort/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/natural-sort/tslint.json +++ b/types/natural-sort/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/natural/tslint.json b/types/natural/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/natural/tslint.json +++ b/types/natural/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ncp/tslint.json b/types/ncp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ncp/tslint.json +++ b/types/ncp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ndn-js/blob.d.ts b/types/ndn-js/blob.d.ts new file mode 100644 index 0000000000..9b3d56bb67 --- /dev/null +++ b/types/ndn-js/blob.d.ts @@ -0,0 +1,20 @@ +export class Blob { + constructor(value?: Blob); + constructor(value: Buffer, copy?: boolean); + constructor(value: ReadonlyArray|string); + + buf(): Buffer; + equals(other: Blob): boolean; + isNull(): boolean; + size(): number; +} + +export class SignedBlob extends Blob { + constructor(); + constructor(value: Blob|Buffer|ReadonlyArray, signedPortionBeginOffset: number, signedPortionEndOffset: number); + + getSignedPortionBeginOffset(): number; + getSignedPortionEndOffset(): number; + signedBuf(): Buffer; + signedSize(): number; +} diff --git a/types/ndn-js/data.d.ts b/types/ndn-js/data.d.ts new file mode 100644 index 0000000000..9d6c03cda1 --- /dev/null +++ b/types/ndn-js/data.d.ts @@ -0,0 +1,46 @@ +import { Blob } from "./blob"; +import { Name } from "./name"; +import { Signature } from "./signature"; + +export class Data { + constructor(name?: Name|string); + constructor(data: Data); + + getName(): Name; + getFullName(): Name; + getMetaInfo(): MetaInfo; + getContent(): Blob; + getSignature(): Signature; + getCongestionMark(): number; + getIncomingFaceId(): number; + + setName(name: Name): Data; + setMetaInfo(meta: MetaInfo): Data; + setContent(content: Blob|Buffer): Data; + setSignature(sig: Signature): Data; + + wireDecode(input: Blob|Buffer): void; + wireEncode(): Blob; +} + +export enum ContentType { + BLOB = 0, + LINK = 1, + KEY = 2, + NACK = 3, + OTHER_CODE = 0x7fff, +} + +export class MetaInfo { + constructor(meta?: MetaInfo); + + getType(): ContentType; + getOtherTypeCode(): number; + getFreshnessPeriod(): number; + getFinalBlockId(): Name.Component; + + setType(type: ContentType): void; + setOtherTypeCode(otherTypeCode: number): void; + setFreshnessPeriod(freshness: number): void; + setFinalBlockId(comp: Name.Component): void; +} diff --git a/types/ndn-js/face.d.ts b/types/ndn-js/face.d.ts new file mode 100644 index 0000000000..09a8a84981 --- /dev/null +++ b/types/ndn-js/face.d.ts @@ -0,0 +1,62 @@ +import { Blob } from "./blob"; +import { Data } from "./data"; +import { Interest } from "./interest"; +import { KeyChain } from "./key-chain"; +import { Name } from "./name"; +import { NetworkNack } from "./network-nack"; +import { Transport, TransportConnectionInfo } from "./transport"; + +export interface FaceCtorOptions { + getTransport?: () => Transport; + getConnectionInfo?: () => TransportConnectionInfo; + connectionInfo?: TransportConnectionInfo|null; + host?: string|null; + port?: number|null; +} + +export type OnInterestCallback = (prefix: Name, interest: Interest, face: Face, filterId: number, filter: InterestFilter) => any; + +export class Face { + constructor(transport: Transport, connectionInfo: TransportConnectionInfo); + constructor(settings?: FaceCtorOptions); + + expressInterest(interest: Interest|Name, + onData: (interest: Interest, data: Data) => any, + onTimeout?: (interest: Interest) => any, + onNetworkNack?: (interest: Interest, nack: NetworkNack) => any): number; + expressInterest(name: Name, + interestTemplate: Interest, + onData: (interest: Interest, data: Data) => any, + onTimeout?: (interest: Interest) => any, + onNetworkNack?: (interest: Interest, nack: NetworkNack) => any): number; + + static getMaxNdnPacketSize(): number; + putData(data: Data): void; + + registerPrefix(prefix: Name, + onInterest: OnInterestCallback, + onRegisterFailed: (prefix: Name) => any, + onRegisterSuccess?: (prefix: Name, registeredPrefixId: number) => any, + flags?: ForwardingFlags): number; + + removePendingInterest(id: number): void; + removeRegisteredPrefix(id: number): void; + send(encoding: Blob|Buffer): void; + setCommandCertificateName(certificateName: Name): void; + setCommandSigningInfo(keyChain: KeyChain, certificateName: Name): void; + setInterestFilter(filter: InterestFilter|Name, onInterest: OnInterestCallback): number; + unsetInterestFilter(id: number): void; +} + +// no declaration because this type is rarely used +export class ForwardingFlags {} + +export class InterestFilter { + constructor(filter: InterestFilter); + constructor(prefix: Name|string, regexFilter?: string); + + doesMatch(name: Name): boolean; + getPrefix(): Name; + getRegexFilter(): string; + hasRegexFilter(): boolean; +} diff --git a/types/ndn-js/index.d.ts b/types/ndn-js/index.d.ts new file mode 100644 index 0000000000..0e584e9297 --- /dev/null +++ b/types/ndn-js/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for ndn-js 0.18 +// Project: https://github.com/named-data/ndn-js +// Definitions by: Junxiao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace ndn; +export * from "./blob"; +export * from "./data"; +export * from "./face"; +export * from "./interest"; +export * from "./key-chain"; +export * from "./memory-content-cache"; +export * from "./name"; +export * from "./network-nack"; +export * from "./signature"; +export * from "./transport"; diff --git a/types/ndn-js/interest.d.ts b/types/ndn-js/interest.d.ts new file mode 100644 index 0000000000..20dd23c9a0 --- /dev/null +++ b/types/ndn-js/interest.d.ts @@ -0,0 +1,49 @@ +import { Blob } from "./blob"; +import { Data } from "./data"; +import { Name } from "./name"; + +export class Interest { + constructor(name?: Name|string); + constructor(interest: Interest); + + getName(): Name; + getCanBePrefix(): boolean; + getMustBeFresh(): boolean; + getForwardingHint(): DelegationSet; + getNonce(): Blob; + getInterestLifetimeMilliseconds(): number; + getApplicationParameters(): Blob; + getIncomingFaceId(): number; + + setName(name: Name): Interest; + setCanBePrefix(canBePrefix: boolean): Interest; + setMustBeFresh(mustBeFresh: boolean): Interest; + setForwardingHint(fh: DelegationSet): Interest; + setInterestLifetimeMilliseconds(lifetime: number): Interest; + setApplicationParameters(parameters: Blob|Buffer): Interest; + + appendParametersDigestToName(): Interest; + matchesData(data: Data): boolean; + matchesName(name: Name): boolean; + refreshNonce(): void; + toUri(): string; + wireDecode(input: Blob|Buffer): void; + wireEncode(): Blob; +} + +export class DelegationSet { + size(): number; + get(i: number): DelegationSet.Delegation; + find(name: Name): number; + + add(preference: number, name: Name): void; + remove(name: Name): boolean; + clear(): void; +} + +export namespace DelegationSet { + class Delegation { + getPreference(): number; + getName(): Name; + } +} diff --git a/types/ndn-js/key-chain.d.ts b/types/ndn-js/key-chain.d.ts new file mode 100644 index 0000000000..f2ad3612a5 --- /dev/null +++ b/types/ndn-js/key-chain.d.ts @@ -0,0 +1,58 @@ +import { Data } from "./data"; +import { Interest } from "./interest"; +import { Name } from "./name"; + +export class KeyChain { + constructor(); + constructor(pibLocator: string, tpmLocator: string, allowReset?: boolean); + + static getDefaultKeyParams(): KeyParams; + getPib(): Pib; + getTpm(): Tpm; + + createIdentityV2(identityName: Name, params?: KeyParams): PibIdentity; + createIdentityV2(identityName: Name, onComplete: (identity: PibIdentity) => any, onError?: (err: any) => any): void; + createIdentityV2(identityName: Name, params: KeyParams, onComplete: (identity: PibIdentity) => any, onError?: (err: any) => any): void; + deleteIdentity(identity: PibIdentity, onComplete?: () => any, onError?: (err: any) => any): void; + setDefaultIdentity(identity: PibIdentity, onComplete?: () => any, onError?: (err: any) => any): void; + + createKey(identity: PibIdentity, params?: KeyParams): PibKey; + createKey(identity: PibIdentity, onComplete: (key: PibKey) => any, onError?: (err: any) => any): void; + createKey(identity: PibIdentity, params: KeyParams, onComplete: (key: PibKey) => any, onError?: (err: any) => any): void; + deleteKey(identity: PibIdentity, key: PibKey, onComplete?: () => any, onError?: (err: any) => any): void; + setDefaultKey(identity: PibIdentity, key: PibKey, onComplete?: () => any, onError?: (err: any) => any): void; + + addCertificate(key: PibKey, certificate: CertificateV2, onComplete?: () => any, onError?: (err: any) => any): void; + deleteCertificate(key: PibKey, certificateName: Name, onComplete?: () => any, onError?: (err: any) => any): void; + setDefaultCertificate(key: PibKey, certificate: CertificateV2, onComplete?: () => any, onError?: (err: any) => any): void; + + sign(interest: Interest, params: SigningInfo, onComplete?: (interest: Interest) => any, onError?: (err: any) => any): void; + sign(data: Data, params: SigningInfo, onComplete?: (data: Data) => any, onError?: (err: any) => any): void; + signWithSha256(packet: Data|Interest): void; +} + +// no declaration because these types are rarely used +export class Pib {} +export class PibIdentity {} +export class PibKey {} +export class KeyParams {} +export class CertificateV2 {} +export class Tpm {} + +export class SigningInfo { + constructor(signerType: SigningInfo.SignerType, signerName: Name); + constructor(arg?: SigningInfo|PibIdentity|PibKey|string); + + getSignerType(): SigningInfo.SignerType; + getSignerName(): Name; +} + +export namespace SigningInfo { + enum SignerType { + NULL = 0, + ID = 1, + KEY = 2, + CERT = 3, + SHA256 = 4, + } +} diff --git a/types/ndn-js/memory-content-cache.d.ts b/types/ndn-js/memory-content-cache.d.ts new file mode 100644 index 0000000000..75c47419c0 --- /dev/null +++ b/types/ndn-js/memory-content-cache.d.ts @@ -0,0 +1,19 @@ +import { Data } from "./data"; +import { Face, ForwardingFlags, InterestFilter, OnInterestCallback } from "./face"; +import { Interest } from "./interest"; +import { Name } from "./name"; + +export class MemoryContentCache { + constructor(face: Face, cleanupIntervalMilliseconds?: number); + + add(data: Data): void; + getMinimumCacheLifetime(): number; + getStorePendingInterest(): OnInterestCallback; + registerPrefix(name: Name, onRegisterFailed: (prefix: Name) => any, + onRegisterSuccess?: (prefix: Name, registeredPrefixId: number) => any, + onDataNotFound?: OnInterestCallback, flags?: ForwardingFlags): void; + setInterestFilter(filter: InterestFilter|Name, onDataNotFound?: OnInterestCallback): void; + setMinimumCacheLifetime(minimumCacheLifetime: number): void; + storePendingInterest(interest: Interest, face: Face): void; + unregisterAll(): void; +} diff --git a/types/ndn-js/name.d.ts b/types/ndn-js/name.d.ts new file mode 100644 index 0000000000..9b4d38733d --- /dev/null +++ b/types/ndn-js/name.d.ts @@ -0,0 +1,87 @@ +import { Blob } from "./blob"; + +export enum ComponentType { + IMPLICIT_SHA256_DIGEST = 1, + PARAMETERS_SHA256_DIGEST = 2, + GENERIC = 8, + OTHER_CODE = 0x7fff, +} + +export type CompareResult = -1|0|1; + +export namespace Name { + class Component { + constructor(value?: ReadonlyArray|ArrayBuffer|Uint8Array|string|Blob, type?: ComponentType, otherTypeCode?: number); + constructor(component: Component); + + compare(other: Component): CompareResult; + equals(other: Component): boolean; + static fromImplicitSha256Digest(digest: Blob): Component; + static fromParametersSha256Digest(digest: Blob): Component; + getOtherTypeCode(): number; + getSuccessor(): Component; + getType(): ComponentType; + getValue(): Blob; + isGeneric(): boolean; + isImplicitSha256Digest(): boolean; + isParametersSha256Digest(): boolean; + toEscapedString(): string; + + static fromNumber(number: number, type?: ComponentType, otherTypeCode?: number): Component; + static fromNumberWithMarker(number: number, marker: number): Component; + static fromSegment(segment: number): Component; + static fromSegmentOffset(segmentOffset: number): Component; + static fromSequenceNumber(sequenceNumber: number): Component; + static fromTimestamp(timestamp: number): Component; + static fromVersion(version: number): Component; + + isSegment(): boolean; + isSegmentOffset(): boolean; + isSequenceNumber(): boolean; + isTimestamp(): boolean; + isVersion(): boolean; + + toNumber(): number; + toNumberWithMarker(marker: number): number; + toSegment(): number; + toSegmentOffset(): number; + toSequenceNumber(): number; + toTimestamp(): number; + toVersion(): number; + } +} + +export class Name { + constructor(components?: ReadonlyArray); + constructor(name: Name|string); + + append(value: ReadonlyArray|ArrayBuffer|Uint8Array|string|Blob, type?: ComponentType, otherTypeCode?: number): Name; + append(components: Name.Component|Name): Name; + appendImplicitSha256Digest(digest: Blob): Name; + appendParametersSha256Digest(digest: Blob): Name; + appendSegment(segment: number): Name; + appendSegmentOffset(segmentOffset: number): Name; + appendSequenceNumber(sequenceNumber: number): Name; + appendTimestamp(timestamp: number): Name; + appendVersion(version: number): Name; + + clear(): void; + + compare(other: Name): CompareResult; + compare(iStartComponent: number, nComponents: number, other: Name, + iOtherStartComponent?: number, nOtherComponents?: number): CompareResult; + + equals(other: Name): boolean; + static fromEscapedString(uri: string): Name; + get(i: number): Name.Component; + getPrefix(nComponents: number): Name; + getSubName(iStartComponent: number, nComponents?: number): Name; + getSuccessor(): Name; + match(name: Name): boolean; + set(uri: string): void; + size(): number; + toUri(includeScheme?: boolean): string; + + wireDecode(input: Blob|Buffer): void; + wireEncode(): Blob; +} diff --git a/types/ndn-js/network-nack.d.ts b/types/ndn-js/network-nack.d.ts new file mode 100644 index 0000000000..6ffb681313 --- /dev/null +++ b/types/ndn-js/network-nack.d.ts @@ -0,0 +1,14 @@ +export namespace NetworkNack { + enum Reason { + NONE = 0, + CONGESTION = 50, + DUPLICATE = 100, + NO_ROUTE = 150, + OTHER_CODE = 0x7fff, + } +} + +export class NetworkNack { + getOtherReasonCode(): number; + getReason(): NetworkNack.Reason; +} diff --git a/types/ndn-js/signature.d.ts b/types/ndn-js/signature.d.ts new file mode 100644 index 0000000000..0f9eed260f --- /dev/null +++ b/types/ndn-js/signature.d.ts @@ -0,0 +1,74 @@ +import { Blob } from "./blob"; +import { Name } from "./name"; + +export enum KeyLocatorType { + KEYNAME = 1, + KEY_LOCATOR_DIGEST = 2, +} + +export class KeyLocator { + constructor(kl?: KeyLocator); + + getType(): KeyLocatorType; + getKeyName(): Name; + getKeyData(): Blob; + + setType(type: KeyLocatorType): void; + setKeyName(name: Name): void; + setKeyData(keyData: Blob): void; + + clear(): void; +} + +export class ValidityPeriod { + constructor(validity?: ValidityPeriod); + constructor(notBefore: number, notAfter: number); + + hasPeriod(): boolean; + getNotBefore(): number; + getNotAfter(): number; + isValid(time?: number): boolean; + + equals(other: ValidityPeriod): boolean; + clear(): void; +} + +export abstract class Signature { + clone(): Signature; +} + +export class SignatureBase extends Signature { + constructor(); + getSignature(): Blob; + setSignature(sigValue: Blob): void; + clone(): T; +} + +export class SignatureBaseKl extends SignatureBase { + getKeyLocator(): KeyLocator; + setKeyLocator(kl?: KeyLocator): void; +} + +export class SignatureBaseKlVp extends SignatureBaseKl { + getValidityPeriod(): ValidityPeriod; + setValidityPeriod(validity?: ValidityPeriod): void; +} + +export class GenericSignature extends SignatureBase { + constructor(); + getTypeCode(): number; + getSignatureInfoEncoding(): Blob; + setSignatureInfoEncoding(encoding: Blob, typeCode?: number): void; +} + +export class DigestSha256Signature extends SignatureBase { +} + +export class Sha256WithRsaSignature extends SignatureBaseKlVp { +} + +export class Sha256WithEcdsaSignature extends SignatureBaseKlVp { +} + +export class HmacWithSha25Signature extends SignatureBaseKl { +} diff --git a/types/ndn-js/test/blob.ts b/types/ndn-js/test/blob.ts new file mode 100644 index 0000000000..b5540b831b --- /dev/null +++ b/types/ndn-js/test/blob.ts @@ -0,0 +1,20 @@ +/// +import ndn = require("ndn-js"); + +let blob = new ndn.Blob(); +blob = new ndn.Blob(blob); +blob = new ndn.Blob(Buffer.alloc(4)); +blob = new ndn.Blob([0x08, 0x01, 0x41]); +blob = new ndn.Blob("str"); + +let buf: Buffer = blob.buf(); +let b: boolean = blob.equals(blob); +b = blob.isNull(); +let n: number = blob.size(); + +let sb = new ndn.SignedBlob(); +sb = new ndn.SignedBlob(blob, 20, 40); +n = sb.getSignedPortionBeginOffset(); +n = sb.getSignedPortionEndOffset(); +buf = sb.signedBuf(); +n = sb.signedSize(); diff --git a/types/ndn-js/test/data.ts b/types/ndn-js/test/data.ts new file mode 100644 index 0000000000..367a7a0ec7 --- /dev/null +++ b/types/ndn-js/test/data.ts @@ -0,0 +1,37 @@ +/// +import ndn = require("ndn-js"); + +let meta = new ndn.MetaInfo(); +meta = new ndn.MetaInfo(meta); +const ct: ndn.ContentType = meta.getType(); +let n: number = meta.getOtherTypeCode(); +n = meta.getFreshnessPeriod(); +const comp: ndn.Name.Component = meta.getFinalBlockId(); + +meta.setType(ndn.ContentType.OTHER_CODE); +meta.setOtherTypeCode(1000); +meta.setFreshnessPeriod(5000); +meta.setFinalBlockId(comp); + +let data = new ndn.Data(); +data = new ndn.Data(new ndn.Name("/A")); +data = new ndn.Data("/A"); +data = new ndn.Data(data); + +let name: ndn.Name = data.getName(); +name = data.getFullName(); +meta = data.getMetaInfo(); +let blob: ndn.Blob = data.getContent(); +const sig: ndn.Signature = data.getSignature(); +n = data.getCongestionMark(); +n = data.getIncomingFaceId(); + +data = data.setName(name) + .setMetaInfo(meta) + .setContent(blob) + .setContent(Buffer.alloc(4)) + .setSignature(sig); + +data.wireDecode(blob); +data.wireDecode(Buffer.alloc(4)); +blob = data.wireEncode(); diff --git a/types/ndn-js/test/face.ts b/types/ndn-js/test/face.ts new file mode 100644 index 0000000000..90ba176d27 --- /dev/null +++ b/types/ndn-js/test/face.ts @@ -0,0 +1,47 @@ +import ndn = require("ndn-js"); + +let filter = new ndn.InterestFilter("/A"); +filter = new ndn.InterestFilter(new ndn.Name("/A"), "<>{2}"); +filter = new ndn.InterestFilter(filter); + +let b: boolean = filter.doesMatch(new ndn.Name("/B")); +const name: ndn.Name = filter.getPrefix(); +const s: string = filter.getRegexFilter(); +b = filter.hasRegexFilter(); + +const face = new ndn.Face(); + +let n: number = face.expressInterest(new ndn.Interest(), + (interest: ndn.Interest, data: ndn.Data) => {}); +face.expressInterest(new ndn.Name("/A"), + (interest: ndn.Interest, data: ndn.Data) => {}, + (interest: ndn.Interest) => {}); +face.expressInterest(new ndn.Name("/A"), + new ndn.Interest().setCanBePrefix(true), + (interest: ndn.Interest, data: ndn.Data) => {}, + (interest: ndn.Interest) => {}, + (interest: ndn.Interest, nack: ndn.NetworkNack) => {}); + +n = ndn.Face.getMaxNdnPacketSize(); +face.putData(new ndn.Data()); + +n = face.registerPrefix(new ndn.Name("/A"), + (prefix: ndn.Name, interest: ndn.Interest) => {}, + (prefix: ndn.Name) => {}); +face.registerPrefix(new ndn.Name("/A"), + (prefix: ndn.Name, interest: ndn.Interest) => {}, + (prefix: ndn.Name) => {}, + (prefix: ndn.Name, id: number) => {}); + +face.removePendingInterest(n); +face.removeRegisteredPrefix(n); +face.send(new ndn.Blob()); +face.setCommandCertificateName(name); +face.setCommandSigningInfo(new ndn.KeyChain(), name); + +n = face.setInterestFilter(filter, + (prefix: ndn.Name, interest: ndn.Interest, face: ndn.Face, filterId: number, filter: ndn.InterestFilter) => {}); +face.setInterestFilter(name, + (prefix: ndn.Name, interest: ndn.Interest) => {}); + +face.unsetInterestFilter(n); diff --git a/types/ndn-js/test/interest.ts b/types/ndn-js/test/interest.ts new file mode 100644 index 0000000000..008a795aec --- /dev/null +++ b/types/ndn-js/test/interest.ts @@ -0,0 +1,40 @@ +/// +import ndn = require("ndn-js"); + +let interest = new ndn.Interest(); +interest = new ndn.Interest(new ndn.Name("/A")); +interest = new ndn.Interest("/A"); +interest = new ndn.Interest(interest); + +let name: ndn.Name = interest.getName(); +let b: boolean = interest.getCanBePrefix(); +b = interest.getMustBeFresh(); +const fh: ndn.DelegationSet = interest.getForwardingHint(); +let blob: ndn.Blob = interest.getNonce(); +let n: number = interest.getInterestLifetimeMilliseconds(); +blob = interest.getApplicationParameters(); +n = interest.getIncomingFaceId(); + +interest = interest.setName(name) + .setCanBePrefix(true) + .setMustBeFresh(true) + .setForwardingHint(fh) + .setInterestLifetimeMilliseconds(2000) + .setApplicationParameters(blob) + .setApplicationParameters(Buffer.alloc(4)) + .appendParametersDigestToName(); + +b = interest.matchesData(new ndn.Data()); +b = interest.matchesName(name); +interest.refreshNonce(); +const s: string = interest.toUri(); +interest.wireDecode(blob); +interest.wireDecode(Buffer.alloc(4)); +blob = interest.wireEncode(); + +fh.add(10, name); +n = fh.size(); +const del: ndn.DelegationSet.Delegation = fh.get(0); +n = del.getPreference(); +name = del.getName(); +b = fh.remove(name); diff --git a/types/ndn-js/test/key-chain.ts b/types/ndn-js/test/key-chain.ts new file mode 100644 index 0000000000..1f52abec86 --- /dev/null +++ b/types/ndn-js/test/key-chain.ts @@ -0,0 +1,48 @@ +/// +import ndn = require("ndn-js"); + +let kc = new ndn.KeyChain(); +kc = new ndn.KeyChain("pib-memory:", "tpm-memory:"); + +const kp: ndn.KeyParams = ndn.KeyChain.getDefaultKeyParams(); +const pib: ndn.Pib = kc.getPib(); +const tpm: ndn.Tpm = kc.getTpm(); + +let name = new ndn.Name("/key-name"); + +let id: ndn.PibIdentity = kc.createIdentityV2(name); +id = kc.createIdentityV2(name, kp); +kc.createIdentityV2(name, (id: ndn.PibIdentity) => {}); +kc.createIdentityV2(name, (id: ndn.PibIdentity) => {}, (err) => {}); +kc.createIdentityV2(name, kp, (id: ndn.PibIdentity) => {}); +kc.createIdentityV2(name, kp, (id: ndn.PibIdentity) => {}, (err) => {}); +kc.deleteIdentity(id); +kc.setDefaultIdentity(id); + +let key: ndn.PibKey = kc.createKey(id); +key = kc.createKey(id, kp); +kc.createKey(id, (key: ndn.PibKey) => {}); +kc.createKey(id, (key: ndn.PibKey) => {}, (err) => {}); +kc.createKey(id, kp, (key: ndn.PibKey) => {}); +kc.createKey(id, kp, (key: ndn.PibKey) => {}, (err) => {}); +kc.deleteKey(id, key); +kc.setDefaultKey(id, key); + +const cert: ndn.CertificateV2 = {}; +kc.addCertificate(key, cert); +kc.deleteCertificate(key, name); +kc.setDefaultCertificate(key, cert); + +let si: ndn.SigningInfo = new ndn.SigningInfo(); +si = new ndn.SigningInfo(ndn.SigningInfo.SignerType.ID, name); +si = new ndn.SigningInfo(si); +si = new ndn.SigningInfo(id); +si = new ndn.SigningInfo(key); +si = new ndn.SigningInfo("id:/my-identity"); +const signerType: ndn.SigningInfo.SignerType = si.getSignerType(); +name = si.getSignerName(); + +kc.sign(new ndn.Data(), si, (data: ndn.Data) => {}); +kc.sign(new ndn.Interest(), si, (interest: ndn.Interest) => {}); +kc.signWithSha256(new ndn.Data()); +kc.signWithSha256(new ndn.Interest()); diff --git a/types/ndn-js/test/memory-content-cache.ts b/types/ndn-js/test/memory-content-cache.ts new file mode 100644 index 0000000000..d809b7a442 --- /dev/null +++ b/types/ndn-js/test/memory-content-cache.ts @@ -0,0 +1,15 @@ +import ndn = require("ndn-js"); + +const face = new ndn.Face(); +let cache = new ndn.MemoryContentCache(face); +cache = new ndn.MemoryContentCache(face, 8000); + +cache.add(new ndn.Data()); +const n: number = cache.getMinimumCacheLifetime(); +cache.registerPrefix(new ndn.Name("/A"), + () => {}, + () => {}, + cache.getStorePendingInterest()); +cache.setInterestFilter(new ndn.Name("/A"), cache.getStorePendingInterest()); +cache.setMinimumCacheLifetime(5000); +cache.storePendingInterest(new ndn.Interest(), face); diff --git a/types/ndn-js/test/name.ts b/types/ndn-js/test/name.ts new file mode 100644 index 0000000000..beb7e3c26c --- /dev/null +++ b/types/ndn-js/test/name.ts @@ -0,0 +1,82 @@ +/// +import ndn = require("ndn-js"); + +const DIGEST = new ndn.Blob(Buffer.alloc(32)); + +let comp = new ndn.Name.Component(); +comp = new ndn.Name.Component([0x41]); +comp = new ndn.Name.Component(new ArrayBuffer(4), ndn.ComponentType.GENERIC); +comp = new ndn.Name.Component(Buffer.alloc(4), ndn.ComponentType.OTHER_CODE, 1000); +comp = new ndn.Name.Component(new Uint8Array(4)); +comp = new ndn.Name.Component("A"); +comp = new ndn.Name.Component(new ndn.Blob()); +comp = new ndn.Name.Component(comp); + +let n: number = comp.compare(comp); +let b: boolean = comp.equals(comp); +comp = ndn.Name.Component.fromImplicitSha256Digest(DIGEST); +comp = ndn.Name.Component.fromParametersSha256Digest(DIGEST); +n = comp.getOtherTypeCode(); +comp = comp.getSuccessor(); +const ct: ndn.ComponentType = comp.getType(); +let blob: ndn.Blob = comp.getValue(); +b = comp.isGeneric(); +b = comp.isImplicitSha256Digest(); +b = comp.isParametersSha256Digest(); +let s: string = comp.toEscapedString(); + +comp = ndn.Name.Component.fromNumber(200); +comp = ndn.Name.Component.fromNumber(200, ndn.ComponentType.OTHER_CODE, 1000); +comp = ndn.Name.Component.fromNumberWithMarker(200, 0xFD); +comp = ndn.Name.Component.fromSegment(0); +comp = ndn.Name.Component.fromSegmentOffset(0); +comp = ndn.Name.Component.fromSequenceNumber(1); +comp = ndn.Name.Component.fromTimestamp(123456789); +comp = ndn.Name.Component.fromVersion(4); + +b = comp.isSegment(); +b = comp.isSegmentOffset(); +b = comp.isSequenceNumber(); +b = comp.isTimestamp(); +b = comp.isVersion(); + +n = comp.toNumber(); +n = comp.toNumberWithMarker(0xFD); +n = comp.toSegment(); +n = comp.toSegmentOffset(); +n = comp.toSequenceNumber(); +n = comp.toTimestamp(); +n = comp.toVersion(); + +let name = new ndn.Name(); +name = new ndn.Name([new ndn.Name.Component("A"), new Uint8Array(2)]); +name = new ndn.Name("/A"); +name = new ndn.Name(name); + +name = name.append(ndn.Name.Component.fromSegment(4)) + .append("A", ndn.ComponentType.OTHER_CODE, 1000) + .appendImplicitSha256Digest(DIGEST) + .appendParametersSha256Digest(DIGEST) + .appendSegment(0) + .appendSegmentOffset(1) + .appendSequenceNumber(4) + .appendTimestamp(3) + .appendVersion(2); + +name.clear(); +n = name.compare(name); +n = name.compare(0, 2, name, 1, 3); +b = name.equals(name); +name = ndn.Name.fromEscapedString(s); +comp = name.get(2); +name = name.getPrefix(3); +name = name.getSubName(1).getSubName(1, 4); +name = name.getSuccessor(); +b = name.match(name); +name.set("/B"); +n = name.size(); +s = name.toUri(); +s = name.toUri(true); +name.wireDecode(blob); +name.wireDecode(Buffer.alloc(4)); +blob = name.wireEncode(); diff --git a/types/ndn-js/test/network-nack.ts b/types/ndn-js/test/network-nack.ts new file mode 100644 index 0000000000..8341742295 --- /dev/null +++ b/types/ndn-js/test/network-nack.ts @@ -0,0 +1,6 @@ +import ndn = require("ndn-js"); + +(nack: ndn.NetworkNack) => { + const n: number = nack.getOtherReasonCode(); + const reason: ndn.NetworkNack.Reason = nack.getReason(); +}; diff --git a/types/ndn-js/test/signature.ts b/types/ndn-js/test/signature.ts new file mode 100644 index 0000000000..65b809f1a6 --- /dev/null +++ b/types/ndn-js/test/signature.ts @@ -0,0 +1,66 @@ +import ndn = require("ndn-js"); + +let kl: ndn.KeyLocator = new ndn.KeyLocator(); +kl = new ndn.KeyLocator(kl); +const klt: ndn.KeyLocatorType = kl.getType(); +const name: ndn.Name = kl.getKeyName(); +let blob: ndn.Blob = kl.getKeyData(); +kl.setType(ndn.KeyLocatorType.KEY_LOCATOR_DIGEST); +kl.setKeyName(name); +kl.setKeyData(blob); +kl.clear(); + +let validity: ndn.ValidityPeriod = new ndn.ValidityPeriod(); +validity = new ndn.ValidityPeriod(validity); +validity = new ndn.ValidityPeriod(540109800000, 664156800000); +let b: boolean = validity.hasPeriod(); +let n: number = validity.getNotBefore(); +n = validity.getNotAfter(); +b = validity.isValid(); +b = validity.isValid(594172800000); +validity.equals(new ndn.ValidityPeriod()); +validity.clear(); + +let sigG = new ndn.GenericSignature(); +blob = sigG.getSignature(); +blob = sigG.getSignatureInfoEncoding(); +n = sigG.getTypeCode(); +sigG.setSignature(blob); +sigG.setSignatureInfoEncoding(blob); +sigG.setSignatureInfoEncoding(blob, 1000); +sigG = sigG.clone(); +let sig: ndn.Signature = sigG; + +let sig0 = new ndn.DigestSha256Signature(); +blob = sig0.getSignature(); +sig0.setSignature(blob); +sig0 = sig0.clone(); +sig = sig0; + +let sig1 = new ndn.Sha256WithRsaSignature(); +kl = sig1.getKeyLocator(); +blob = sig1.getSignature(); +validity = sig1.getValidityPeriod(); +sig1.setKeyLocator(kl); +sig1.setSignature(blob); +sig1.setValidityPeriod(validity); +sig1 = sig1.clone(); +sig = sig1; + +let sig3 = new ndn.Sha256WithEcdsaSignature(); +kl = sig3.getKeyLocator(); +blob = sig3.getSignature(); +validity = sig3.getValidityPeriod(); +sig3.setKeyLocator(kl); +sig3.setSignature(blob); +sig3.setValidityPeriod(validity); +sig3 = sig3.clone(); +sig = sig3; + +let sig4 = new ndn.HmacWithSha25Signature(); +kl = sig4.getKeyLocator(); +blob = sig4.getSignature(); +sig4.setKeyLocator(kl); +sig4.setSignature(blob); +sig4 = sig4.clone(); +sig = sig4; diff --git a/types/ndn-js/test/transport.ts b/types/ndn-js/test/transport.ts new file mode 100644 index 0000000000..707a5f0d55 --- /dev/null +++ b/types/ndn-js/test/transport.ts @@ -0,0 +1,14 @@ +import ndn = require("ndn-js"); + +const transport = new ndn.TcpTransport(); +const b: boolean = transport.isLocal(); + +let face = new ndn.Face(transport, new ndn.TcpTransport.ConnectionInfo("hobo.cs.arizona.edu", 9696)); +face = new ndn.Face(new ndn.UnixTransport(), new ndn.UnixTransport.ConnectionInfo("/run/nfd.sock")); +face = new ndn.Face(new ndn.WebSocketTransport(), new ndn.WebSocketTransport.ConnectionInfo("hobo.cs.arizona.edu", 9696)); + +face = new ndn.Face({host: 'hobo.cs.arizona.edu', port: 6363}); +face = new ndn.Face({getTransport: () => new ndn.UnixTransport(), + getConnectionInfo: () => new ndn.UnixTransport.ConnectionInfo("/run/nfd.sock")}); +face = new ndn.Face({getTransport: () => new ndn.UnixTransport(), + connectionInfo: new ndn.UnixTransport.ConnectionInfo("/run/nfd.sock")}); diff --git a/types/ndn-js/transport.d.ts b/types/ndn-js/transport.d.ts new file mode 100644 index 0000000000..9a2c4db918 --- /dev/null +++ b/types/ndn-js/transport.d.ts @@ -0,0 +1,40 @@ +export abstract class TransportConnectionInfo { +} + +export abstract class Transport { + static ConnectionInfo: TransportConnectionInfo; + isLocal(): boolean; +} + +export class TcpTransport extends Transport { +} + +export namespace TcpTransport { + class ConnectionInfo extends TransportConnectionInfo { + constructor(host: string, port: number); + equals(other: ConnectionInfo): boolean; + toString(): string; + } +} + +export class UnixTransport extends Transport { +} + +export namespace UnixTransport { + class ConnectionInfo extends TransportConnectionInfo { + constructor(filePath: string); + equals(other: ConnectionInfo): boolean; + toString(): string; + } +} + +export class WebSocketTransport extends Transport { +} + +export namespace WebSocketTransport { + class ConnectionInfo extends TransportConnectionInfo { + constructor(hostOrUri: string, port?: number); + equals(other: ConnectionInfo): boolean; + toString(): string; + } +} diff --git a/types/ndn-js/tsconfig.json b/types/ndn-js/tsconfig.json new file mode 100644 index 0000000000..3aaea5f6f1 --- /dev/null +++ b/types/ndn-js/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/blob.ts", + "test/data.ts", + "test/face.ts", + "test/interest.ts", + "test/key-chain.ts", + "test/memory-content-cache.ts", + "test/name.ts", + "test/network-nack.ts", + "test/signature.ts", + "test/transport.ts" + ] +} diff --git a/types/ndn-js/tslint.json b/types/ndn-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ndn-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/neo4j/tslint.json b/types/neo4j/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/neo4j/tslint.json +++ b/types/neo4j/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nes/tslint.json b/types/nes/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nes/tslint.json +++ b/types/nes/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/netmask/tslint.json b/types/netmask/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/netmask/tslint.json +++ b/types/netmask/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nexpect/tslint.json b/types/nexpect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nexpect/tslint.json +++ b/types/nexpect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-command/tslint.json b/types/ng-command/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ng-command/tslint.json +++ b/types/ng-command/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-cordova/tslint.json b/types/ng-cordova/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/ng-cordova/tslint.json +++ b/types/ng-cordova/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-dialog/tslint.json b/types/ng-dialog/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ng-dialog/tslint.json +++ b/types/ng-dialog/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-facebook/tslint.json b/types/ng-facebook/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ng-facebook/tslint.json +++ b/types/ng-facebook/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-file-upload/tslint.json b/types/ng-file-upload/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ng-file-upload/tslint.json +++ b/types/ng-file-upload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-flow/tslint.json b/types/ng-flow/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/ng-flow/tslint.json +++ b/types/ng-flow/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-grid/tslint.json b/types/ng-grid/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/ng-grid/tslint.json +++ b/types/ng-grid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-i18next/tslint.json b/types/ng-i18next/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ng-i18next/tslint.json +++ b/types/ng-i18next/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ng-notify/tslint.json b/types/ng-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ng-notify/tslint.json +++ b/types/ng-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngbootbox/tslint.json b/types/ngbootbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngbootbox/tslint.json +++ b/types/ngbootbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngeohash/tslint.json b/types/ngeohash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngeohash/tslint.json +++ b/types/ngeohash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngkookies/tslint.json b/types/ngkookies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngkookies/tslint.json +++ b/types/ngkookies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngmap/tslint.json b/types/ngmap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngmap/tslint.json +++ b/types/ngmap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngprogress-lite/tslint.json b/types/ngprogress-lite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngprogress-lite/tslint.json +++ b/types/ngprogress-lite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngprogress/tslint.json b/types/ngprogress/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngprogress/tslint.json +++ b/types/ngprogress/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ngreact/tslint.json b/types/ngreact/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ngreact/tslint.json +++ b/types/ngreact/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nightmare/tslint.json b/types/nightmare/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nightmare/tslint.json +++ b/types/nightmare/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/noble/tslint.json b/types/noble/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/noble/tslint.json +++ b/types/noble/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nock/tslint.json b/types/nock/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nock/tslint.json +++ b/types/nock/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodal/tslint.json b/types/nodal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodal/tslint.json +++ b/types/nodal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-7z/tslint.json b/types/node-7z/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-7z/tslint.json +++ b/types/node-7z/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-array-ext/tslint.json b/types/node-array-ext/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-array-ext/tslint.json +++ b/types/node-array-ext/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-calendar/tslint.json b/types/node-calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-calendar/tslint.json +++ b/types/node-calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-config-manager/tslint.json b/types/node-config-manager/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-config-manager/tslint.json +++ b/types/node-config-manager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-dir/tslint.json b/types/node-dir/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-dir/tslint.json +++ b/types/node-dir/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-dogstatsd/tslint.json b/types/node-dogstatsd/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-dogstatsd/tslint.json +++ b/types/node-dogstatsd/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index 03ae639d26..8883dc1b9d 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -4,6 +4,7 @@ // Niklas Lindgren // Vinay Bedre // Antonio Román +// Andrew Leedham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -134,7 +135,7 @@ export class Body { export class FetchError extends Error { name: "FetchError"; - constructor(message: string, type: string, systemError: string); + constructor(message: string, type: string, systemError?: string); type: string; code?: string; errno?: string; diff --git a/types/node-fetch/node-fetch-tests.ts b/types/node-fetch/node-fetch-tests.ts index d35114f60a..165ac24800 100644 --- a/types/node-fetch/node-fetch-tests.ts +++ b/types/node-fetch/node-fetch-tests.ts @@ -1,4 +1,4 @@ -import fetch, { Headers, Request, RequestInit, Response } from 'node-fetch'; +import fetch, { Headers, Request, RequestInit, Response, FetchError } from 'node-fetch'; import { Agent } from "http"; function test_fetchUrlWithOptions() { @@ -82,3 +82,8 @@ function test_isRedirect() { fetch.isRedirect(301); fetch.isRedirect(201); } + +function test_FetchError() { + new FetchError('message', 'type', 'systemError'); + new FetchError('message', 'type'); +} diff --git a/types/node-fibers/tslint.json b/types/node-fibers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-fibers/tslint.json +++ b/types/node-fibers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index 4a366deab7..47a601fc32 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -639,7 +639,7 @@ declare module "node-forge" { function createDecipher(algorithm: Algorithm, payload: util.ByteBuffer | Bytes): BlockCipher; interface StartOptions { - iv?: Bytes; + iv?: util.ByteBuffer | Byte[] | Bytes; tag?: util.ByteStringBuffer; tagLength?: number; additionalData?: string; diff --git a/types/node-forge/tslint.json b/types/node-forge/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-forge/tslint.json +++ b/types/node-forge/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-gcm/tslint.json b/types/node-gcm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-gcm/tslint.json +++ b/types/node-gcm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-getopt/tslint.json b/types/node-getopt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-getopt/tslint.json +++ b/types/node-getopt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-hue-api/tslint.json b/types/node-hue-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-hue-api/tslint.json +++ b/types/node-hue-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-int64/tslint.json b/types/node-int64/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-int64/tslint.json +++ b/types/node-int64/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-jsfl-runner/tslint.json b/types/node-jsfl-runner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-jsfl-runner/tslint.json +++ b/types/node-jsfl-runner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-json-db/tslint.json b/types/node-json-db/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-json-db/tslint.json +++ b/types/node-json-db/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-mysql-wrapper/tslint.json b/types/node-mysql-wrapper/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-mysql-wrapper/tslint.json +++ b/types/node-mysql-wrapper/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-notifier/tslint.json b/types/node-notifier/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-notifier/tslint.json +++ b/types/node-notifier/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-persist/tslint.json b/types/node-persist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-persist/tslint.json +++ b/types/node-persist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-polyglot/tslint.json b/types/node-polyglot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-polyglot/tslint.json +++ b/types/node-polyglot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-powershell/tslint.json b/types/node-powershell/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-powershell/tslint.json +++ b/types/node-powershell/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-sass-middleware/tslint.json b/types/node-sass-middleware/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-sass-middleware/tslint.json +++ b/types/node-sass-middleware/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-slack/tslint.json b/types/node-slack/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-slack/tslint.json +++ b/types/node-slack/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-snap7/tslint.json b/types/node-snap7/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-snap7/tslint.json +++ b/types/node-snap7/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-uuid/tslint.json b/types/node-uuid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-uuid/tslint.json +++ b/types/node-uuid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node-validator/tslint.json b/types/node-validator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node-validator/tslint.json +++ b/types/node-validator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/node/http2.d.ts b/types/node/http2.d.ts index 6e6f0e0b62..adeee5402b 100644 --- a/types/node/http2.d.ts +++ b/types/node/http2.d.ts @@ -424,9 +424,7 @@ declare module "http2" { export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } - export interface ServerOptions extends ServerSessionOptions { - allowHTTP1?: boolean; - } + export interface ServerOptions extends ServerSessionOptions { } export interface SecureServerOptions extends SecureServerSessionOptions { allowHTTP1?: boolean; diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 498b54e52e..a2f2e583fe 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -92,4 +92,8 @@ declare module "util" { namespace promisify { const custom: symbol; } + namespace types { + function isBigInt64Array(value: any): boolean; + function isBigUint64Array(value: any): boolean; + } } diff --git a/types/node/inspector.d.ts b/types/node/inspector.d.ts index 2dcd2760ad..5f25a7d6bd 100644 --- a/types/node/inspector.d.ts +++ b/types/node/inspector.d.ts @@ -1716,10 +1716,31 @@ declare module "inspector" { awaitPromise?: boolean; } + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async + * call stacks (default). + */ + maxDepth: number; + } + interface SetCustomObjectFormatterEnabledParameterType { enabled: boolean; } + interface SetMaxCallStackSizeToCaptureParameterType { + size: number; + } + + interface AddBindingParameterType { + name: string; + executionContextId?: ExecutionContextId; + } + + interface RemoveBindingParameterType { + name: string; + } + interface AwaitPromiseReturnType { /** * Promise result. Will contain rejected value if promise was rejected. @@ -1819,6 +1840,15 @@ declare module "inspector" { exceptionDetails?: ExceptionDetails; } + interface BindingCalledEventDataType { + name: string; + payload: string; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + } + interface ConsoleAPICalledEventDataType { /** * Type of the call. @@ -2435,12 +2465,24 @@ declare module "inspector" { post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Runtime.setAsyncCallStackDepth", params?: Runtime.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + /** * @experimental */ post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: "Runtime.setMaxCallStackSizeToCapture", params?: Runtime.SetMaxCallStackSizeToCaptureParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setMaxCallStackSizeToCapture", callback?: (err: Error | null) => void): void; + /** * Terminate current or next JavaScript execution. * Will cancel the termination when the outer-most script execution ends. @@ -2448,6 +2490,28 @@ declare module "inspector" { */ post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void; + /** + * If executionContextId is empty, adds binding with the given name on the + * global objects of all inspected contexts, including those created later, + * bindings survive reloads. + * If executionContextId is specified, adds binding only on global object of + * given execution context. + * Binding function takes exactly one argument, this argument should be string, + * in case of any other input, function throws an exception. + * Each binding function call produces Runtime.bindingCalled notification. + * @experimental + */ + post(method: "Runtime.addBinding", params?: Runtime.AddBindingParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.addBinding", callback?: (err: Error | null) => void): void; + + /** + * This method does not remove binding function from global object but + * unsubscribes current runtime agent from Runtime.bindingCalled notifications. + * @experimental + */ + post(method: "Runtime.removeBinding", params?: Runtime.RemoveBindingParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.removeBinding", callback?: (err: Error | null) => void): void; + /** * Returns supported domains. */ @@ -2551,6 +2615,12 @@ declare module "inspector" { */ addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + /** + * Notification is issued every time when binding is called. + * @experimental + */ + addListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + /** * Issued when console API was called. */ @@ -2629,6 +2699,7 @@ declare module "inspector" { emit(event: "HeapProfiler.resetProfiles"): boolean; emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Runtime.bindingCalled", message: InspectorNotification): boolean; emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; @@ -2703,6 +2774,12 @@ declare module "inspector" { */ on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + /** + * Notification is issued every time when binding is called. + * @experimental + */ + on(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + /** * Issued when console API was called. */ @@ -2827,6 +2904,12 @@ declare module "inspector" { */ once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + /** + * Notification is issued every time when binding is called. + * @experimental + */ + once(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + /** * Issued when console API was called. */ @@ -2951,6 +3034,12 @@ declare module "inspector" { */ prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + /** + * Notification is issued every time when binding is called. + * @experimental + */ + prependListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + /** * Issued when console API was called. */ @@ -3075,6 +3164,12 @@ declare module "inspector" { */ prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + /** + * Notification is issued every time when binding is called. + * @experimental + */ + prependOnceListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + /** * Issued when console API was called. */ diff --git a/types/node/scripts/generate-inspector/README.md b/types/node/scripts/generate-inspector/README.md index 0c87321994..7d7eb9ca45 100644 --- a/types/node/scripts/generate-inspector/README.md +++ b/types/node/scripts/generate-inspector/README.md @@ -8,7 +8,7 @@ What this does is: For example, to bump `inspector.d.ts` to what's exposed in v8.4: ```sh # cwd = types/node -ts-node scripts/generate-inspector v8.4.0 +ts-node -P scripts/generate-inspector/tsconfig.json scripts/generate-inspector v8.4.0 ``` Inspector type definitions should be updated every time the V8 version is bumped in a Node.js release. diff --git a/types/node/scripts/generate-inspector/devtools-protocol-schema.ts b/types/node/scripts/generate-inspector/devtools-protocol-schema.ts index aaa8c9712f..08e5f45efc 100644 --- a/types/node/scripts/generate-inspector/devtools-protocol-schema.ts +++ b/types/node/scripts/generate-inspector/devtools-protocol-schema.ts @@ -45,18 +45,15 @@ export type Parameter = Field & Documentable & { export interface Command extends Documentable { name: string; - description?: string; handlers?: string[]; parameters?: Parameter[]; returns?: Parameter[]; - experimental?: boolean; redirect?: string; } export interface Event extends Documentable { name: string; parameters?: Parameter[]; - description?: string; } // It should be safe to load a devtools-protocol/json file and cast it to @@ -69,7 +66,7 @@ export interface Schema { domains: Array<{ domain: string, types?: Type[], - commands: Command[], + commands?: Command[], events?: Event[], dependencies?: string[], } & Documentable>; diff --git a/types/node/scripts/generate-inspector/event-emitter.ts b/types/node/scripts/generate-inspector/event-emitter.ts index 3d3410633f..7aa71a0ef7 100644 --- a/types/node/scripts/generate-inspector/event-emitter.ts +++ b/types/node/scripts/generate-inspector/event-emitter.ts @@ -76,5 +76,5 @@ export const createListeners = (events: Event[]): string[] => { acc.push(next); return acc; } - }, []); + }, [] as string[]); }; diff --git a/types/node/scripts/generate-inspector/generate-substitute-args.ts b/types/node/scripts/generate-inspector/generate-substitute-args.ts index cd12eff1a8..95f757f191 100644 --- a/types/node/scripts/generate-inspector/generate-substitute-args.ts +++ b/types/node/scripts/generate-inspector/generate-substitute-args.ts @@ -1,6 +1,6 @@ import * as schema from "./devtools-protocol-schema"; import { createListeners } from "./event-emitter"; -import { capitalize, createDocs, flattenArgs, hasElements, isObjectReference } from "./utils"; +import { capitalize, createDocs, flattenArgs, hasElements, isObjectReference, filterNull } from "./utils"; const INDENT = " "; @@ -22,7 +22,7 @@ const createTypeString = (type: schema.Field, domain?: string): string => { }; // Helper for createInterface -- constructs a list of interface fields -const createFieldsForInterface = (fields: schema.Parameter[] | null, domain: string): string[] => { +const createFieldsForInterface = (fields: schema.Parameter[], domain: string): string[] => { return fields ? [ ...fields .map(prop => [ @@ -39,7 +39,7 @@ const createTypeDefinition = (type: schema.Type, domain: string): string[] => { ...createDocs(type), ...(type.type === "object" ? [ `interface ${type.id} {`, - ...createFieldsForInterface(type.properties, domain) + ...createFieldsForInterface(type.properties || [], domain) .map(line => `${INDENT}${line}`), "}", ] : [`type ${type.id} = ${createTypeString(type)};`]), @@ -56,9 +56,9 @@ const createCallbackString = (commandName: string, returns: schema.Parameter[], // Create declarations for overloads of Session#post const createPostFunctions = (command: schema.Command, domain: string): string[] => { const fnName = "post"; - const callbackStr = createCallbackString(command.name, command.returns, domain); + const callbackStr = createCallbackString(command.name, command.returns || [], domain); const result = createDocs(command); - if (hasElements(command.parameters)) { + if (hasElements(command.parameters || [])) { const parts = [ `${fnName}(`, `method: "${domain}.${command.name}", `, @@ -93,9 +93,9 @@ const createPostFunctions = (command: schema.Command, domain: string): string[] export const generateSubstituteArgs = (protocol: schema.Schema): { [propName: string]: string[] } => { const interfaceDefinitions: string[] = protocol.domains .map(item => { - const typePool = (item.types || []).concat([ + const typePool = (item.types || []).concat(filterNull([ ...(item.commands || []).map(command => { - let result: schema.Type = null; + let result: schema.Type | null = null; if (hasElements(command.parameters)) { result = { id: `${capitalize(command.name)}ParameterType`, @@ -106,7 +106,7 @@ export const generateSubstituteArgs = (protocol: schema.Schema): { [propName: st return result; }), ...(item.commands || []).map(command => { - let result: schema.Type = null; + let result: schema.Type | null = null; if (hasElements(command.returns)) { result = { id: `${capitalize(command.name)}ReturnType`, @@ -117,7 +117,7 @@ export const generateSubstituteArgs = (protocol: schema.Schema): { [propName: st return result; }), ...(item.events || []).map(event => { - let result: schema.Type = null; + let result: schema.Type | null = null; if (hasElements(event.parameters)) { result = { id: `${capitalize(event.name)}EventDataType`, @@ -127,7 +127,7 @@ export const generateSubstituteArgs = (protocol: schema.Schema): { [propName: st } return result; }), - ].filter(x => x)); + ])); return typePool.length > 0 ? [ `namespace ${item.domain} {`, ...typePool @@ -139,7 +139,7 @@ export const generateSubstituteArgs = (protocol: schema.Schema): { [propName: st }).reduce(flattenArgs(""), []); const postOverloads: string[] = protocol.domains - .map(item => item.commands + .map(item => (item.commands || []) .map(command => createPostFunctions(command, item.domain)) .reduce(flattenArgs(""), [])) .reduce(flattenArgs(""), []); diff --git a/types/node/scripts/generate-inspector/index.ts b/types/node/scripts/generate-inspector/index.ts index f555105e37..3a0e53eff0 100644 --- a/types/node/scripts/generate-inspector/index.ts +++ b/types/node/scripts/generate-inspector/index.ts @@ -1,13 +1,14 @@ // Usage: node generate-inspector [tag] // [tag] corresponds to a tag name in the node-core repository. +// By default, uses the current Node version. import { execSync } from "child_process"; import { existsSync, readFileSync, writeFileSync } from "fs"; import * as https from "https"; + import * as schema from "./devtools-protocol-schema"; import { generateSubstituteArgs } from "./generate-substitute-args"; import { substitute, trimRight } from "./utils"; -import { string } from "parsimmon"; const httpsGet = (url: string) => new Promise((resolve, reject) => { https.get(url, res => { diff --git a/types/node/scripts/generate-inspector/tsconfig.json b/types/node/scripts/generate-inspector/tsconfig.json new file mode 100644 index 0000000000..21fff91768 --- /dev/null +++ b/types/node/scripts/generate-inspector/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "typeRoots": ["../.."] + } +} diff --git a/types/node/scripts/generate-inspector/utils.ts b/types/node/scripts/generate-inspector/utils.ts index 0f98881a75..8b81967b76 100644 --- a/types/node/scripts/generate-inspector/utils.ts +++ b/types/node/scripts/generate-inspector/utils.ts @@ -25,7 +25,14 @@ export function flattenArgs(inBetween?: T): (acc: T[], next: T[]) => * Returns whether an array exists and has elements. * @param a The array to check. */ -export const hasElements = (a: any[]): boolean => a && a.length > 0; +export const hasElements = (a?: any[]): boolean => !!a && a.length > 0; + +/** + * Given an array that might have null elements, return an array with just the + * non-null elements. + * @param a The array to filter. + */ +export const filterNull = (a: Array): T[] => a.filter(x => x != null) as T[]; /** * Returns the capitalized form of a given string. @@ -48,16 +55,14 @@ export function isObjectReference(t: Field): t is ObjectReference { * @param documentable A Documentable object. */ export const createDocs = ({ deprecated, description, experimental }: Documentable): string[] => { - const hasDocs = !!description || - deprecated || - experimental; - return hasDocs ? [ + const hasDocs = !!description || deprecated || experimental; + return hasDocs ? filterNull([ "/**", ...(description ? description.split(/\r?\n/).map(l => ` * ${l}`) : []), - deprecated && " * @deprecated", - experimental && " * @experimental", + deprecated ? " * @deprecated" : null, + experimental ? " * @experimental" : null, " */", - ].filter(l => l != null) : []; + ]) : []; }; /** diff --git a/types/node/test/http2.ts b/types/node/test/http2.ts index 76d6044d02..c87b66a3f0 100644 --- a/types/node/test/http2.ts +++ b/types/node/test/http2.ts @@ -256,8 +256,7 @@ import { URL } from 'url'; paddingStrategy: 0, peerMaxConcurrentStreams: 0, selectPadding: (frameLen: number, maxFrameLen: number) => 0, - settings, - allowHTTP1: true + settings }; // tslint:disable-next-line prefer-object-spread (ts2.1 feature) const secureServerOptions: SecureServerOptions = Object.assign({}, serverOptions); diff --git a/types/node/test/util.ts b/types/node/test/util.ts index 14500161fd..f0208c4ada 100644 --- a/types/node/test/util.ts +++ b/types/node/test/util.ts @@ -159,6 +159,10 @@ import { readFile } from 'fs'; const teEncodeRes: Uint8Array = te.encode("TextEncoder"); // util.types + let b: boolean; + b = util.types.isBigInt64Array(15); + b = util.types.isBigUint64Array(15); + b = util.types.isModuleNamespaceObject(15); // tslint:disable-next-line:no-construct ban-types const maybeBoxed: number | Number = new Number(1); diff --git a/types/node/ts3.2/node-tests.ts b/types/node/ts3.2/node-tests.ts index 3f64e22e81..18de85a3a1 100644 --- a/types/node/ts3.2/node-tests.ts +++ b/types/node/ts3.2/node-tests.ts @@ -1,5 +1,6 @@ // tslint:disable-next-line:no-bad-reference import "../node-tests"; +import * as util from "util"; ////////////////////////////////////////////////////////// /// Global Tests : https://nodejs.org/api/global.html /// @@ -9,3 +10,22 @@ import "../node-tests"; const hrtimeBigint: bigint = process.hrtime.bigint(); } } + +////////////////////////////////////////////////////////// +/// Util Tests /// +////////////////////////////////////////////////////////// +{ + { + const value: BigInt64Array | BigUint64Array | number = [] as any; + if (util.types.isBigInt64Array(value)) { + // $ExpectType BigInt64Array + const b = value; + } else if (util.types.isBigUint64Array(value)) { + // $ExpectType BigUint64Array + const b = value; + } else { + // $ExpectType number + const b = value; + } + } +} diff --git a/types/node/ts3.2/util.d.ts b/types/node/ts3.2/util.d.ts index e35ef8d0f1..a8b2487ef4 100644 --- a/types/node/ts3.2/util.d.ts +++ b/types/node/ts3.2/util.d.ts @@ -1,5 +1,6 @@ // tslint:disable-next-line:no-bad-reference /// + declare module "util" { namespace inspect { const custom: unique symbol; @@ -7,4 +8,8 @@ declare module "util" { namespace promisify { const custom: unique symbol; } + namespace types { + function isBigInt64Array(value: any): value is BigInt64Array; + function isBigUint64Array(value: any): value is BigUint64Array; + } } diff --git a/types/node/util.d.ts b/types/node/util.d.ts index 1adf10059f..14a1c2c495 100644 --- a/types/node/util.d.ts +++ b/types/node/util.d.ts @@ -114,7 +114,7 @@ declare module "util" { function isArrayBuffer(object: any): object is ArrayBuffer; function isAsyncFunction(object: any): boolean; function isBooleanObject(object: any): object is Boolean; - function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* BigInt */); + function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */); function isDataView(object: any): object is DataView; function isDate(object: any): object is Date; function isExternal(object: any): boolean; @@ -127,6 +127,7 @@ declare module "util" { function isInt32Array(object: any): object is Int32Array; function isMap(object: any): boolean; function isMapIterator(object: any): boolean; + function isModuleNamespaceObject(value: any): boolean; function isNativeError(object: any): object is Error; function isNumberObject(object: any): object is Number; function isPromise(object: any): boolean; diff --git a/types/node/v10/http2.d.ts b/types/node/v10/http2.d.ts index aecbca783f..0d23809c99 100644 --- a/types/node/v10/http2.d.ts +++ b/types/node/v10/http2.d.ts @@ -424,9 +424,7 @@ declare module "http2" { export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } - export interface ServerOptions extends ServerSessionOptions { - allowHTTP1?: boolean; - } + export interface ServerOptions extends ServerSessionOptions { } export interface SecureServerOptions extends SecureServerSessionOptions { allowHTTP1?: boolean; diff --git a/types/node/v10/index.d.ts b/types/node/v10/index.d.ts index ea1d259bcb..8e650d7492 100644 --- a/types/node/v10/index.d.ts +++ b/types/node/v10/index.d.ts @@ -84,4 +84,8 @@ declare module "util" { namespace promisify { const custom: symbol; } + namespace types { + function isBigInt64Array(value: any): boolean; + function isBigUint64Array(value: any): boolean; + } } diff --git a/types/node/v10/node-tests.ts b/types/node/v10/node-tests.ts index 789b87b600..d654aaa3d1 100644 --- a/types/node/v10/node-tests.ts +++ b/types/node/v10/node-tests.ts @@ -952,6 +952,10 @@ function bufferTests() { const teEncodeRes: Uint8Array = te.encode("TextEncoder"); // util.types + let b: boolean; + b = util.types.isBigInt64Array(15); + b = util.types.isBigUint64Array(15); + b = util.types.isModuleNamespaceObject(15); // tslint:disable-next-line:no-construct ban-types const maybeBoxed: number | Number = new Number(1); @@ -4448,8 +4452,7 @@ import * as constants from 'constants'; paddingStrategy: 0, peerMaxConcurrentStreams: 0, selectPadding: (frameLen: number, maxFrameLen: number) => 0, - settings, - allowHTTP1: true + settings }; // tslint:disable-next-line prefer-object-spread (ts2.1 feature) const secureServerOptions: http2.SecureServerOptions = Object.assign({}, serverOptions); diff --git a/types/node/v10/ts3.2/node-tests.ts b/types/node/v10/ts3.2/node-tests.ts index 3f64e22e81..18de85a3a1 100644 --- a/types/node/v10/ts3.2/node-tests.ts +++ b/types/node/v10/ts3.2/node-tests.ts @@ -1,5 +1,6 @@ // tslint:disable-next-line:no-bad-reference import "../node-tests"; +import * as util from "util"; ////////////////////////////////////////////////////////// /// Global Tests : https://nodejs.org/api/global.html /// @@ -9,3 +10,22 @@ import "../node-tests"; const hrtimeBigint: bigint = process.hrtime.bigint(); } } + +////////////////////////////////////////////////////////// +/// Util Tests /// +////////////////////////////////////////////////////////// +{ + { + const value: BigInt64Array | BigUint64Array | number = [] as any; + if (util.types.isBigInt64Array(value)) { + // $ExpectType BigInt64Array + const b = value; + } else if (util.types.isBigUint64Array(value)) { + // $ExpectType BigUint64Array + const b = value; + } else { + // $ExpectType number + const b = value; + } + } +} diff --git a/types/node/v10/ts3.2/util.d.ts b/types/node/v10/ts3.2/util.d.ts index e35ef8d0f1..a8b2487ef4 100644 --- a/types/node/v10/ts3.2/util.d.ts +++ b/types/node/v10/ts3.2/util.d.ts @@ -1,5 +1,6 @@ // tslint:disable-next-line:no-bad-reference /// + declare module "util" { namespace inspect { const custom: unique symbol; @@ -7,4 +8,8 @@ declare module "util" { namespace promisify { const custom: unique symbol; } + namespace types { + function isBigInt64Array(value: any): value is BigInt64Array; + function isBigUint64Array(value: any): value is BigUint64Array; + } } diff --git a/types/node/v10/util.d.ts b/types/node/v10/util.d.ts index 9da88fe9cb..05b6ab3df1 100644 --- a/types/node/v10/util.d.ts +++ b/types/node/v10/util.d.ts @@ -114,7 +114,7 @@ declare module "util" { function isArrayBuffer(object: any): object is ArrayBuffer; function isAsyncFunction(object: any): boolean; function isBooleanObject(object: any): object is Boolean; - function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* BigInt */); + function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */); function isDataView(object: any): object is DataView; function isDate(object: any): object is Date; function isExternal(object: any): boolean; @@ -127,6 +127,7 @@ declare module "util" { function isInt32Array(object: any): object is Int32Array; function isMap(object: any): boolean; function isMapIterator(object: any): boolean; + function isModuleNamespaceObject(value: any): boolean; function isNativeError(object: any): object is Error; function isNumberObject(object: any): object is Number; function isPromise(object: any): boolean; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index ecc15b68f1..dd92b36a94 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -6710,9 +6710,7 @@ declare module "http2" { export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } - export interface ServerOptions extends ServerSessionOptions { - allowHTTP1?: boolean; - } + export interface ServerOptions extends ServerSessionOptions { } export interface SecureServerOptions extends SecureServerSessionOptions { allowHTTP1?: boolean; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 312f2d7acb..b2c16a896a 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -3686,8 +3686,7 @@ namespace http2_tests { paddingStrategy: 0, peerMaxConcurrentStreams: 0, selectPadding: (frameLen: number, maxFrameLen: number) => 0, - settings, - allowHTTP1: true + settings }; // tslint:disable-next-line prefer-object-spread (ts2.1 feature) let secureServerOptions: http2.SecureServerOptions = Object.assign({}, serverOptions); diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index 55cb883f8c..ecfcf119dd 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -7135,9 +7135,7 @@ declare module "http2" { export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } - export interface ServerOptions extends ServerSessionOptions { - allowHTTP1?: boolean; - } + export interface ServerOptions extends ServerSessionOptions { } export interface SecureServerOptions extends SecureServerSessionOptions { allowHTTP1?: boolean; diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts index d454667ea8..338d942629 100644 --- a/types/node/v9/node-tests.ts +++ b/types/node/v9/node-tests.ts @@ -3741,8 +3741,7 @@ namespace http2_tests { paddingStrategy: 0, peerMaxConcurrentStreams: 0, selectPadding: (frameLen: number, maxFrameLen: number) => 0, - settings, - allowHTTP1: true + settings }; // tslint:disable-next-line prefer-object-spread (ts2.1 feature) let secureServerOptions: http2.SecureServerOptions = Object.assign({}, serverOptions); diff --git a/types/node_redis/tslint.json b/types/node_redis/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/node_redis/tslint.json +++ b/types/node_redis/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodemailer-direct-transport/tslint.json b/types/nodemailer-direct-transport/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodemailer-direct-transport/tslint.json +++ b/types/nodemailer-direct-transport/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodemailer-pickup-transport/tslint.json b/types/nodemailer-pickup-transport/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodemailer-pickup-transport/tslint.json +++ b/types/nodemailer-pickup-transport/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodemailer-smtp-pool/tslint.json b/types/nodemailer-smtp-pool/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodemailer-smtp-pool/tslint.json +++ b/types/nodemailer-smtp-pool/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodemailer-smtp-transport/tslint.json b/types/nodemailer-smtp-transport/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodemailer-smtp-transport/tslint.json +++ b/types/nodemailer-smtp-transport/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodemailer-stub-transport/tslint.json b/types/nodemailer-stub-transport/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodemailer-stub-transport/tslint.json +++ b/types/nodemailer-stub-transport/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nodeunit/tslint.json b/types/nodeunit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nodeunit/tslint.json +++ b/types/nodeunit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/noisejs/tslint.json b/types/noisejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/noisejs/tslint.json +++ b/types/noisejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nomnom/tslint.json b/types/nomnom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nomnom/tslint.json +++ b/types/nomnom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nonogram-solver/index.d.ts b/types/nonogram-solver/index.d.ts new file mode 100644 index 0000000000..a7bb4e7a26 --- /dev/null +++ b/types/nonogram-solver/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for nonogram-solver 2.0 +// Project: https://github.com/thomasr/nonogram-solver +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +declare namespace solve { + class Puzzle { + columnHints: number[][]; + height: number; + rowHints: number[][]; + snapshot: number[]; + width: number; + readonly isFinished: boolean; + readonly isSolved: boolean; + readonly svg: string; + + constructor(data: string | Input); + + import(puzzle: Puzzle): void; + toJSON(): Required; + } + + interface Result { + puzzle: Puzzle; + status: State; + } + + interface Input { + columns: number[][]; + content?: State[]; + rows: number[][]; + } + + type State = 0 | 1 | -1; +} + +declare function solve(filename: string): solve.Result; + +export = solve; diff --git a/types/nonogram-solver/nonogram-solver-tests.ts b/types/nonogram-solver/nonogram-solver-tests.ts new file mode 100644 index 0000000000..5850711fab --- /dev/null +++ b/types/nonogram-solver/nonogram-solver-tests.ts @@ -0,0 +1,10 @@ +import solve = require('nonogram-solver'); + +const { status, puzzle } = solve('input.json'); + +puzzle; // $ExpectType Puzzle +puzzle.columnHints; // $ExpectType number[][] +puzzle.isFinished; // $expectType boolean +puzzle.svg; // $expectType string + +status; // $ExpectType State diff --git a/types/nonogram-solver/tsconfig.json b/types/nonogram-solver/tsconfig.json new file mode 100644 index 0000000000..688aea0d5e --- /dev/null +++ b/types/nonogram-solver/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", + "nonogram-solver-tests.ts" + ] +} diff --git a/types/nonogram-solver/tslint.json b/types/nonogram-solver/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/nonogram-solver/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/nopt/tslint.json b/types/nopt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nopt/tslint.json +++ b/types/nopt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/notie/tslint.json b/types/notie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/notie/tslint.json +++ b/types/notie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/notify/tslint.json b/types/notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/notify/tslint.json +++ b/types/notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/notifyjs-browser/tslint.json b/types/notifyjs-browser/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/notifyjs-browser/tslint.json +++ b/types/notifyjs-browser/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/notifyjs/tslint.json b/types/notifyjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/notifyjs/tslint.json +++ b/types/notifyjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nouislider/tslint.json b/types/nouislider/tslint.json index b6afb8acee..4017299a0e 100644 --- a/types/nouislider/tslint.json +++ b/types/nouislider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/npm/tslint.json b/types/npm/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/npm/tslint.json +++ b/types/npm/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nprogress/tslint.json b/types/nprogress/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nprogress/tslint.json +++ b/types/nprogress/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/numeral/tslint.json b/types/numeral/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/numeral/tslint.json +++ b/types/numeral/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nunjucks-date/tslint.json b/types/nunjucks-date/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nunjucks-date/tslint.json +++ b/types/nunjucks-date/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nvd3/tslint.json b/types/nvd3/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nvd3/tslint.json +++ b/types/nvd3/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nw.gui/tslint.json b/types/nw.gui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nw.gui/tslint.json +++ b/types/nw.gui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/nw.js/tslint.json b/types/nw.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/nw.js/tslint.json +++ b/types/nw.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/o.js/tslint.json b/types/o.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/o.js/tslint.json +++ b/types/o.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/oauth.js/tslint.json b/types/oauth.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/oauth.js/tslint.json +++ b/types/oauth.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/object-assign/tslint.json b/types/object-assign/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/object-assign/tslint.json +++ b/types/object-assign/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/object-diff/tslint.json b/types/object-diff/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/object-diff/tslint.json +++ b/types/object-diff/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/object-hash/tslint.json b/types/object-hash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/object-hash/tslint.json +++ b/types/object-hash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/object-refs/tslint.json b/types/object-refs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/object-refs/tslint.json +++ b/types/object-refs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/oblo-util/tslint.json b/types/oblo-util/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/oblo-util/tslint.json +++ b/types/oblo-util/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/oboe/tslint.json b/types/oboe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/oboe/tslint.json +++ b/types/oboe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/observe-js/tslint.json b/types/observe-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/observe-js/tslint.json +++ b/types/observe-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/oclazyload/tslint.json b/types/oclazyload/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/oclazyload/tslint.json +++ b/types/oclazyload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/odata/tslint.json b/types/odata/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/odata/tslint.json +++ b/types/odata/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 57f2c43830..fe5823c83c 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -660,6 +660,12 @@ declare namespace Office { *
HostsAccess, Excel, Outlook, PowerPoint, Project, Word
*/ interface Context { + /** + * Provides information and access to the signed-in user. + * + * @beta + */ + auth: Auth; /** * True, if the current platform allows the add-in to display a UI for selling or upgrading; otherwise returns False. * @@ -1263,6 +1269,84 @@ declare namespace Office { */ asyncContext?: any } + + /** + * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain an access token to the add-in's web application. + * Indirectly, this also enables the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. + * + * @beta + */ + interface Auth { + /** + * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Enables add-ins to identify users. + * Server side code can use this token to access Microsoft Graph for the add-in's web application by using the + * {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. + * + * Important: In Outlook, this API is not supported if the add-in is loaded in an Outlook.com or Gmail mailbox. + * + * @remarks + * + * + *
HostsExcel, OneNote, Outlook, PowerPoint, Word
Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | IdentityAPI}
+ * + * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational + * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. + * + * @param options - Optional. Accepts an AuthOptions object to define sign-on behaviors. + * @param callback - Optional. Accepts a callback method that can use parse the token for the user's ID or use the token in the "on behalf of" flow to get access to Microsoft Graph. + * If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. + * + * @beta + */ + getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; + /** + * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Enables add-ins to identify users. + * Server side code can use this token to access Microsoft Graph for the add-in's web application by using the + * {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. + * + * Important: In Outlook, this API is not supported if the add-in is loaded in an Outlook.com or Gmail mailbox. + * + * @remarks + * + * + *
HostsExcel, OneNote, Outlook, PowerPoint, Word
Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | IdentityAPI}
+ * + * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational + * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. + * + * @param callback - Optional. Accepts a callback method that can use parse the token for the user's ID or use the token in the "on behalf of" flow to get access to Microsoft Graph. + * If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. + * + * @beta + */ + getAccessTokenAsync(callback?: (result: AsyncResult) => void): void; + } + /** + * Provides options for the user experience when Office obtains an access token to the add-in from AAD v. 2.0 with the getAccessTokenAsync method. + */ + interface AuthOptions { + /** + * Causes Office to display the add-in consent experience. Useful if the add-in's Azure permissions have changed or if the user's consent has + * been revoked. + */ + forceConsent?: boolean, + /** + * Prompts the user to add their Office account (or to switch to it, if it is already added). + */ + forceAddAccount?: boolean, + /** + * Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor + * authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development + * time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" + * call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should + * be used with the authChallenge option. + */ + authChallenge?: string + /** + * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. + */ + asyncContext?: any + } /** * Provides an option for preserving context data of any type, unchanged, for use in a callback. */ @@ -4720,7 +4804,9 @@ declare namespace Office { * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and - * specify the coercionType as Microsoft.Office.Matrix or "matrix". + * specify the coercionType as Microsoft.Office.Matrix or "matrix". However, this technique will block the "calculated columns" feature only + * when one of the following conditions is met: (1) you are writing to all the cells of the column, or (2) there are already at least two + * different formulas in the column. * * @param options Provides options for how to insert data to the selection. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. @@ -4904,7 +4990,9 @@ declare namespace Office { * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and - * specify the coercionType as Microsoft.Office.Matrix or "matrix". + * specify the coercionType as Microsoft.Office.Matrix or "matrix". However, this technique will block the "calculated columns" feature only + * when one of the following conditions is met: (1) you are writing to all the cells of the column, or (2) there are already at least two + * different formulas in the column. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. @@ -69002,6 +69090,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor: string; @@ -74220,6 +74312,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor?: string; @@ -75342,6 +75438,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor?: string; @@ -76902,6 +77002,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor?: boolean; diff --git a/types/office-js-preview/tslint.json b/types/office-js-preview/tslint.json index 86c4ba7acc..e0b27fe373 100644 --- a/types/office-js-preview/tslint.json +++ b/types/office-js-preview/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "file-name-casing": false, diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index a9ad9e3de3..7cb6b8e2cc 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -4720,7 +4720,9 @@ declare namespace Office { * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and - * specify the coercionType as Microsoft.Office.Matrix or "matrix". + * specify the coercionType as Microsoft.Office.Matrix or "matrix". However, this technique will block the "calculated columns" feature only + * when one of the following conditions is met: (1) you are writing to all the cells of the column, or (2) there are already at least two + * different formulas in the column. * * @param options Provides options for how to insert data to the selection. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. @@ -4904,7 +4906,9 @@ declare namespace Office { * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and - * specify the coercionType as Microsoft.Office.Matrix or "matrix". + * specify the coercionType as Microsoft.Office.Matrix or "matrix". However, this technique will block the "calculated columns" feature only + * when one of the following conditions is met: (1) you are writing to all the cells of the column, or (2) there are already at least two + * different formulas in the column. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. @@ -52440,6 +52444,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor: string; @@ -57254,6 +57262,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor?: string; @@ -58388,6 +58400,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor?: string; @@ -60102,6 +60118,10 @@ declare namespace Word { * * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, an empty string for mixed highlight colors, or null for no highlight color. * + * **Note**: Only the default highlight colors are available in Office for Windows Desktop. + * These are "Yellow", "Lime", "Turquoise", "Pink", "Blue", "Red", "DarkBlue", "Teal", "Green", "Purple", "DarkRed", "Olive", "Gray", "LightGray", and "Black". + * When the add-in runs in Office for Windows Desktop, any other color is converted to the closest color when applied to the font. + * * [Api set: WordApi 1.1] */ highlightColor?: boolean; diff --git a/types/office-js/tslint.json b/types/office-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/office-js/tslint.json +++ b/types/office-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/offline-js/tslint.json b/types/offline-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/offline-js/tslint.json +++ b/types/offline-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/oidc-token-manager/tslint.json b/types/oidc-token-manager/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/oidc-token-manager/tslint.json +++ b/types/oidc-token-manager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/onoff/tslint.json b/types/onoff/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/onoff/tslint.json +++ b/types/onoff/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/open/tslint.json b/types/open/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/open/tslint.json +++ b/types/open/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/openjscad/tslint.json b/types/openjscad/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/openjscad/tslint.json +++ b/types/openjscad/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/openpgp/index.d.ts b/types/openpgp/index.d.ts index 5d8c4a2cb6..c9a95e8c6a 100644 --- a/types/openpgp/index.d.ts +++ b/types/openpgp/index.d.ts @@ -19,1514 +19,1488 @@ type Integer = number; type Infinity = any; type ReadableStream = any; -export namespace openpgp { - namespace cleartext { +export as namespace openpgp; + +export namespace cleartext { + /** + * Class that represents an OpenPGP cleartext signed message. + * See {@link https://tools.ietf.org/html/rfc4880#section-7} + */ + class CleartextMessage { /** - * Class that represents an OpenPGP cleartext signed message. - * See {@link https://tools.ietf.org/html/rfc4880#section-7} + * @param text The cleartext of the signed message + * @param signature The detached signature or an empty signature for unsigned messages */ - class CleartextMessage { - /** - * @param text The cleartext of the signed message - * @param signature The detached signature or an empty signature for unsigned messages - */ - constructor(text: string, signature: signature.Signature); - - /** - * Returns the key IDs of the keys that signed the cleartext message - * @returns array of keyid objects - */ - getSigningKeyIds(): any[]; - - /** - * Sign the cleartext message - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature - * @param date (optional) The creation time of the signature that should be created - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new cleartext message with signed content - */ - sign(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; - - /** - * Sign the cleartext message - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature - * @param date (optional) The creation time of the signature that should be created - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new detached signature of message content - */ - signDetached(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; - - /** - * Verify signatures of cleartext signed message - * @param keys array of keys to verify signatures - * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @returns list of signer's keyid and validity of signature - */ - verify(keys: any[], date: Date): Promise>; - - /** - * Verify signatures of cleartext signed message - * @param keys array of keys to verify signatures - * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @returns list of signer's keyid and validity of signature - */ - verifyDetached(keys: any[], date: Date): Promise>; - - /** - * Get cleartext - * @returns cleartext of message - */ - getText(): string; - - /** - * Returns ASCII armored text of cleartext signed message - * @returns ASCII armor - */ - armor(): string | ReadableStream; - } + constructor(text: string, signature: signature.Signature); /** - * reads an OpenPGP cleartext signed message and returns a CleartextMessage object - * @param armoredText text to be parsed - * @returns new cleartext message object + * Returns the key IDs of the keys that signed the cleartext message + * @returns array of keyid objects */ - function readArmored(armoredText: string | ReadableStream): CleartextMessage; + getSigningKeyIds(): any[]; /** - * Creates a new CleartextMessage object from text - * @param text + * Sign the cleartext message + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature + * @param date (optional) The creation time of the signature that should be created + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns new cleartext message with signed content */ - function fromText(text: string): void; + sign(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + + /** + * Sign the cleartext message + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature + * @param date (optional) The creation time of the signature that should be created + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns new detached signature of message content + */ + signDetached(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + + /** + * Verify signatures of cleartext signed message + * @param keys array of keys to verify signatures + * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + verify(keys: any[], date: Date): Promise>; + + /** + * Verify signatures of cleartext signed message + * @param keys array of keys to verify signatures + * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + verifyDetached(keys: any[], date: Date): Promise>; + + /** + * Get cleartext + * @returns cleartext of message + */ + getText(): string; + + /** + * Returns ASCII armored text of cleartext signed message + * @returns ASCII armor + */ + armor(): string | ReadableStream; } /** - * @see module:config/config + * reads an OpenPGP cleartext signed message and returns a CleartextMessage object + * @param armoredText text to be parsed + * @returns new cleartext message object */ - namespace config { - var prefer_hash_algorithm: any; - - var encryption_cipher: any; - - var compression: any; - - var deflate_level: any; - - /** - * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. - * **NOT INTEROPERABLE WITH OTHER OPENPGP IMPLEMENTATIONS** - * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION** - */ - var aead_protect: any; - - /** - * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. - * 0 means we implement a variant of {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00|this IETF draft}. - * 4 means we implement {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04|RFC4880bis-04}. - * Note that this determines how AEAD packets are parsed even when aead_protect is set to false - */ - var aead_protect_version: any; - - /** - * Default Authenticated Encryption with Additional Data (AEAD) encryption mode - * Only has an effect when aead_protect is set to true. - */ - var aead_mode: any; - - /** - * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode - * Only has an effect when aead_protect is set to true. - * Must be an integer value from 0 to 56. - */ - var aead_chunk_size_byte: any; - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}: - * Iteration Count Byte for S2K (String to Key) - */ - var s2k_iteration_count_byte: any; - - /** - * Use integrity protection for symmetric encryption - */ - var integrity_protect: any; - - var ignore_mdc_error: any; - - var allow_unauthenticated_stream: any; - - var checksum_required: any; - - var rsa_blinding: any; - - /** - * Work-around for rare GPG decryption bug when encrypting with multiple passwords. - * **Slower and slightly less secure** - */ - var password_collision_check: any; - - var revocations_expire: any; - - var use_native: any; - - var min_bytes_for_web_crypto: any; - - var zero_copy: any; - - var debug: any; - - var tolerant: any; - - var show_version: any; - - var show_comment: any; - - var versionstring: any; - - var commentstring: any; - - var keyserver: any; - - var node_store: any; - - /** - * Max userid string length (used for parsing) - */ - var max_userid_length: any; - - namespace localStorage { - class LocalStorage { - /** - * This object is used for storing and retrieving configuration from HTML5 local storage. - */ - constructor(); - - /** - * Reads the config out of the HTML5 local storage - * and initializes the object config. - * if config is null the default config will be used - */ - read(): void; - - /** - * Writes the config to HTML5 local storage - */ - write(): void; - } - } - } - - class LocalStorage { - /** - * This object is used for storing and retrieving configuration from HTML5 local storage. - */ - constructor(); - - /** - * Reads the config out of the HTML5 local storage - * and initializes the object config. - * if config is null the default config will be used - */ - read(): void; - - /** - * Writes the config to HTML5 local storage - */ - write(): void; - } - - + function readArmored(armoredText: string | ReadableStream): CleartextMessage; /** - * @see module:crypto/crypto - * @see module:crypto/signature - * @see module:crypto/public_key - * @see module:crypto/cipher - * @see module:crypto/random - * @see module:crypto/hash + * Creates a new CleartextMessage object from text + * @param text */ + function fromText(text: string): void; +} + +/** + * @see module:config/config + */ +export namespace config { + var prefer_hash_algorithm: any; + + var encryption_cipher: any; + + var compression: any; + + var deflate_level: any; + + /** + * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. + * **NOT INTEROPERABLE WITH OTHER OPENPGP IMPLEMENTATIONS** + * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION** + */ + var aead_protect: any; + + /** + * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. + * 0 means we implement a variant of {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00|this IETF draft}. + * 4 means we implement {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04|RFC4880bis-04}. + * Note that this determines how AEAD packets are parsed even when aead_protect is set to false + */ + var aead_protect_version: any; + + /** + * Default Authenticated Encryption with Additional Data (AEAD) encryption mode + * Only has an effect when aead_protect is set to true. + */ + var aead_mode: any; + + /** + * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode + * Only has an effect when aead_protect is set to true. + * Must be an integer value from 0 to 56. + */ + var aead_chunk_size_byte: any; + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}: + * Iteration Count Byte for S2K (String to Key) + */ + var s2k_iteration_count_byte: any; + + /** + * Use integrity protection for symmetric encryption + */ + var integrity_protect: any; + + var ignore_mdc_error: any; + + var allow_unauthenticated_stream: any; + + var checksum_required: any; + + var rsa_blinding: any; + + /** + * Work-around for rare GPG decryption bug when encrypting with multiple passwords. + * **Slower and slightly less secure** + */ + var password_collision_check: any; + + var revocations_expire: any; + + var use_native: any; + + var min_bytes_for_web_crypto: any; + + var zero_copy: any; + + var debug: any; + + var tolerant: any; + + var show_version: any; + + var show_comment: any; + + var versionstring: any; + + var commentstring: any; + + var keyserver: any; + + var node_store: any; + + /** + * Max userid string length (used for parsing) + */ + var max_userid_length: any; + + namespace localStorage { + class LocalStorage { + /** + * This object is used for storing and retrieving configuration from HTML5 local storage. + */ + constructor(); + + /** + * Reads the config out of the HTML5 local storage + * and initializes the object config. + * if config is null the default config will be used + */ + read(): void; + + /** + * Writes the config to HTML5 local storage + */ + write(): void; + } + } +} + +export class LocalStorage { + /** + * This object is used for storing and retrieving configuration from HTML5 local storage. + */ + constructor(); + + /** + * Reads the config out of the HTML5 local storage + * and initializes the object config. + * if config is null the default config will be used + */ + read(): void; + + /** + * Writes the config to HTML5 local storage + */ + write(): void; +} + + + +/** + * @see module:crypto/crypto + * @see module:crypto/signature + * @see module:crypto/public_key + * @see module:crypto/cipher + * @see module:crypto/random + * @see module:crypto/hash + */ +export namespace crypto { + /** + * @see module:crypto/public_key/elliptic/ecdh + */ + namespace aes_kw { + /** + * AES key wrap + * @param key + * @param data + * @returns + */ + function wrap(key: string, data: string): Uint8Array; + + /** + * AES key unwrap + * @param key + * @param data + * @returns + * @throws + */ + function unwrap(key: string, data: string): Uint8Array; + } + + namespace cfb { + function encrypt(algo: any, key: any, plaintext: any, iv: any): any + function decrypt(algo: any, key: any, ciphertext: any, iv: any): Promise + } + + namespace cipher { + /** + * AES-128 encryption and decryption (ID 7) + * @param key 128-bit key + * @see + * @see + * @returns + */ + function aes128(key: string): object; + + /** + * AES-128 Block Cipher (ID 8) + * @param key 192-bit key + * @see + * @see + * @returns + */ + function aes192(key: string): object; + + /** + * AES-128 Block Cipher (ID 9) + * @param key 256-bit key + * @see + * @see + * @returns + */ + function aes256(key: string): object; + + /** + * Triple DES Block Cipher (ID 2) + * @param key 192-bit key + * @see + * @returns + */ + function tripledes(key: string): object; + + /** + * CAST-128 Block Cipher (ID 3) + * @param key 128-bit key + * @see + * @returns + */ + function cast5(key: string): object; + + /** + * Twofish Block Cipher (ID 10) + * @param key 256-bit key + * @see + * @returns + */ + function twofish(key: string): object; + + /** + * Blowfish Block Cipher (ID 4) + * @param key 128-bit key + * @see + * @returns + */ + function blowfish(key: string): object; + + /** + * Not implemented + * @throws + */ + function idea(): void; + } + + namespace cmac { + /** + * This implementation of CMAC is based on the description of OMAC in + * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that + * document: + * We have made a small modification to the OMAC algorithm as it was + * originally presented, changing one of its two constants. + * Specifically, the constant 4 at line 85 was the constant 1/2 (the + * multiplicative inverse of 2) in the original definition of OMAC [14]. + * The OMAC authors indicate that they will promulgate this modification + * [15], which slightly simplifies implementations. + */ + const blockLength: any; + + /** + * xor `padding` into the end of `data`. This function implements "the + * operation xor→ [which] xors the shorter string into the end of longer + * one". Since data is always as least as long as padding, we can + * simplify the implementation. + * @param data + * @param padding + */ + function rightXorMut(data: Uint8Array, padding: Uint8Array): void; + } + namespace crypto { /** - * @see module:crypto/public_key/elliptic/ecdh + * Encrypts data using specified algorithm and public key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. + * @param algo Public key algorithm + * @param pub_params Algorithm-specific public key parameters + * @param data Data to be encrypted as MPI + * @param fingerprint Recipient fingerprint + * @returns encrypted session key parameters + */ + function publicKeyEncrypt(algo: enums.publicKey, pub_params: Array, data: type.mpi.MPI, fingerprint: string): any[]; + + /** + * Decrypts data using specified algorithm and private key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. + * @param algo Public key algorithm + * @param key_params Algorithm-specific public, private key parameters + * @param data_params encrypted session key parameters + * @param fingerprint Recipient fingerprint + * @returns An MPI containing the decrypted data + */ + function publicKeyDecrypt(algo: enums.publicKey, key_params: Array, data_params: Array, fingerprint: string): type.mpi.MPI; + + /** + * Returns the types comprising the private key of an algorithm + * @param algo The public key algorithm + * @returns The array of types + */ + function getPrivKeyParamTypes(algo: string): any[]; + + /** + * Returns the types comprising the public key of an algorithm + * @param algo The public key algorithm + * @returns The array of types + */ + function getPubKeyParamTypes(algo: string): any[]; + + /** + * Returns the types comprising the encrypted session key of an algorithm + * @param algo The public key algorithm + * @returns The array of types + */ + function getEncSessionKeyParamTypes(algo: string): any[]; + + /** + * Generate algorithm-specific key parameters + * @param algo The public key algorithm + * @param bits Bit length for RSA keys + * @param oid Object identifier for ECC keys + * @returns The array of parameters + */ + function generateParams(algo: string, bits: Integer, oid: type.oid.OID): any[]; + + /** + * Generates a random byte prefix for the specified algorithm + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param algo Symmetric encryption algorithm + * @returns Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated. + */ + function getPrefixRandom(algo: enums.symmetric): Uint8Array; + + /** + * Generating a session key for the specified symmetric algorithm + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param algo Symmetric encryption algorithm + * @returns Random bytes as a string to be used as a key + */ + function generateSessionKey(algo: enums.symmetric): Uint8Array; + } + + namespace eax { + /** + * Class to en/decrypt using EAX mode. + * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' + * @param key The encryption key + */ + function EAX(cipher: string, key: Uint8Array): void; + + /** + * Encrypt plaintext input. + * @param plaintext The cleartext input to be encrypted + * @param nonce The nonce (16 bytes) + * @param adata Associated data to sign + * @returns The ciphertext output + */ + function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + + /** + * Decrypt ciphertext input. + * @param ciphertext The ciphertext input to be decrypted + * @param nonce The nonce (16 bytes) + * @param adata Associated data to verify + * @returns The plaintext output + */ + function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + } + + namespace gcm { + /** + * Class to en/decrypt using GCM mode. + * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' + * @param key The encryption key + */ + function GCM(cipher: string, key: Uint8Array): void; + } + + /** + * @see + * @see */ - namespace aes_kw { + namespace hash { + /** + * @see module:md5 + */ + var md5: any; + + /** + * @see asmCrypto + */ + var sha1: any; + + /** + * @see hash.js + */ + var sha224: any; + + /** + * @see asmCrypto + */ + var sha256: any; + + /** + * @see hash.js + */ + var sha384: any; + + /** + * @see asmCrypto + */ + var sha512: any; + + /** + * @see hash.js + */ + var ripemd: any; + + /** + * Create a hash on the specified data using the specified algorithm + * @param algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) + * @param data Data to be hashed + * @returns hash value + */ + function digest(algo: enums.hash, data: Uint8Array): Promise; + + /** + * Returns the hash size in bytes of the specified hash algorithm type + * @param algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) + * @returns Size in bytes of the resulting hash + */ + function getHashByteLength(algo: enums.hash): Integer; + } + + /** + * @see module:packet.PublicKeyEncryptedSessionKey + */ + namespace pkcs5 { + /** + * Add pkcs5 padding to a text. + * @param msg Text to add padding + * @returns Text with padding added + */ + function encode(msg: string): string; + + /** + * Remove pkcs5 padding from a string. + * @param msg Text to remove padding from + * @returns Text with padding removed + */ + function decode(msg: string): string; + } + + namespace ocb { + /** + * Class to en/decrypt using OCB mode. + * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' + * @param key The encryption key + */ + function OCB(cipher: string, key: Uint8Array): void; + + /** + * Encrypt plaintext input. + * @param plaintext The cleartext input to be encrypted + * @param nonce The nonce (15 bytes) + * @param adata Associated data to sign + * @returns The ciphertext output + */ + function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + + /** + * Decrypt ciphertext input. + * @param ciphertext The ciphertext input to be decrypted + * @param nonce The nonce (15 bytes) + * @param adata Associated data to sign + * @returns The ciphertext output + */ + function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + } + + /** + * @see module:crypto/public_key/rsa + * @see module:crypto/public_key/elliptic/ecdh + * @see module:packet.PublicKeyEncryptedSessionKey + */ + namespace pkcs1 { + namespace eme { /** - * AES key wrap - * @param key - * @param data - * @returns + * Create a EME-PKCS1-v1_5 padded message + * @see + * @param M message to be encoded + * @param k the length in octets of the key modulus + * @returns EME-PKCS1 padded message */ - function wrap(key: string, data: string): Uint8Array; + function encode(M: string, k: Integer): Promise; /** - * AES key unwrap - * @param key - * @param data - * @returns - * @throws + * Decode a EME-PKCS1-v1_5 padded message + * @see + * @param EM encoded message, an octet string + * @returns message, an octet string */ - function unwrap(key: string, data: string): Uint8Array; + function decode(EM: string): string; } - namespace cfb { - function encrypt(algo: any, key: any, plaintext: any, iv: any): any - function decrypt(algo: any, key: any, ciphertext: any, iv: any): Promise - } - - namespace cipher { + namespace emsa { /** - * AES-128 encryption and decryption (ID 7) - * @param key 128-bit key + * Create a EMSA-PKCS1-v1_5 padded message * @see - * @see - * @returns + * @param algo Hash algorithm type used + * @param hashed message to be encoded + * @param emLen intended length in octets of the encoded message + * @returns encoded message */ - function aes128(key: string): object; - - /** - * AES-128 Block Cipher (ID 8) - * @param key 192-bit key - * @see - * @see - * @returns - */ - function aes192(key: string): object; - - /** - * AES-128 Block Cipher (ID 9) - * @param key 256-bit key - * @see - * @see - * @returns - */ - function aes256(key: string): object; - - /** - * Triple DES Block Cipher (ID 2) - * @param key 192-bit key - * @see - * @returns - */ - function tripledes(key: string): object; - - /** - * CAST-128 Block Cipher (ID 3) - * @param key 128-bit key - * @see - * @returns - */ - function cast5(key: string): object; - - /** - * Twofish Block Cipher (ID 10) - * @param key 256-bit key - * @see - * @returns - */ - function twofish(key: string): object; - - /** - * Blowfish Block Cipher (ID 4) - * @param key 128-bit key - * @see - * @returns - */ - function blowfish(key: string): object; - - /** - * Not implemented - * @throws - */ - function idea(): void; - } - - namespace cmac { - /** - * This implementation of CMAC is based on the description of OMAC in - * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that - * document: - * We have made a small modification to the OMAC algorithm as it was - * originally presented, changing one of its two constants. - * Specifically, the constant 4 at line 85 was the constant 1/2 (the - * multiplicative inverse of 2) in the original definition of OMAC [14]. - * The OMAC authors indicate that they will promulgate this modification - * [15], which slightly simplifies implementations. - */ - const blockLength: any; - - /** - * xor `padding` into the end of `data`. This function implements "the - * operation xor→ [which] xors the shorter string into the end of longer - * one". Since data is always as least as long as padding, we can - * simplify the implementation. - * @param data - * @param padding - */ - function rightXorMut(data: Uint8Array, padding: Uint8Array): void; - } - - namespace crypto { - /** - * Encrypts data using specified algorithm and public key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. - * @param algo Public key algorithm - * @param pub_params Algorithm-specific public key parameters - * @param data Data to be encrypted as MPI - * @param fingerprint Recipient fingerprint - * @returns encrypted session key parameters - */ - function publicKeyEncrypt(algo: enums.publicKey, pub_params: Array, data: type.mpi.MPI, fingerprint: string): any[]; - - /** - * Decrypts data using specified algorithm and private key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. - * @param algo Public key algorithm - * @param key_params Algorithm-specific public, private key parameters - * @param data_params encrypted session key parameters - * @param fingerprint Recipient fingerprint - * @returns An MPI containing the decrypted data - */ - function publicKeyDecrypt(algo: enums.publicKey, key_params: Array, data_params: Array, fingerprint: string): type.mpi.MPI; - - /** - * Returns the types comprising the private key of an algorithm - * @param algo The public key algorithm - * @returns The array of types - */ - function getPrivKeyParamTypes(algo: string): any[]; - - /** - * Returns the types comprising the public key of an algorithm - * @param algo The public key algorithm - * @returns The array of types - */ - function getPubKeyParamTypes(algo: string): any[]; - - /** - * Returns the types comprising the encrypted session key of an algorithm - * @param algo The public key algorithm - * @returns The array of types - */ - function getEncSessionKeyParamTypes(algo: string): any[]; - - /** - * Generate algorithm-specific key parameters - * @param algo The public key algorithm - * @param bits Bit length for RSA keys - * @param oid Object identifier for ECC keys - * @returns The array of parameters - */ - function generateParams(algo: string, bits: Integer, oid: type.oid.OID): any[]; - - /** - * Generates a random byte prefix for the specified algorithm - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param algo Symmetric encryption algorithm - * @returns Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated. - */ - function getPrefixRandom(algo: enums.symmetric): Uint8Array; - - /** - * Generating a session key for the specified symmetric algorithm - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param algo Symmetric encryption algorithm - * @returns Random bytes as a string to be used as a key - */ - function generateSessionKey(algo: enums.symmetric): Uint8Array; - } - - namespace eax { - /** - * Class to en/decrypt using EAX mode. - * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' - * @param key The encryption key - */ - function EAX(cipher: string, key: Uint8Array): void; - - /** - * Encrypt plaintext input. - * @param plaintext The cleartext input to be encrypted - * @param nonce The nonce (16 bytes) - * @param adata Associated data to sign - * @returns The ciphertext output - */ - function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - - /** - * Decrypt ciphertext input. - * @param ciphertext The ciphertext input to be decrypted - * @param nonce The nonce (16 bytes) - * @param adata Associated data to verify - * @returns The plaintext output - */ - function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - } - - namespace gcm { - /** - * Class to en/decrypt using GCM mode. - * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' - * @param key The encryption key - */ - function GCM(cipher: string, key: Uint8Array): void; + function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; } /** - * @see + * ASN1 object identifiers for hashes * @see */ - namespace hash { + const hash_headers: any; + } + + namespace public_key { + namespace dsa { /** - * @see module:md5 + * DSA Sign function + * @param hash_algo + * @param hashed + * @param g + * @param p + * @param q + * @param x + * @returns */ - var md5: any; + function sign(hash_algo: Integer, hashed: Uint8Array, g: BN, p: BN, q: BN, x: BN): object; /** - * @see asmCrypto + * DSA Verify function + * @param hash_algo + * @param r + * @param s + * @param hashed + * @param g + * @param p + * @param q + * @param y + * @returns BN */ - var sha1: any; + function verify(hash_algo: Integer, r: BN, s: BN, hashed: Uint8Array, g: BN, p: BN, q: BN, y: BN): any; + } + + namespace elgamal { + /** + * ElGamal Encryption function + * @param m + * @param p + * @param g + * @param y + * @returns + */ + function encrypt(m: BN, p: BN, g: BN, y: BN): object; /** - * @see hash.js + * ElGamal Encryption function + * @param c1 + * @param c2 + * @param p + * @param x + * @returns BN */ - var sha224: any; - - /** - * @see asmCrypto - */ - var sha256: any; - - /** - * @see hash.js - */ - var sha384: any; - - /** - * @see asmCrypto - */ - var sha512: any; - - /** - * @see hash.js - */ - var ripemd: any; - - /** - * Create a hash on the specified data using the specified algorithm - * @param algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) - * @param data Data to be hashed - * @returns hash value - */ - function digest(algo: enums.hash, data: Uint8Array): Promise; - - /** - * Returns the hash size in bytes of the specified hash algorithm type - * @param algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) - * @returns Size in bytes of the resulting hash - */ - function getHashByteLength(algo: enums.hash): Integer; + function decrypt(c1: BN, c2: BN, p: BN, x: BN): any; } /** - * @see module:packet.PublicKeyEncryptedSessionKey - */ - namespace pkcs5 { - /** - * Add pkcs5 padding to a text. - * @param msg Text to add padding - * @returns Text with padding added - */ - function encode(msg: string): string; - - /** - * Remove pkcs5 padding from a string. - * @param msg Text to remove padding from - * @returns Text with padding removed - */ - function decode(msg: string): string; - } - - namespace ocb { - /** - * Class to en/decrypt using OCB mode. - * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' - * @param key The encryption key - */ - function OCB(cipher: string, key: Uint8Array): void; - - /** - * Encrypt plaintext input. - * @param plaintext The cleartext input to be encrypted - * @param nonce The nonce (15 bytes) - * @param adata Associated data to sign - * @returns The ciphertext output - */ - function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - - /** - * Decrypt ciphertext input. - * @param ciphertext The ciphertext input to be decrypted - * @param nonce The nonce (15 bytes) - * @param adata Associated data to sign - * @returns The ciphertext output - */ - function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - } - - /** - * @see module:crypto/public_key/rsa + * @see module:crypto/public_key/elliptic/curve * @see module:crypto/public_key/elliptic/ecdh - * @see module:packet.PublicKeyEncryptedSessionKey + * @see module:crypto/public_key/elliptic/ecdsa + * @see module:crypto/public_key/elliptic/eddsa */ - namespace pkcs1 { - namespace eme { - /** - * Create a EME-PKCS1-v1_5 padded message - * @see - * @param M message to be encoded - * @param k the length in octets of the key modulus - * @returns EME-PKCS1 padded message - */ - function encode(M: string, k: Integer): Promise; - - /** - * Decode a EME-PKCS1-v1_5 padded message - * @see - * @param EM encoded message, an octet string - * @returns message, an octet string - */ - function decode(EM: string): string; - } - - namespace emsa { - /** - * Create a EMSA-PKCS1-v1_5 padded message - * @see - * @param algo Hash algorithm type used - * @param hashed message to be encoded - * @param emLen intended length in octets of the encoded message - * @returns encoded message - */ - function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; - } - - /** - * ASN1 object identifiers for hashes - * @see - */ - const hash_headers: any; - } - - namespace public_key { - namespace dsa { - /** - * DSA Sign function - * @param hash_algo - * @param hashed - * @param g - * @param p - * @param q - * @param x - * @returns - */ - function sign(hash_algo: Integer, hashed: Uint8Array, g: BN, p: BN, q: BN, x: BN): object; - - /** - * DSA Verify function - * @param hash_algo - * @param r - * @param s - * @param hashed - * @param g - * @param p - * @param q - * @param y - * @returns BN - */ - function verify(hash_algo: Integer, r: BN, s: BN, hashed: Uint8Array, g: BN, p: BN, q: BN, y: BN): any; - } - - namespace elgamal { - /** - * ElGamal Encryption function - * @param m - * @param p - * @param g - * @param y - * @returns - */ - function encrypt(m: BN, p: BN, g: BN, y: BN): object; - - /** - * ElGamal Encryption function - * @param c1 - * @param c2 - * @param p - * @param x - * @returns BN - */ - function decrypt(c1: BN, c2: BN, p: BN, x: BN): any; - } - - /** - * @see module:crypto/public_key/elliptic/curve - * @see module:crypto/public_key/elliptic/ecdh - * @see module:crypto/public_key/elliptic/ecdsa - * @see module:crypto/public_key/elliptic/eddsa - */ - namespace elliptic { - namespace curve { - class Curve { - } - } - - namespace ecdh { - /** - * Generate ECDHE ephemeral key and secret from public key - * @param curve Elliptic curve object - * @param Q Recipient public key - * @returns Returns public part of ephemeral key and generated ephemeral secret - */ - function genPublicEphemeralKey(curve: curve.Curve, Q: Uint8Array): Promise<{ V: Uint8Array, S: BN }>; - - /** - * Encrypt and wrap a session key - * @param oid Elliptic curve object identifier - * @param cipher_algo Symmetric cipher to use - * @param hash_algo Hash algorithm to use - * @param m Value derived from session key (RFC 6637) - * @param Q Recipient public key - * @param fingerprint Recipient fingerprint - * @returns Returns public part of ephemeral key and encoded session key - */ - function encrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, m: type.mpi.MPI, Q: Uint8Array, fingerprint: string): Promise<{ V: BN, C: BN }>; - - /** - * Generate ECDHE secret from private key and public part of ephemeral key - * @param curve Elliptic curve object - * @param V Public part of ephemeral key - * @param d Recipient private key - * @returns Generated ephemeral secret - */ - function genPrivateEphemeralKey(curve: curve.Curve, V: Uint8Array, d: Uint8Array): Promise; - - /** - * Decrypt and unwrap the value derived from session key - * @param oid Elliptic curve object identifier - * @param cipher_algo Symmetric cipher to use - * @param hash_algo Hash algorithm to use - * @param V Public part of ephemeral key - * @param C Encrypted and wrapped value derived from session key - * @param d Recipient private key - * @param fingerprint Recipient fingerprint - * @returns Value derived from session - */ - function decrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, V: Uint8Array, C: Uint8Array, d: Uint8Array, fingerprint: string): Promise; - } - - namespace ecdsa { - /** - * Sign a message using the provided key - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used to sign - * @param m Message to sign - * @param d Private key used to sign the message - * @param hashed The hashed message - * @returns Signature of the message - */ - function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; - - /** - * Verifies if a signature is valid for a message - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used in the signature - * @param signature Signature to verify - * @param m Message to verify - * @param Q Public key used to verify the message - * @param hashed The hashed message - * @returns - */ - function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; - } - - namespace eddsa { - /** - * Sign a message using the provided keygit - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used to sign - * @param m Message to sign - * @param d Private key used to sign - * @param hashed The hashed message - * @returns Signature of the message - */ - function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; - - /** - * Verifies if a signature is valid for a message - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used in the signature - * @param signature Signature to verify the message - * @param m Message to verify - * @param Q Public key used to verify the message - * @param hashed The hashed message - * @returns - */ - function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; - } - - namespace key { - class KeyPair { - } + namespace elliptic { + namespace curve { + class Curve { } } - namespace prime { + namespace ecdh { /** - * Probabilistic random number generator - * @param bits Bit length of the prime - * @param e Optional RSA exponent to check against the prime - * @param k Optional number of iterations of Miller-Rabin test - * @returns BN + * Generate ECDHE ephemeral key and secret from public key + * @param curve Elliptic curve object + * @param Q Recipient public key + * @returns Returns public part of ephemeral key and generated ephemeral secret */ - function randomProbablePrime(bits: Integer, e: BN, k: Integer): any; + function genPublicEphemeralKey(curve: curve.Curve, Q: Uint8Array): Promise<{ V: Uint8Array, S: BN }>; /** - * Probabilistic primality testing - * @param n Number to test - * @param e Optional RSA exponent to check against the prime - * @param k Optional number of iterations of Miller-Rabin test - * @returns + * Encrypt and wrap a session key + * @param oid Elliptic curve object identifier + * @param cipher_algo Symmetric cipher to use + * @param hash_algo Hash algorithm to use + * @param m Value derived from session key (RFC 6637) + * @param Q Recipient public key + * @param fingerprint Recipient fingerprint + * @returns Returns public part of ephemeral key and encoded session key */ - function isProbablePrime(n: BN, e: BN, k: Integer): boolean; + function encrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, m: type.mpi.MPI, Q: Uint8Array, fingerprint: string): Promise<{ V: BN, C: BN }>; /** - * Tests whether n is probably prime or not using Fermat's test with b = 2. - * Fails if b^(n-1) mod n === 1. - * @param n Number to test - * @param b Optional Fermat test base - * @returns + * Generate ECDHE secret from private key and public part of ephemeral key + * @param curve Elliptic curve object + * @param V Public part of ephemeral key + * @param d Recipient private key + * @returns Generated ephemeral secret */ - function fermat(n: BN, b: Integer): boolean; + function genPrivateEphemeralKey(curve: curve.Curve, V: Uint8Array, d: Uint8Array): Promise; /** - * Tests whether n is probably prime or not using the Miller-Rabin test. - * See HAC Remark 4.28. - * @param n Number to test - * @param k Optional number of iterations of Miller-Rabin test - * @param rand Optional function to generate potential witnesses - * @returns + * Decrypt and unwrap the value derived from session key + * @param oid Elliptic curve object identifier + * @param cipher_algo Symmetric cipher to use + * @param hash_algo Hash algorithm to use + * @param V Public part of ephemeral key + * @param C Encrypted and wrapped value derived from session key + * @param d Recipient private key + * @param fingerprint Recipient fingerprint + * @returns Value derived from session */ - function millerRabin(n: BN, k: Integer, rand: Function): boolean; + function decrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, V: Uint8Array, C: Uint8Array, d: Uint8Array, fingerprint: string): Promise; } - namespace rsa { + namespace ecdsa { /** - * Create signature - * @param m message - * @param n RSA public modulus - * @param e RSA public exponent - * @param d RSA private exponent - * @returns RSA Signature + * Sign a message using the provided key + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used to sign + * @param m Message to sign + * @param d Private key used to sign the message + * @param hashed The hashed message + * @returns Signature of the message */ - function sign(m: BN, n: BN, e: BN, d: BN): BN; + function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; /** - * Verify signature - * @param s signature - * @param n RSA public modulus - * @param e RSA public exponent + * Verifies if a signature is valid for a message + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used in the signature + * @param signature Signature to verify + * @param m Message to verify + * @param Q Public key used to verify the message + * @param hashed The hashed message * @returns */ - function verify(s: BN, n: BN, e: BN): BN; + function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; + } + + namespace eddsa { + /** + * Sign a message using the provided keygit + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used to sign + * @param m Message to sign + * @param d Private key used to sign + * @param hashed The hashed message + * @returns Signature of the message + */ + function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; /** - * Encrypt message - * @param m message - * @param n RSA public modulus - * @param e RSA public exponent - * @returns RSA Ciphertext + * Verifies if a signature is valid for a message + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used in the signature + * @param signature Signature to verify the message + * @param m Message to verify + * @param Q Public key used to verify the message + * @param hashed The hashed message + * @returns */ - function encrypt(m: BN, n: BN, e: BN): BN; + function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; + } - /** - * Decrypt RSA message - * @param m message - * @param n RSA public modulus - * @param e RSA public exponent - * @param d RSA private exponent - * @param p RSA private prime p - * @param q RSA private prime q - * @param u RSA private inverse of prime q - * @returns RSA Plaintext - */ - function decrypt(m: BN, n: BN, e: BN, d: BN, p: BN, q: BN, u: BN): BN; - - /** - * Generate a new random private key B bits long with public exponent E. - * When possible, webCrypto is used. Otherwise, primes are generated using - * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm. - * @see module:crypto/public_key/prime - * @param B RSA bit length - * @param E RSA public exponent in hex string - * @returns RSA public modulus, RSA public exponent, RSA private exponent, - * RSA private prime p, RSA private prime q, u = q ** -1 mod p - */ - function generate(B: Integer, E: string): object; + namespace key { + class KeyPair { + } } } - namespace random { + namespace prime { /** - * Retrieve secure random byte array of the specified length - * @param length Length in bytes to generate - * @returns Random byte array + * Probabilistic random number generator + * @param bits Bit length of the prime + * @param e Optional RSA exponent to check against the prime + * @param k Optional number of iterations of Miller-Rabin test + * @returns BN */ - function getRandomBytes(length: Integer): Uint8Array; + function randomProbablePrime(bits: Integer, e: BN, k: Integer): any; /** - * Create a secure random MPI that is greater than or equal to min and less than max. - * @param min Lower bound, included - * @param max Upper bound, excluded - * @returns Random MPI - */ - function getRandomBN(min: type.mpi.MPI, max: type.mpi.MPI): BN; - - /** - * Buffer for secure random numbers - */ - function RandomBuffer(): void; - } - - namespace signature { - /** - * Verifies the signature provided for data using specified algorithms and public key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} - * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} - * for public key and hash algorithms. - * @param algo Public key algorithm - * @param hash_algo Hash algorithm - * @param msg_MPIs Algorithm-specific signature parameters - * @param pub_MPIs Algorithm-specific public key parameters - * @param data Data for which the signature was created - * @param hashed The hashed data - * @returns True if signature is valid - */ - function verify(algo: enums.publicKey, hash_algo: enums.hash, msg_MPIs: type.mpi.MPI[], pub_MPIs: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): boolean; - - /** - * Creates a signature on data using specified algorithms and private key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} - * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} - * for public key and hash algorithms. - * @param algo Public key algorithm - * @param hash_algo Hash algorithm - * @param key_params Algorithm-specific public and private key parameters - * @param data Data to be signed - * @param hashed The hashed data - * @returns Signature - */ - function sign(algo: enums.publicKey, hash_algo: enums.hash, key_params: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): Uint8Array; - } - } - - namespace eme { - /** - * Create a EME-PKCS1-v1_5 padded message - * @see - * @param M message to be encoded - * @param k the length in octets of the key modulus - * @returns EME-PKCS1 padded message - */ - function encode(M: string, k: Integer): Promise; - - /** - * Decode a EME-PKCS1-v1_5 padded message - * @see - * @param EM encoded message, an octet string - * @returns message, an octet string - */ - function decode(EM: string): string; - } - - namespace emsa { - /** - * Create a EMSA-PKCS1-v1_5 padded message - * @see - * @param algo Hash algorithm type used - * @param hashed message to be encoded - * @param emLen intended length in octets of the encoded message - * @returns encoded message - */ - function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; - } - - namespace encoding { - namespace armor { - /** - * Add additional information to the armor version of an OpenPGP binary - * packet block. - * @author Alex - * @version 2011-12-16 - * @param customComment (optional) additional comment to add to the armored string - * @returns The header information - */ - function addheader(customComment: string): string; - - /** - * Calculates a checksum over the given data and returns it base64 encoded - * @param data Data to create a CRC-24 checksum for - * @returns Base64 encoded checksum - */ - function getCheckSum(data: string | ReadableStream): string | ReadableStream; - - /** - * Internal function to calculate a CRC-24 checksum over a given string (data) - * @param data Data to create a CRC-24 checksum for - * @returns The CRC-24 checksum - */ - function createcrc24(data: string | ReadableStream): Uint8Array | ReadableStream; - - /** - * Splits a message into two parts, the body and the checksum. This is an internal function - * @param text OpenPGP armored message part - * @returns An object with attribute "body" containing the body - * and an attribute "checksum" containing the checksum. - */ - function splitChecksum(text: string): object; - - /** - * DeArmor an OpenPGP armored message; verify the checksum and return - * the encoded bytes - * @param text OpenPGP armored message - * @returns An object with attribute "text" containing the message text, - * an attribute "data" containing a stream of bytes and "type" for the ASCII armor type - */ - function dearmor(text: string): Promise; - - /** - * Armor an OpenPGP binary packet block - * @param messagetype type of the message - * @param body - * @param partindex - * @param parttotal - * @param customComment (optional) additional comment to add to the armored string - * @returns Armored text - */ - function armor(messagetype: Integer, body: any, partindex: Integer, parttotal: Integer, customComment?: string): string | ReadableStream; - } - - namespace base64 { - /** - * Convert binary array to radix-64 - * @param t Uint8Array to convert - * @param u if true, output is URL-safe - * @returns radix-64 version of input string - */ - function s2r(t: Uint8Array | ReadableStream, u?: boolean): string | ReadableStream; - - /** - * Convert radix-64 to binary array - * @param t radix-64 string to convert - * @param u if true, input is interpreted as URL-safe - * @returns binary array version of input string - */ - function r2s(t: string | ReadableStream, u: boolean): Uint8Array | ReadableStream; - } - } - - - - namespace enums { - /** - * Maps curve names under various standards to one - * @see - */ - type curve = "p256" | "p384" | "p251" | "secp256k1" | "ed25519" | "curve25519" | "brainpoolP256r1" | "brainpoolP384r1" | "brainpoolP512r1"; - - /** - * A string to key specifier type - */ - enum s2k { - simple = 0, - salted = 1, - iterated = 3, - gnu = 101, - } - - /** - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.1|RFC4880bis-04, section 9.1} - */ - enum publicKey { - /** - * RSA (Encrypt or Sign) [HAC] - */ - rsa_encrypt_sign = 1, - /** - * RSA (Encrypt only) [HAC] - */ - rsa_encrypt = 2, - /** - * RSA (Sign only) [HAC] - */ - rsa_sign = 3, - /** - * Elgamal (Encrypt only) [ELGAMAL] [HAC] - */ - elgamal = 16, - /** - * DSA (Sign only) [FIPS186] [HAC] - */ - dsa = 17, - /** - * ECDH (Encrypt only) [RFC6637] - */ - ecdh = 18, - /** - * ECDSA (Sign only) [RFC6637] - */ - ecdsa = 19, - /** - * EdDSA (Sign only) - * [ {@link https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-04|Draft RFC}] - */ - eddsa = 22, - /** - * Reserved for AEDH - */ - aedh = 23, - /** - * Reserved for AEDSA - */ - aedsa = 24, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2} - */ - enum symmetric { - plaintext = 0, - /** - * Not implemented! - */ - idea = 1, - "3des" = 2, - tripledes = 2, - cast5 = 3, - blowfish = 4, - aes128 = 7, - aes192 = 8, - aes256 = 9, - twofish = 10, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3} - */ - enum compression { - uncompressed = 0, - /** - * RFC1951 - */ - zip = 1, - /** - * RFC1950 - */ - zlib = 2, - bzip2 = 3, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4} - */ - enum hash { - md5 = 1, - sha1 = 2, - ripemd = 3, - sha256 = 8, - sha384 = 9, - sha512 = 10, - sha224 = 11, - } - - /** - * A list of hash names as accepted by webCrypto functions. - * {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest|Parameters, algo} - */ - enum webHash { - "SHA-1" = 2, - "SHA-256" = 8, - "SHA-384" = 9, - "SHA-512" = 10, - } - - /** - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.6|RFC4880bis-04, section 9.6} - */ - enum aead { - eax = 1, - ocb = 2, - experimental_gcm = 100, - } - - /** - * A list of packet types and numeric tags associated with them. - */ - enum packet { - publicKeyEncryptedSessionKey = 1, - signature = 2, - symEncryptedSessionKey = 3, - onePassSignature = 4, - secretKey = 5, - publicKey = 6, - secretSubkey = 7, - compressed = 8, - symmetricallyEncrypted = 9, - marker = 10, - literal = 11, - trust = 12, - userid = 13, - publicSubkey = 14, - userAttribute = 17, - symEncryptedIntegrityProtected = 18, - modificationDetectionCode = 19, - symEncryptedAEADProtected = 20, - } - - /** - * Data types in the literal packet - */ - enum literal { - /** - * Binary data 'b' - */ - binary = 98, - /** - * Text data 't' - */ - text = 116, - /** - * Utf8 data 'u' - */ - utf8 = 117, - /** - * MIME message body part 'm' - */ - mime = 109, - } - - /** - * One pass signature packet type - */ - enum signature { - /** - * 0x00: Signature of a binary document. - */ - binary = 0, - /** - * 0x01: Signature of a canonical text document. - * Canonicalyzing the document by converting line endings. - */ - text = 1, - /** - * 0x02: Standalone signature. - * This signature is a signature of only its own subpacket contents. - * It is calculated identically to a signature over a zero-lengh - * binary document. Note that it doesn't make sense to have a V3 - * standalone signature. - */ - standalone = 2, - /** - * 0x10: Generic certification of a User ID and Public-Key packet. - * The issuer of this certification does not make any particular - * assertion as to how well the certifier has checked that the owner - * of the key is in fact the person described by the User ID. - */ - cert_generic = 16, - /** - * 0x11: Persona certification of a User ID and Public-Key packet. - * The issuer of this certification has not done any verification of - * the claim that the owner of this key is the User ID specified. - */ - cert_persona = 17, - /** - * 0x12: Casual certification of a User ID and Public-Key packet. - * The issuer of this certification has done some casual - * verification of the claim of identity. - */ - cert_casual = 18, - /** - * 0x13: Positive certification of a User ID and Public-Key packet. - * The issuer of this certification has done substantial - * verification of the claim of identity. - * Most OpenPGP implementations make their "key signatures" as 0x10 - * certifications. Some implementations can issue 0x11-0x13 - * certifications, but few differentiate between the types. - */ - cert_positive = 19, - /** - * 0x30: Certification revocation signature - * This signature revokes an earlier User ID certification signature - * (signature class 0x10 through 0x13) or direct-key signature - * (0x1F). It should be issued by the same key that issued the - * revoked signature or an authorized revocation key. The signature - * is computed over the same data as the certificate that it - * revokes, and should have a later creation date than that - * certificate. - */ - cert_revocation = 48, - /** - * 0x18: Subkey Binding Signature - * This signature is a statement by the top-level signing key that - * indicates that it owns the subkey. This signature is calculated - * directly on the primary key and subkey, and not on any User ID or - * other packets. A signature that binds a signing subkey MUST have - * an Embedded Signature subpacket in this binding signature that - * contains a 0x19 signature made by the signing subkey on the - * primary key and subkey. - */ - subkey_binding = 24, - /** - * 0x19: Primary Key Binding Signature - * This signature is a statement by a signing subkey, indicating - * that it is owned by the primary key and subkey. This signature - * is calculated the same way as a 0x18 signature: directly on the - * primary key and subkey, and not on any User ID or other packets. - * When a signature is made over a key, the hash data starts with the - * octet 0x99, followed by a two-octet length of the key, and then body - * of the key packet. (Note that this is an old-style packet header for - * a key packet with two-octet length.) A subkey binding signature - * (type 0x18) or primary key binding signature (type 0x19) then hashes - * the subkey using the same format as the main key (also using 0x99 as - * the first octet). - */ - key_binding = 25, - /** - * 0x1F: Signature directly on a key - * This signature is calculated directly on a key. It binds the - * information in the Signature subpackets to the key, and is - * appropriate to be used for subpackets that provide information - * about the key, such as the Revocation Key subpacket. It is also - * appropriate for statements that non-self certifiers want to make - * about the key itself, rather than the binding between a key and a - * name. - */ - key = 31, - /** - * 0x20: Key revocation signature - * The signature is calculated directly on the key being revoked. A - * revoked key is not to be used. Only revocation signatures by the - * key being revoked, or by an authorized revocation key, should be - * considered valid revocation signatures.a - */ - key_revocation = 32, - /** - * 0x28: Subkey revocation signature - * The signature is calculated directly on the subkey being revoked. - * A revoked subkey is not to be used. Only revocation signatures - * by the top-level signature key that is bound to this subkey, or - * by an authorized revocation key, should be considered valid - * revocation signatures. - * Key revocation signatures (types 0x20 and 0x28) - * hash only the key being revoked. - */ - subkey_revocation = 40, - /** - * 0x40: Timestamp signature. - * This signature is only meaningful for the timestamp contained in - * it. - */ - timestamp = 64, - /** - * 0x50: Third-Party Confirmation signature. - * This signature is a signature over some other OpenPGP Signature - * packet(s). It is analogous to a notary seal on the signed data. - * A third-party signature SHOULD include Signature Target - * subpacket(s) to give easy identification. Note that we really do - * mean SHOULD. There are plausible uses for this (such as a blind - * party that only sees the signature, not the key or source - * document) that cannot include a target subpacket. - */ - third_party = 80, - } - - /** - * Signature subpacket type - */ - enum signatureSubpacket { - signature_creation_time = 2, - signature_expiration_time = 3, - exportable_certification = 4, - trust_signature = 5, - regular_expression = 6, - revocable = 7, - key_expiration_time = 9, - placeholder_backwards_compatibility = 10, - preferred_symmetric_algorithms = 11, - revocation_key = 12, - issuer = 16, - notation_data = 20, - preferred_hash_algorithms = 21, - preferred_compression_algorithms = 22, - key_server_preferences = 23, - preferred_key_server = 24, - primary_user_id = 25, - policy_uri = 26, - key_flags = 27, - signers_user_id = 28, - reason_for_revocation = 29, - features = 30, - signature_target = 31, - embedded_signature = 32, - issuer_fingerprint = 33, - preferred_aead_algorithms = 34, - } - - /** - * Key flags - */ - enum keyFlags { - /** - * 0x01 - This key may be used to certify other keys. - */ - certify_keys = 1, - /** - * 0x02 - This key may be used to sign data. - */ - sign_data = 2, - /** - * 0x04 - This key may be used to encrypt communications. - */ - encrypt_communication = 4, - /** - * 0x08 - This key may be used to encrypt storage. - */ - encrypt_storage = 8, - /** - * 0x10 - The private component of this key may have been split - * by a secret-sharing mechanism. - */ - split_private_key = 16, - /** - * 0x20 - This key may be used for authentication. - */ - authentication = 32, - /** - * 0x80 - The private component of this key may be in the - * possession of more than one person. - */ - shared_private_key = 128, - } - - /** - * Key status - */ - enum keyStatus { - invalid = 0, - expired = 1, - revoked = 2, - valid = 3, - no_self_cert = 4, - } - - /** - * Armor type - */ - enum armor { - multipart_section = 0, - multipart_last = 1, - signed = 2, - message = 3, - public_key = 4, - private_key = 5, - signature = 6, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.23|RFC4880, section 5.2.3.23} - */ - enum reasonForRevocation { - /** - * No reason specified (key revocations or cert revocations) - */ - no_reason = 0, - /** - * Key is superseded (key revocations) - */ - key_superseded = 1, - /** - * Key material has been comPromised (key revocations) - */ - key_comPromised = 2, - /** - * Key is retired and no longer used (key revocations) - */ - key_retired = 3, - /** - * User ID information is no longer valid (cert revocations) - */ - userid_invalid = 32, - } - - /** - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.2.3.25|RFC4880bis-04, section 5.2.3.25} - */ - enum features { - /** - * 0x01 - Modification Detection (packets 18 and 19) - */ - modification_detection = 1, - /** - * 0x02 - AEAD Encrypted Data Packet (packet 20) and version 5 - * Symmetric-Key Encrypted Session Key Packets (packet 3) - */ - aead = 2, - /** - * 0x04 - Version 5 Public-Key Packet format and corresponding new - * fingerprint format - */ - v5_keys = 4, - } - - /** - * Asserts validity and converts from string/integer to integer. - */ - function write(): void; - - /** - * Converts from an integer to string. - */ - function read(): void; - } - - namespace hkp { - class HKP { - /** - * Initialize the HKP client and configure it with the key server url and fetch function. - * @param keyServerBaseUrl (optional) The HKP key server base url including - * the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to - * openpgp.config.keyserver (https://keyserver.ubuntu.com) - */ - constructor(keyServerBaseUrl: string); - - /** - * Search for a public key on the key server either by key ID or part of the user ID. - * @param options.keyID The long public key ID. - * @param options.query This can be any part of the key user ID such as name - * or email address. - * @returns The ascii armored public key. - */ - lookup(): Promise; - - /** - * Upload a public key to the server. - * @param publicKeyArmored An ascii armored public key to be uploaded. + * Probabilistic primality testing + * @param n Number to test + * @param e Optional RSA exponent to check against the prime + * @param k Optional number of iterations of Miller-Rabin test * @returns */ - upload(publicKeyArmored: string): Promise; + function isProbablePrime(n: BN, e: BN, k: Integer): boolean; + + /** + * Tests whether n is probably prime or not using Fermat's test with b = 2. + * Fails if b^(n-1) mod n === 1. + * @param n Number to test + * @param b Optional Fermat test base + * @returns + */ + function fermat(n: BN, b: Integer): boolean; + + /** + * Tests whether n is probably prime or not using the Miller-Rabin test. + * See HAC Remark 4.28. + * @param n Number to test + * @param k Optional number of iterations of Miller-Rabin test + * @param rand Optional function to generate potential witnesses + * @returns + */ + function millerRabin(n: BN, k: Integer, rand: Function): boolean; + } + + namespace rsa { + /** + * Create signature + * @param m message + * @param n RSA public modulus + * @param e RSA public exponent + * @param d RSA private exponent + * @returns RSA Signature + */ + function sign(m: BN, n: BN, e: BN, d: BN): BN; + + /** + * Verify signature + * @param s signature + * @param n RSA public modulus + * @param e RSA public exponent + * @returns + */ + function verify(s: BN, n: BN, e: BN): BN; + + /** + * Encrypt message + * @param m message + * @param n RSA public modulus + * @param e RSA public exponent + * @returns RSA Ciphertext + */ + function encrypt(m: BN, n: BN, e: BN): BN; + + /** + * Decrypt RSA message + * @param m message + * @param n RSA public modulus + * @param e RSA public exponent + * @param d RSA private exponent + * @param p RSA private prime p + * @param q RSA private prime q + * @param u RSA private inverse of prime q + * @returns RSA Plaintext + */ + function decrypt(m: BN, n: BN, e: BN, d: BN, p: BN, q: BN, u: BN): BN; + + /** + * Generate a new random private key B bits long with public exponent E. + * When possible, webCrypto is used. Otherwise, primes are generated using + * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm. + * @see module:crypto/public_key/prime + * @param B RSA bit length + * @param E RSA public exponent in hex string + * @returns RSA public modulus, RSA public exponent, RSA private exponent, + * RSA private prime p, RSA private prime q, u = q ** -1 mod p + */ + function generate(B: Integer, E: string): object; } } + namespace random { + /** + * Retrieve secure random byte array of the specified length + * @param length Length in bytes to generate + * @returns Random byte array + */ + function getRandomBytes(length: Integer): Uint8Array; + + /** + * Create a secure random MPI that is greater than or equal to min and less than max. + * @param min Lower bound, included + * @param max Upper bound, excluded + * @returns Random MPI + */ + function getRandomBN(min: type.mpi.MPI, max: type.mpi.MPI): BN; + + /** + * Buffer for secure random numbers + */ + function RandomBuffer(): void; + } + + namespace signature { + /** + * Verifies the signature provided for data using specified algorithms and public key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} + * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} + * for public key and hash algorithms. + * @param algo Public key algorithm + * @param hash_algo Hash algorithm + * @param msg_MPIs Algorithm-specific signature parameters + * @param pub_MPIs Algorithm-specific public key parameters + * @param data Data for which the signature was created + * @param hashed The hashed data + * @returns True if signature is valid + */ + function verify(algo: enums.publicKey, hash_algo: enums.hash, msg_MPIs: type.mpi.MPI[], pub_MPIs: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): boolean; + + /** + * Creates a signature on data using specified algorithms and private key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} + * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} + * for public key and hash algorithms. + * @param algo Public key algorithm + * @param hash_algo Hash algorithm + * @param key_params Algorithm-specific public and private key parameters + * @param data Data to be signed + * @param hashed The hashed data + * @returns Signature + */ + function sign(algo: enums.publicKey, hash_algo: enums.hash, key_params: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): Uint8Array; + } +} + +export namespace eme { + /** + * Create a EME-PKCS1-v1_5 padded message + * @see + * @param M message to be encoded + * @param k the length in octets of the key modulus + * @returns EME-PKCS1 padded message + */ + function encode(M: string, k: Integer): Promise; + + /** + * Decode a EME-PKCS1-v1_5 padded message + * @see + * @param EM encoded message, an octet string + * @returns message, an octet string + */ + function decode(EM: string): string; +} + +export namespace emsa { + /** + * Create a EMSA-PKCS1-v1_5 padded message + * @see + * @param algo Hash algorithm type used + * @param hashed message to be encoded + * @param emLen intended length in octets of the encoded message + * @returns encoded message + */ + function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; +} + +export namespace encoding { + namespace armor { + /** + * Add additional information to the armor version of an OpenPGP binary + * packet block. + * @author Alex + * @version 2011-12-16 + * @param customComment (optional) additional comment to add to the armored string + * @returns The header information + */ + function addheader(customComment: string): string; + + /** + * Calculates a checksum over the given data and returns it base64 encoded + * @param data Data to create a CRC-24 checksum for + * @returns Base64 encoded checksum + */ + function getCheckSum(data: string | ReadableStream): string | ReadableStream; + + /** + * Internal function to calculate a CRC-24 checksum over a given string (data) + * @param data Data to create a CRC-24 checksum for + * @returns The CRC-24 checksum + */ + function createcrc24(data: string | ReadableStream): Uint8Array | ReadableStream; + + /** + * Splits a message into two parts, the body and the checksum. This is an internal function + * @param text OpenPGP armored message part + * @returns An object with attribute "body" containing the body + * and an attribute "checksum" containing the checksum. + */ + function splitChecksum(text: string): object; + + /** + * DeArmor an OpenPGP armored message; verify the checksum and return + * the encoded bytes + * @param text OpenPGP armored message + * @returns An object with attribute "text" containing the message text, + * an attribute "data" containing a stream of bytes and "type" for the ASCII armor type + */ + function dearmor(text: string): Promise; + + /** + * Armor an OpenPGP binary packet block + * @param messagetype type of the message + * @param body + * @param partindex + * @param parttotal + * @param customComment (optional) additional comment to add to the armored string + * @returns Armored text + */ + function armor(messagetype: Integer, body: any, partindex: Integer, parttotal: Integer, customComment?: string): string | ReadableStream; + } + + namespace base64 { + /** + * Convert binary array to radix-64 + * @param t Uint8Array to convert + * @param u if true, output is URL-safe + * @returns radix-64 version of input string + */ + function s2r(t: Uint8Array | ReadableStream, u?: boolean): string | ReadableStream; + + /** + * Convert radix-64 to binary array + * @param t radix-64 string to convert + * @param u if true, input is interpreted as URL-safe + * @returns binary array version of input string + */ + function r2s(t: string | ReadableStream, u: boolean): Uint8Array | ReadableStream; + } +} + + + +export namespace enums { + /** + * Maps curve names under various standards to one + * @see + */ + type curve = "p256" | "p384" | "p251" | "secp256k1" | "ed25519" | "curve25519" | "brainpoolP256r1" | "brainpoolP384r1" | "brainpoolP512r1"; + + /** + * A string to key specifier type + */ + enum s2k { + simple = 0, + salted = 1, + iterated = 3, + gnu = 101, + } + + /** + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.1|RFC4880bis-04, section 9.1} + */ + enum publicKey { + /** + * RSA (Encrypt or Sign) [HAC] + */ + rsa_encrypt_sign = 1, + /** + * RSA (Encrypt only) [HAC] + */ + rsa_encrypt = 2, + /** + * RSA (Sign only) [HAC] + */ + rsa_sign = 3, + /** + * Elgamal (Encrypt only) [ELGAMAL] [HAC] + */ + elgamal = 16, + /** + * DSA (Sign only) [FIPS186] [HAC] + */ + dsa = 17, + /** + * ECDH (Encrypt only) [RFC6637] + */ + ecdh = 18, + /** + * ECDSA (Sign only) [RFC6637] + */ + ecdsa = 19, + /** + * EdDSA (Sign only) + * [ {@link https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-04|Draft RFC}] + */ + eddsa = 22, + /** + * Reserved for AEDH + */ + aedh = 23, + /** + * Reserved for AEDSA + */ + aedsa = 24, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2} + */ + enum symmetric { + plaintext = 0, + /** + * Not implemented! + */ + idea = 1, + "3des" = 2, + tripledes = 2, + cast5 = 3, + blowfish = 4, + aes128 = 7, + aes192 = 8, + aes256 = 9, + twofish = 10, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3} + */ + enum compression { + uncompressed = 0, + /** + * RFC1951 + */ + zip = 1, + /** + * RFC1950 + */ + zlib = 2, + bzip2 = 3, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4} + */ + enum hash { + md5 = 1, + sha1 = 2, + ripemd = 3, + sha256 = 8, + sha384 = 9, + sha512 = 10, + sha224 = 11, + } + + /** + * A list of hash names as accepted by webCrypto functions. + * {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest|Parameters, algo} + */ + enum webHash { + "SHA-1" = 2, + "SHA-256" = 8, + "SHA-384" = 9, + "SHA-512" = 10, + } + + /** + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.6|RFC4880bis-04, section 9.6} + */ + enum aead { + eax = 1, + ocb = 2, + experimental_gcm = 100, + } + + /** + * A list of packet types and numeric tags associated with them. + */ + enum packet { + publicKeyEncryptedSessionKey = 1, + signature = 2, + symEncryptedSessionKey = 3, + onePassSignature = 4, + secretKey = 5, + publicKey = 6, + secretSubkey = 7, + compressed = 8, + symmetricallyEncrypted = 9, + marker = 10, + literal = 11, + trust = 12, + userid = 13, + publicSubkey = 14, + userAttribute = 17, + symEncryptedIntegrityProtected = 18, + modificationDetectionCode = 19, + symEncryptedAEADProtected = 20, + } + + /** + * Data types in the literal packet + */ + enum literal { + /** + * Binary data 'b' + */ + binary = 98, + /** + * Text data 't' + */ + text = 116, + /** + * Utf8 data 'u' + */ + utf8 = 117, + /** + * MIME message body part 'm' + */ + mime = 109, + } + + /** + * One pass signature packet type + */ + enum signature { + /** + * 0x00: Signature of a binary document. + */ + binary = 0, + /** + * 0x01: Signature of a canonical text document. + * Canonicalyzing the document by converting line endings. + */ + text = 1, + /** + * 0x02: Standalone signature. + * This signature is a signature of only its own subpacket contents. + * It is calculated identically to a signature over a zero-lengh + * binary document. Note that it doesn't make sense to have a V3 + * standalone signature. + */ + standalone = 2, + /** + * 0x10: Generic certification of a User ID and Public-Key packet. + * The issuer of this certification does not make any particular + * assertion as to how well the certifier has checked that the owner + * of the key is in fact the person described by the User ID. + */ + cert_generic = 16, + /** + * 0x11: Persona certification of a User ID and Public-Key packet. + * The issuer of this certification has not done any verification of + * the claim that the owner of this key is the User ID specified. + */ + cert_persona = 17, + /** + * 0x12: Casual certification of a User ID and Public-Key packet. + * The issuer of this certification has done some casual + * verification of the claim of identity. + */ + cert_casual = 18, + /** + * 0x13: Positive certification of a User ID and Public-Key packet. + * The issuer of this certification has done substantial + * verification of the claim of identity. + * Most OpenPGP implementations make their "key signatures" as 0x10 + * certifications. Some implementations can issue 0x11-0x13 + * certifications, but few differentiate between the types. + */ + cert_positive = 19, + /** + * 0x30: Certification revocation signature + * This signature revokes an earlier User ID certification signature + * (signature class 0x10 through 0x13) or direct-key signature + * (0x1F). It should be issued by the same key that issued the + * revoked signature or an authorized revocation key. The signature + * is computed over the same data as the certificate that it + * revokes, and should have a later creation date than that + * certificate. + */ + cert_revocation = 48, + /** + * 0x18: Subkey Binding Signature + * This signature is a statement by the top-level signing key that + * indicates that it owns the subkey. This signature is calculated + * directly on the primary key and subkey, and not on any User ID or + * other packets. A signature that binds a signing subkey MUST have + * an Embedded Signature subpacket in this binding signature that + * contains a 0x19 signature made by the signing subkey on the + * primary key and subkey. + */ + subkey_binding = 24, + /** + * 0x19: Primary Key Binding Signature + * This signature is a statement by a signing subkey, indicating + * that it is owned by the primary key and subkey. This signature + * is calculated the same way as a 0x18 signature: directly on the + * primary key and subkey, and not on any User ID or other packets. + * When a signature is made over a key, the hash data starts with the + * octet 0x99, followed by a two-octet length of the key, and then body + * of the key packet. (Note that this is an old-style packet header for + * a key packet with two-octet length.) A subkey binding signature + * (type 0x18) or primary key binding signature (type 0x19) then hashes + * the subkey using the same format as the main key (also using 0x99 as + * the first octet). + */ + key_binding = 25, + /** + * 0x1F: Signature directly on a key + * This signature is calculated directly on a key. It binds the + * information in the Signature subpackets to the key, and is + * appropriate to be used for subpackets that provide information + * about the key, such as the Revocation Key subpacket. It is also + * appropriate for statements that non-self certifiers want to make + * about the key itself, rather than the binding between a key and a + * name. + */ + key = 31, + /** + * 0x20: Key revocation signature + * The signature is calculated directly on the key being revoked. A + * revoked key is not to be used. Only revocation signatures by the + * key being revoked, or by an authorized revocation key, should be + * considered valid revocation signatures.a + */ + key_revocation = 32, + /** + * 0x28: Subkey revocation signature + * The signature is calculated directly on the subkey being revoked. + * A revoked subkey is not to be used. Only revocation signatures + * by the top-level signature key that is bound to this subkey, or + * by an authorized revocation key, should be considered valid + * revocation signatures. + * Key revocation signatures (types 0x20 and 0x28) + * hash only the key being revoked. + */ + subkey_revocation = 40, + /** + * 0x40: Timestamp signature. + * This signature is only meaningful for the timestamp contained in + * it. + */ + timestamp = 64, + /** + * 0x50: Third-Party Confirmation signature. + * This signature is a signature over some other OpenPGP Signature + * packet(s). It is analogous to a notary seal on the signed data. + * A third-party signature SHOULD include Signature Target + * subpacket(s) to give easy identification. Note that we really do + * mean SHOULD. There are plausible uses for this (such as a blind + * party that only sees the signature, not the key or source + * document) that cannot include a target subpacket. + */ + third_party = 80, + } + + /** + * Signature subpacket type + */ + enum signatureSubpacket { + signature_creation_time = 2, + signature_expiration_time = 3, + exportable_certification = 4, + trust_signature = 5, + regular_expression = 6, + revocable = 7, + key_expiration_time = 9, + placeholder_backwards_compatibility = 10, + preferred_symmetric_algorithms = 11, + revocation_key = 12, + issuer = 16, + notation_data = 20, + preferred_hash_algorithms = 21, + preferred_compression_algorithms = 22, + key_server_preferences = 23, + preferred_key_server = 24, + primary_user_id = 25, + policy_uri = 26, + key_flags = 27, + signers_user_id = 28, + reason_for_revocation = 29, + features = 30, + signature_target = 31, + embedded_signature = 32, + issuer_fingerprint = 33, + preferred_aead_algorithms = 34, + } + + /** + * Key flags + */ + enum keyFlags { + /** + * 0x01 - This key may be used to certify other keys. + */ + certify_keys = 1, + /** + * 0x02 - This key may be used to sign data. + */ + sign_data = 2, + /** + * 0x04 - This key may be used to encrypt communications. + */ + encrypt_communication = 4, + /** + * 0x08 - This key may be used to encrypt storage. + */ + encrypt_storage = 8, + /** + * 0x10 - The private component of this key may have been split + * by a secret-sharing mechanism. + */ + split_private_key = 16, + /** + * 0x20 - This key may be used for authentication. + */ + authentication = 32, + /** + * 0x80 - The private component of this key may be in the + * possession of more than one person. + */ + shared_private_key = 128, + } + + /** + * Key status + */ + enum keyStatus { + invalid = 0, + expired = 1, + revoked = 2, + valid = 3, + no_self_cert = 4, + } + + /** + * Armor type + */ + enum armor { + multipart_section = 0, + multipart_last = 1, + signed = 2, + message = 3, + public_key = 4, + private_key = 5, + signature = 6, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.23|RFC4880, section 5.2.3.23} + */ + enum reasonForRevocation { + /** + * No reason specified (key revocations or cert revocations) + */ + no_reason = 0, + /** + * Key is superseded (key revocations) + */ + key_superseded = 1, + /** + * Key material has been comPromised (key revocations) + */ + key_comPromised = 2, + /** + * Key is retired and no longer used (key revocations) + */ + key_retired = 3, + /** + * User ID information is no longer valid (cert revocations) + */ + userid_invalid = 32, + } + + /** + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.2.3.25|RFC4880bis-04, section 5.2.3.25} + */ + enum features { + /** + * 0x01 - Modification Detection (packets 18 and 19) + */ + modification_detection = 1, + /** + * 0x02 - AEAD Encrypted Data Packet (packet 20) and version 5 + * Symmetric-Key Encrypted Session Key Packets (packet 3) + */ + aead = 2, + /** + * 0x04 - Version 5 Public-Key Packet format and corresponding new + * fingerprint format + */ + v5_keys = 4, + } + + /** + * Asserts validity and converts from string/integer to integer. + */ + function write(): void; + + /** + * Converts from an integer to string. + */ + function read(): void; +} + +export namespace hkp { class HKP { /** * Initialize the HKP client and configure it with the key server url and fetch function. @@ -1552,557 +1526,301 @@ export namespace openpgp { */ upload(publicKeyArmored: string): Promise; } +} - namespace key { +export class HKP { + /** + * Initialize the HKP client and configure it with the key server url and fetch function. + * @param keyServerBaseUrl (optional) The HKP key server base url including + * the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to + * openpgp.config.keyserver (https://keyserver.ubuntu.com) + */ + constructor(keyServerBaseUrl: string); + + /** + * Search for a public key on the key server either by key ID or part of the user ID. + * @param options.keyID The long public key ID. + * @param options.query This can be any part of the key user ID such as name + * or email address. + * @returns The ascii armored public key. + */ + lookup(): Promise; + + /** + * Upload a public key to the server. + * @param publicKeyArmored An ascii armored public key to be uploaded. + * @returns + */ + upload(publicKeyArmored: string): Promise; +} + +export namespace key { + /** + * Class that represents an OpenPGP key. Must contain a primary key. + * Can contain additional subkeys, signatures, user ids, user attributes. + */ + class Key { /** - * Class that represents an OpenPGP key. Must contain a primary key. - * Can contain additional subkeys, signatures, user ids, user attributes. + * @param packetlist The packets that form this key */ - class Key { - /** - * @param packetlist The packets that form this key - */ - constructor(packetlist: packet.List); - - /** - * Transforms packetlist to structured key data - * @param packetlist The packets that form a key - */ - packetlist2structure(packetlist: packet.List): void; - - /** - * Transforms structured key data to packetlist - * @returns The packets that form a key - */ - toPacketlist(): packet.List; - - /** - * Returns an array containing all public or private subkeys matching keyId; - * If keyId is not present, returns all subkeys. - * @param keyId - * @returns - */ - getSubkeys(keyId: type.keyid.Keyid): any[]; - - /** - * Returns an array containing all public or private keys matching keyId. - * If keyId is not present, returns all keys starting with the primary key. - * @param keyId - * @returns - */ - getKeys(keyId: type.keyid.Keyid): any[]; - - /** - * Returns key IDs of all keys - * @returns - */ - getKeyIds(): any[]; - - /** - * Returns userids - * @returns array of userids - */ - getUserIds(): any[]; - - /** - * Returns true if this is a public key - * @returns - */ - isPublic(): boolean; - - /** - * Returns true if this is a private key - * @returns - */ - isPrivate(): boolean; - - /** - * Returns key as public key (shallow copy) - * @returns new public Key - */ - toPublic(): Key; - - /** - * Returns ASCII armored text of key - * @returns ASCII armor - */ - armor(): ReadableStream; - - /** - * Returns last created key or key by given keyId that is available for signing and verification - * @param keyId, optional - * @param date (optional) use the given date for verification instead of the current time - * @param userId, optional user ID - * @returns key or null if no signing key has been found - */ - getSigningKey(keyId: type.keyid.Keyid, date?: Date, userId?: object): Promise; - - /** - * Returns last created key or key by given keyId that is available for encryption or decryption - * @param keyId, optional - * @param date, optional - * @param userId, optional - * @returns key or null if no encryption key has been found - */ - getEncryptionKey(keyId?: type.keyid.Keyid, date?: Date, userId?: string): Promise; - - /** - * Encrypts all secret key and subkey packets matching keyId - * @param passphrases - if multiple passphrases, then should be in same order as packets each should encrypt - * @param keyId - * @returns - */ - encrypt(passphrases: string | any[], keyId?: type.keyid.Keyid): Promise>; - - /** - * Decrypts all secret key and subkey packets matching keyId - * @param passphrases - * @param keyId - * @returns true if all matching key and subkey packets decrypted successfully - */ - decrypt(passphrases: string | string[], keyId?: type.keyid.Keyid): Promise; - - /** - * Checks if a signature on a key is revoked - * @param - * @param signature The signature to verify - * @param key, optional The key to verify the signature - * @param date Use the given date instead of the current time - * @returns True if the certificate is revoked - */ - isRevoked(signature: packet.Signature, key?: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date?: Date): Promise; - - /** - * Verify primary key. Checks for revocation signatures, expiration time - * and valid self signature - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID - * @returns The status of the primary key - */ - verifyPrimaryKey(date?: Date, userId?: object): Promise; - - /** - * Returns the latest date when the key can be used for encrypting, signing, or both, depending on the `capabilities` paramater. - * When `capabilities` is null, defaults to returning the expiry date of the primary key. - * Returns null if `capabilities` is passed and the key does not have the specified capabilities or is revoked or invalid. - * Returns Infinity if the key doesn't expire. - * @param {encrypt | sign | encrypt_sign} capabilities, optional - * @param keyId, optional - * @param userId, optional user ID - * @returns - */ - getExpirationTime(capabilities: any, keyId: type.keyid.Keyid, userId: object): Promise; - - /** - * Returns primary user and most significant (latest valid) self signature - * - if multiple primary users exist, returns the one with the latest self signature - * - otherwise, returns the user with the latest self signature - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID to get instead of the primary user, if it exists - * @returns The primary user and the self signature - */ - getPrimaryUser(date: Date, userId: object): Promise<{ user: User, selfCertification: packet.Signature }>; - - /** - * Update key with new components from specified key with same key ID: - * users, subkeys, certificates are merged into the destination key, - * duplicates and expired signatures are ignored. - * If the specified key is a private key and the destination key is public, - * the destination key is transformed to a private key. - * @param key Source key to merge - * @returns - */ - update(key: Key): Promise; - - /** - * Revokes the key - * @param reasonForRevocation optional, object indicating the reason for revocation - * @param reasonForRevocation.flag optional, flag indicating the reason for revocation - * @param reasonForRevocation.string optional, string explaining the reason for revocation - * @param date optional, override the creationtime of the revocation signature - * @returns new key with revocation signature - */ - revoke(reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; - - /** - * Get revocation certificate from a revoked key. - * (To get a revocation certificate for an unrevoked key, call revoke() first.) - * @returns armored revocation certificate - */ - getRevocationCertificate(): Promise; - - /** - * Applies a revocation certificate to a key - * This adds the first signature packet in the armored text to the key, - * if it is a valid revocation signature. - * @param revocationCertificate armored revocation certificate - * @returns new revoked key - */ - applyRevocationCertificate(revocationCertificate: string): Promise; - - /** - * Signs primary user of key - * @param privateKey decrypted private keys for signing - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID to get instead of the primary user, if it exists - * @returns new public key with new certificate signature - */ - signPrimaryUser(privateKey: any[], date: Date, userId: object): Promise; - - /** - * Signs all users of key - * @param privateKeys decrypted private keys for signing - * @returns new public key with new certificate signature - */ - signAllUsers(privateKeys: any[]): Promise; - - /** - * Verifies primary user of key - * - if no arguments are given, verifies the self certificates; - * - otherwise, verifies all certificates signed with given keys. - * @param keys array of keys to verify certificate signatures - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID to get instead of the primary user, if it exists - * @returns List of signer's keyid and validity of signature - */ - verifyPrimaryUser(keys: any[], date: Date, userId: object): Promise>; - - /** - * Verifies all users of key - * - if no arguments are given, verifies the self certificates; - * - otherwise, verifies all certificates signed with given keys. - * @param keys array of keys to verify certificate signatures - * @returns list of userid, signer's keyid and validity of signature - */ - verifyAllUsers(keys: any[]): Promise>; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - } + constructor(packetlist: packet.List); /** - * Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future. - * @param signatures List of signatures - * @param date Use the given date instead of the current time - * @returns The latest valid signature + * Transforms packetlist to structured key data + * @param packetlist The packets that form a key */ - function getLatestValidSignature(signatures: any[], date: Date): Promise; + packetlist2structure(packetlist: packet.List): void; /** - * Class that represents an user ID or attribute packet and the relevant signatures. + * Transforms structured key data to packetlist + * @returns The packets that form a key */ - class User { - constructor(); - - /** - * Transforms structured user data to packetlist - * @returns - */ - toPacketlist(): packet.List; - - /** - * Signs user - * @param primaryKey The primary key packet - * @param privateKeys Decrypted private keys for signing - * @returns New user with new certificate signatures - */ - sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; - - /** - * Checks if a given certificate of the user is revoked - * @param primaryKey The primary key packet - * @param certificate The certificate to verify - * @param key, optional The key to verify the signature - * @param date Use the given date instead of the current time - * @returns True if the certificate is revoked - */ - isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; - - /** - * Verifies the user certificate - * @param primaryKey The primary key packet - * @param certificate A certificate of this user - * @param keys Array of keys to verify certificate signatures - * @param date Use the given date instead of the current time - * @returns status of the certificate - */ - verifyCertificate(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, keys: any[], date: Date): Promise; - - /** - * Verifies all user certificates - * @param primaryKey The primary key packet - * @param keys Array of keys to verify certificate signatures - * @param date Use the given date instead of the current time - * @returns List of signer's keyid and validity of signature - */ - verifyAllCertifications(primaryKey: packet.SecretKey | packet.PublicKey, keys: any[], date: Date): Promise>; - - /** - * Verify User. Checks for existence of self signatures, revocation signatures - * and validity of self signature - * @param primaryKey The primary key packet - * @param date Use the given date instead of the current time - * @returns Status of user - */ - verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; - - /** - * Update user with new components from specified user - * @param user Source user to merge - * @param primaryKey primary key used for validation - * @returns - */ - update(user: User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; - } + toPacketlist(): packet.List; /** - * Create signature packet - * @param dataToSign Contains packets to be signed - * @param signingKeyPacket secret key packet for signing - * @param signatureProperties (optional) properties to write on the signature packet before signing - * @param date (optional) override the creationtime of the signature - * @param userId (optional) user ID - * @returns signature packet - */ - function createSignaturePacket(dataToSign: object, signingKeyPacket: packet.SecretKey | packet.SecretSubkey, signatureProperties: object, date: Date, userId: object): packet.Signature; - - /** - * Class that represents a subkey packet and the relevant signatures. - */ - class SubKey { - constructor(); - - /** - * Transforms structured subkey data to packetlist - * @returns - */ - toPacketlist(): packet.List; - - /** - * Checks if a binding signature of a subkey is revoked - * @param primaryKey The primary key packet - * @param signature The binding signature to verify - * @param key, optional The key to verify the signature - * @param date Use the given date instead of the current time - * @returns True if the binding signature is revoked - */ - isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; - - /** - * Verify subkey. Checks for revocation signatures, expiration time - * and valid binding signature - * @param primaryKey The primary key packet - * @param date Use the given date instead of the current time - * @returns The status of the subkey - */ - verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; - - /** - * Returns the expiration time of the subkey or Infinity if key does not expire - * Returns null if the subkey is invalid. - * @param primaryKey The primary key packet - * @param date Use the given date instead of the current time - * @returns - */ - getExpirationTime(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; - - /** - * Update subkey with new components from specified subkey - * @param subKey Source subkey to merge - * @param primaryKey primary key used for validation - * @returns - */ - update(subKey: SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; - - /** - * Revokes the subkey - * @param primaryKey decrypted private primary key for revocation - * @param reasonForRevocation optional, object indicating the reason for revocation - * @param reasonForRevocation.flag optional, flag indicating the reason for revocation - * @param reasonForRevocation.string optional, string explaining the reason for revocation - * @param date optional, override the creationtime of the revocation signature - * @returns new subkey with revocation signature - */ - revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - } - - /** - * Reads an unarmored OpenPGP key list and returns one or multiple key objects - * @param data to be parsed - * @returns result object with key and error arrays - */ - function read(data: Uint8Array): Promise<{ keys: Array, err: Array | null }>; - - interface KeyResult { keys: Array, err: Array | null } - - /** - * Reads an OpenPGP armored text and returns one or multiple key objects - * @param armoredText text to be parsed - * @returns result object with key and error arrays - */ - function readArmored(armoredText: string | ReadableStream): Promise; - - /** - * Generates a new OpenPGP key. Supports RSA and ECC keys. - * Primary and subkey will be of same type. - * @param options.keyType To indicate what type of key to make. - * RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1} - * @param options.numBits number of bits for the key creation. - * @param options.userIds Assumes already in form of "User Name " - * If array is used, the first userId is set as primary user Id - * @param options.passphrase The passphrase used to encrypt the resulting private key - * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires - * @param curve (optional) elliptic curve for ECC keys - * @param date Override the creation date of the key and the key signatures - * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] - * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt + * Returns an array containing all public or private subkeys matching keyId; + * If keyId is not present, returns all subkeys. + * @param keyId * @returns */ - function generate(options: KeyOptions): Promise; + getSubkeys(keyId: type.keyid.Keyid): any[]; /** - * Reformats and signs an OpenPGP key with a given User ID. Currently only supports RSA keys. - * @param options.privateKey The private key to reformat - * @param options.keyType - * @param options.userIds Assumes already in form of "User Name " - * If array is used, the first userId is set as primary user Id - * @param options.passphrase The passphrase used to encrypt the resulting private key - * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires - * @param date Override the creation date of the key and the key signatures - * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * Returns an array containing all public or private keys matching keyId. + * If keyId is not present, returns all keys starting with the primary key. + * @param keyId * @returns */ - function reformat(date: Date, subkeys: any[]): Promise; + getKeys(keyId: type.keyid.Keyid): any[]; /** - * Checks if a given certificate or binding signature is revoked - * @param primaryKey The primary key packet - * @param dataToVerify The data to check - * @param revocations The revocation signatures to check - * @param signature The certificate or signature to check - * @param key, optional The key packet to check the signature + * Returns key IDs of all keys + * @returns + */ + getKeyIds(): any[]; + + /** + * Returns userids + * @returns array of userids + */ + getUserIds(): any[]; + + /** + * Returns true if this is a public key + * @returns + */ + isPublic(): boolean; + + /** + * Returns true if this is a private key + * @returns + */ + isPrivate(): boolean; + + /** + * Returns key as public key (shallow copy) + * @returns new public Key + */ + toPublic(): Key; + + /** + * Returns ASCII armored text of key + * @returns ASCII armor + */ + armor(): ReadableStream; + + /** + * Returns last created key or key by given keyId that is available for signing and verification + * @param keyId, optional + * @param date (optional) use the given date for verification instead of the current time + * @param userId, optional user ID + * @returns key or null if no signing key has been found + */ + getSigningKey(keyId: type.keyid.Keyid, date?: Date, userId?: object): Promise; + + /** + * Returns last created key or key by given keyId that is available for encryption or decryption + * @param keyId, optional + * @param date, optional + * @param userId, optional + * @returns key or null if no encryption key has been found + */ + getEncryptionKey(keyId?: type.keyid.Keyid, date?: Date, userId?: string): Promise; + + /** + * Encrypts all secret key and subkey packets matching keyId + * @param passphrases - if multiple passphrases, then should be in same order as packets each should encrypt + * @param keyId + * @returns + */ + encrypt(passphrases: string | any[], keyId?: type.keyid.Keyid): Promise>; + + /** + * Decrypts all secret key and subkey packets matching keyId + * @param passphrases + * @param keyId + * @returns true if all matching key and subkey packets decrypted successfully + */ + decrypt(passphrases: string | string[], keyId?: type.keyid.Keyid): Promise; + + /** + * Checks if a signature on a key is revoked + * @param + * @param signature The signature to verify + * @param key, optional The key to verify the signature * @param date Use the given date instead of the current time - * @returns True if the signature revokes the data + * @returns True if the certificate is revoked */ - function isDataRevoked(primaryKey: packet.SecretKey | packet.PublicKey, dataToVerify: object, revocations: any[], signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + isRevoked(signature: packet.Signature, key?: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date?: Date): Promise; /** - * Check if signature has revocation key sub packet (not supported by OpenPGP.js) - * and throw error if found - * @param signature The certificate or signature to check - * @param keyId Check only certificates or signatures from a certain issuer key ID - */ - function checkRevocationKey(signature: packet.Signature, keyId: type.keyid.Keyid): void; - - /** - * Returns the preferred signature hash algorithm of a key - * @param key (optional) the key to get preferences from - * @param keyPacket key packet used for signing + * Verify primary key. Checks for revocation signatures, expiration time + * and valid self signature * @param date (optional) use the given date for verification instead of the current time * @param userId (optional) user ID + * @returns The status of the primary key + */ + verifyPrimaryKey(date?: Date, userId?: object): Promise; + + /** + * Returns the latest date when the key can be used for encrypting, signing, or both, depending on the `capabilities` paramater. + * When `capabilities` is null, defaults to returning the expiry date of the primary key. + * Returns null if `capabilities` is passed and the key does not have the specified capabilities or is revoked or invalid. + * Returns Infinity if the key doesn't expire. + * @param {encrypt | sign | encrypt_sign} capabilities, optional + * @param keyId, optional + * @param userId, optional user ID * @returns */ - function getPreferredHashAlgo(key: Key, keyPacket: packet.SecretKey | packet.SecretSubkey, date: Date, userId: object): Promise; + getExpirationTime(capabilities: any, keyId: type.keyid.Keyid, userId: object): Promise; /** - * Returns the preferred symmetric/aead algorithm for a set of keys - * @param {symmetric | aead} type Type of preference to return - * @param keys Set of keys + * Returns primary user and most significant (latest valid) self signature + * - if multiple primary users exist, returns the one with the latest self signature + * - otherwise, returns the user with the latest self signature * @param date (optional) use the given date for verification instead of the current time - * @param userIds (optional) user IDs - * @returns Preferred symmetric algorithm + * @param userId (optional) user ID to get instead of the primary user, if it exists + * @returns The primary user and the self signature */ - function getPreferredAlgo(type: any, keys: any[], date: Date, userIds: any[]): Promise; + getPrimaryUser(date: Date, userId: object): Promise<{ user: User, selfCertification: packet.Signature }>; /** - * Returns whether aead is supported by all keys in the set - * @param keys Set of keys - * @param date (optional) use the given date for verification instead of the current time - * @param userIds (optional) user IDs + * Update key with new components from specified key with same key ID: + * users, subkeys, certificates are merged into the destination key, + * duplicates and expired signatures are ignored. + * If the specified key is a private key and the destination key is public, + * the destination key is transformed to a private key. + * @param key Source key to merge * @returns */ - function isAeadSupported(keys: any[], date: Date, userIds: any[]): Promise; + update(key: Key): Promise; + + /** + * Revokes the key + * @param reasonForRevocation optional, object indicating the reason for revocation + * @param reasonForRevocation.flag optional, flag indicating the reason for revocation + * @param reasonForRevocation.string optional, string explaining the reason for revocation + * @param date optional, override the creationtime of the revocation signature + * @returns new key with revocation signature + */ + revoke(reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; + + /** + * Get revocation certificate from a revoked key. + * (To get a revocation certificate for an unrevoked key, call revoke() first.) + * @returns armored revocation certificate + */ + getRevocationCertificate(): Promise; + + /** + * Applies a revocation certificate to a key + * This adds the first signature packet in the armored text to the key, + * if it is a valid revocation signature. + * @param revocationCertificate armored revocation certificate + * @returns new revoked key + */ + applyRevocationCertificate(revocationCertificate: string): Promise; + + /** + * Signs primary user of key + * @param privateKey decrypted private keys for signing + * @param date (optional) use the given date for verification instead of the current time + * @param userId (optional) user ID to get instead of the primary user, if it exists + * @returns new public key with new certificate signature + */ + signPrimaryUser(privateKey: any[], date: Date, userId: object): Promise; + + /** + * Signs all users of key + * @param privateKeys decrypted private keys for signing + * @returns new public key with new certificate signature + */ + signAllUsers(privateKeys: any[]): Promise; + + /** + * Verifies primary user of key + * - if no arguments are given, verifies the self certificates; + * - otherwise, verifies all certificates signed with given keys. + * @param keys array of keys to verify certificate signatures + * @param date (optional) use the given date for verification instead of the current time + * @param userId (optional) user ID to get instead of the primary user, if it exists + * @returns List of signer's keyid and validity of signature + */ + verifyPrimaryUser(keys: any[], date: Date, userId: object): Promise>; + + /** + * Verifies all users of key + * - if no arguments are given, verifies the self certificates; + * - otherwise, verifies all certificates signed with given keys. + * @param keys array of keys to verify certificate signatures + * @returns list of userid, signer's keyid and validity of signature + */ + verifyAllUsers(keys: any[]): Promise>; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; } - interface revoke_reasonForRevocation { - /** - * optional, flag indicating the reason for revocation - */ - flag: enums.reasonForRevocation; - /** - * optional, string explaining the reason for revocation - */ - string: string; - } + /** + * Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future. + * @param signatures List of signatures + * @param date Use the given date instead of the current time + * @returns The latest valid signature + */ + function getLatestValidSignature(signatures: any[], date: Date): Promise; /** * Class that represents an user ID or attribute packet and the relevant signatures. @@ -2122,7 +1840,7 @@ export namespace openpgp { * @param privateKeys Decrypted private keys for signing * @returns New user with new certificate signatures */ - sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; + sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; /** * Checks if a given certificate of the user is revoked @@ -2168,9 +1886,20 @@ export namespace openpgp { * @param primaryKey primary key used for validation * @returns */ - update(user: key.User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; + update(user: User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; } + /** + * Create signature packet + * @param dataToSign Contains packets to be signed + * @param signingKeyPacket secret key packet for signing + * @param signatureProperties (optional) properties to write on the signature packet before signing + * @param date (optional) override the creationtime of the signature + * @param userId (optional) user ID + * @returns signature packet + */ + function createSignaturePacket(dataToSign: object, signingKeyPacket: packet.SecretKey | packet.SecretSubkey, signatureProperties: object, date: Date, userId: object): packet.Signature; + /** * Class that represents a subkey packet and the relevant signatures. */ @@ -2217,7 +1946,7 @@ export namespace openpgp { * @param primaryKey primary key used for validation * @returns */ - update(subKey: key.SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; + update(subKey: SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; /** * Revokes the subkey @@ -2228,7 +1957,7 @@ export namespace openpgp { * @param date optional, override the creationtime of the revocation signature * @returns new subkey with revocation signature */ - revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; + revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; /** * Calculates the key id of the key @@ -2268,2895 +1997,3166 @@ export namespace openpgp { } /** - * @see module:keyring/keyring - * @see module:keyring/localstore + * Reads an unarmored OpenPGP key list and returns one or multiple key objects + * @param data to be parsed + * @returns result object with key and error arrays */ + function read(data: Uint8Array): Promise<{ keys: Array, err: Array | null }>; + + interface KeyResult { keys: Array, err: Array | null } + + /** + * Reads an OpenPGP armored text and returns one or multiple key objects + * @param armoredText text to be parsed + * @returns result object with key and error arrays + */ + function readArmored(armoredText: string | ReadableStream): Promise; + + /** + * Generates a new OpenPGP key. Supports RSA and ECC keys. + * Primary and subkey will be of same type. + * @param options.keyType To indicate what type of key to make. + * RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1} + * @param options.numBits number of bits for the key creation. + * @param options.userIds Assumes already in form of "User Name " + * If array is used, the first userId is set as primary user Id + * @param options.passphrase The passphrase used to encrypt the resulting private key + * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires + * @param curve (optional) elliptic curve for ECC keys + * @param date Override the creation date of the key and the key signatures + * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt + * @returns + */ + function generate(options: KeyOptions): Promise; + + /** + * Reformats and signs an OpenPGP key with a given User ID. Currently only supports RSA keys. + * @param options.privateKey The private key to reformat + * @param options.keyType + * @param options.userIds Assumes already in form of "User Name " + * If array is used, the first userId is set as primary user Id + * @param options.passphrase The passphrase used to encrypt the resulting private key + * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires + * @param date Override the creation date of the key and the key signatures + * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * @returns + */ + function reformat(date: Date, subkeys: any[]): Promise; + + /** + * Checks if a given certificate or binding signature is revoked + * @param primaryKey The primary key packet + * @param dataToVerify The data to check + * @param revocations The revocation signatures to check + * @param signature The certificate or signature to check + * @param key, optional The key packet to check the signature + * @param date Use the given date instead of the current time + * @returns True if the signature revokes the data + */ + function isDataRevoked(primaryKey: packet.SecretKey | packet.PublicKey, dataToVerify: object, revocations: any[], signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + + /** + * Check if signature has revocation key sub packet (not supported by OpenPGP.js) + * and throw error if found + * @param signature The certificate or signature to check + * @param keyId Check only certificates or signatures from a certain issuer key ID + */ + function checkRevocationKey(signature: packet.Signature, keyId: type.keyid.Keyid): void; + + /** + * Returns the preferred signature hash algorithm of a key + * @param key (optional) the key to get preferences from + * @param keyPacket key packet used for signing + * @param date (optional) use the given date for verification instead of the current time + * @param userId (optional) user ID + * @returns + */ + function getPreferredHashAlgo(key: Key, keyPacket: packet.SecretKey | packet.SecretSubkey, date: Date, userId: object): Promise; + + /** + * Returns the preferred symmetric/aead algorithm for a set of keys + * @param {symmetric | aead} type Type of preference to return + * @param keys Set of keys + * @param date (optional) use the given date for verification instead of the current time + * @param userIds (optional) user IDs + * @returns Preferred symmetric algorithm + */ + function getPreferredAlgo(type: any, keys: any[], date: Date, userIds: any[]): Promise; + + /** + * Returns whether aead is supported by all keys in the set + * @param keys Set of keys + * @param date (optional) use the given date for verification instead of the current time + * @param userIds (optional) user IDs + * @returns + */ + function isAeadSupported(keys: any[], date: Date, userIds: any[]): Promise; +} + +export interface revoke_reasonForRevocation { + /** + * optional, flag indicating the reason for revocation + */ + flag: enums.reasonForRevocation; + /** + * optional, string explaining the reason for revocation + */ + string: string; +} + +/** + * Class that represents an user ID or attribute packet and the relevant signatures. + */ +export class User { + constructor(); + + /** + * Transforms structured user data to packetlist + * @returns + */ + toPacketlist(): packet.List; + + /** + * Signs user + * @param primaryKey The primary key packet + * @param privateKeys Decrypted private keys for signing + * @returns New user with new certificate signatures + */ + sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; + + /** + * Checks if a given certificate of the user is revoked + * @param primaryKey The primary key packet + * @param certificate The certificate to verify + * @param key, optional The key to verify the signature + * @param date Use the given date instead of the current time + * @returns True if the certificate is revoked + */ + isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + + /** + * Verifies the user certificate + * @param primaryKey The primary key packet + * @param certificate A certificate of this user + * @param keys Array of keys to verify certificate signatures + * @param date Use the given date instead of the current time + * @returns status of the certificate + */ + verifyCertificate(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, keys: any[], date: Date): Promise; + + /** + * Verifies all user certificates + * @param primaryKey The primary key packet + * @param keys Array of keys to verify certificate signatures + * @param date Use the given date instead of the current time + * @returns List of signer's keyid and validity of signature + */ + verifyAllCertifications(primaryKey: packet.SecretKey | packet.PublicKey, keys: any[], date: Date): Promise>; + + /** + * Verify User. Checks for existence of self signatures, revocation signatures + * and validity of self signature + * @param primaryKey The primary key packet + * @param date Use the given date instead of the current time + * @returns Status of user + */ + verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; + + /** + * Update user with new components from specified user + * @param user Source user to merge + * @param primaryKey primary key used for validation + * @returns + */ + update(user: key.User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; +} + +/** + * Class that represents a subkey packet and the relevant signatures. + */ +export class SubKey { + constructor(); + + /** + * Transforms structured subkey data to packetlist + * @returns + */ + toPacketlist(): packet.List; + + /** + * Checks if a binding signature of a subkey is revoked + * @param primaryKey The primary key packet + * @param signature The binding signature to verify + * @param key, optional The key to verify the signature + * @param date Use the given date instead of the current time + * @returns True if the binding signature is revoked + */ + isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + + /** + * Verify subkey. Checks for revocation signatures, expiration time + * and valid binding signature + * @param primaryKey The primary key packet + * @param date Use the given date instead of the current time + * @returns The status of the subkey + */ + verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; + + /** + * Returns the expiration time of the subkey or Infinity if key does not expire + * Returns null if the subkey is invalid. + * @param primaryKey The primary key packet + * @param date Use the given date instead of the current time + * @returns + */ + getExpirationTime(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; + + /** + * Update subkey with new components from specified subkey + * @param subKey Source subkey to merge + * @param primaryKey primary key used for validation + * @returns + */ + update(subKey: key.SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; + + /** + * Revokes the subkey + * @param primaryKey decrypted private primary key for revocation + * @param reasonForRevocation optional, object indicating the reason for revocation + * @param reasonForRevocation.flag optional, flag indicating the reason for revocation + * @param reasonForRevocation.string optional, string explaining the reason for revocation + * @param date optional, override the creationtime of the revocation signature + * @returns new subkey with revocation signature + */ + revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; +} + +/** + * @see module:keyring/keyring + * @see module:keyring/localstore + */ +export namespace keyring { namespace keyring { - namespace keyring { - class Keyring { - /** - * Initialization routine for the keyring. - * @param storeHandler class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods - */ - constructor(storeHandler?: localstore.LocalStore); - - /** - * Calls the storeHandler to load the keys - */ - load(): void; - - /** - * Calls the storeHandler to save the keys - */ - store(): void; - - /** - * Clear the keyring - erase all the keys - */ - clear(): void; - - /** - * Searches the keyring for keys having the specified key id - * @param keyId provided as string of lowercase hex number - * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @param deep if true search also in subkeys - * @returns keys found or null - */ - getKeysForId(keyId: string, deep: boolean): any[] | null; - - /** - * Removes keys having the specified key id from the keyring - * @param keyId provided as string of lowercase hex number - * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @returns keys found or null - */ - removeKeysForId(keyId: string): any[] | null; - - /** - * Get all public and private keys - * @returns all keys - */ - getAllKeys(): any[]; - } + class Keyring { + /** + * Initialization routine for the keyring. + * @param storeHandler class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods + */ + constructor(storeHandler?: localstore.LocalStore); /** - * Array of keys - * @param keys The keys to store in this array + * Calls the storeHandler to load the keys */ - function KeyArray(keys: any[]): void; + load(): void; + + /** + * Calls the storeHandler to save the keys + */ + store(): void; + + /** + * Clear the keyring - erase all the keys + */ + clear(): void; + + /** + * Searches the keyring for keys having the specified key id + * @param keyId provided as string of lowercase hex number + * withouth 0x prefix (can be 16-character key ID or fingerprint) + * @param deep if true search also in subkeys + * @returns keys found or null + */ + getKeysForId(keyId: string, deep: boolean): any[] | null; + + /** + * Removes keys having the specified key id from the keyring + * @param keyId provided as string of lowercase hex number + * withouth 0x prefix (can be 16-character key ID or fingerprint) + * @returns keys found or null + */ + removeKeysForId(keyId: string): any[] | null; + + /** + * Get all public and private keys + * @returns all keys + */ + getAllKeys(): any[]; } - namespace localstore { - class LocalStore { - /** - * The class that deals with storage of the keyring. - * Currently the only option is to use HTML5 local storage. - * @param prefix prefix for itemnames in localstore - */ - constructor(prefix: string); - - /** - * Load the public keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPublic(): any[]; - - /** - * Load the private keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPrivate(): any[]; - - /** - * Saves the current state of the public keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePublic(keys: any[]): void; - - /** - * Saves the current state of the private keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePrivate(keys: any[]): void; - } - } + /** + * Array of keys + * @param keys The keys to store in this array + */ + function KeyArray(keys: any[]): void; } - class LocalStore { - /** - * The class that deals with storage of the keyring. - * Currently the only option is to use HTML5 local storage. - * @param prefix prefix for itemnames in localstore - */ - constructor(prefix: string); - - /** - * Load the public keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPublic(): any[]; - - /** - * Load the private keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPrivate(): any[]; - - /** - * Saves the current state of the public keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePublic(keys: any[]): void; - - /** - * Saves the current state of the private keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePrivate(keys: any[]): void; - } - - namespace message { - /** - * Class that represents an OpenPGP message. - * Can be an encrypted message, signed message, compressed message or literal message - */ - class Message { - packets: packet.List; + namespace localstore { + class LocalStore { + /** + * The class that deals with storage of the keyring. + * Currently the only option is to use HTML5 local storage. + * @param prefix prefix for itemnames in localstore + */ + constructor(prefix: string); /** - * @param packetlist The packets that form this message - * See {@link https://tools.ietf.org/html/rfc4880#section-11.3} + * Load the public keys from HTML5 local storage. + * @returns array of keys retrieved from localstore */ - constructor(packetlist: packet.List); + loadPublic(): any[]; /** - * Returns the key IDs of the keys to which the session key is encrypted - * @returns array of keyid objects + * Load the private keys from HTML5 local storage. + * @returns array of keys retrieved from localstore */ - getEncryptionKeyIds(): any[]; + loadPrivate(): any[]; /** - * Returns the key IDs of the keys that signed the message - * @returns array of keyid objects + * Saves the current state of the public keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore */ - getSigningKeyIds(): any[]; + storePublic(keys: any[]): void; /** - * Decrypt the message. Either a private key, a session key, or a password must be specified. - * @param privateKeys (optional) private keys with decrypted secret data - * @param passwords (optional) passwords used to decrypt - * @param sessionKeys (optional) session keys in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } - * @param streaming (optional) whether to process data as a stream - * @returns new message with decrypted content + * Saves the current state of the private keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore */ - decrypt(privateKeys?: any[], passwords?: any[], sessionKeys?: any[], streaming?: boolean): Promise; - - /** - * Decrypt encrypted session keys either with private keys or passwords. - * @param privateKeys (optional) private keys with decrypted secret data - * @param passwords (optional) passwords used to decrypt - * @returns array of object with potential sessionKey, algorithm pairs - */ - decryptSessionKeys(privateKeys?: any[], passwords?: any[]): Promise>; - - /** - * Get literal data that is the body of the message - * @returns literal body of the message as Uint8Array - */ - getLiteralData(): Uint8Array | null; - - /** - * Get filename from literal data packet - * @returns filename of literal data packet as string - */ - getFilename(): string | null; - - /** - * Get literal data as text - * @returns literal body of the message interpreted as text - */ - getText(): string | null; - - /** - * Encrypt the message either with public keys, passwords, or both at once. - * @param keys (optional) public key(s) for message encryption - * @param passwords (optional) password(s) for message encryption - * @param sessionKey (optional) session key in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } - * @param wildcard (optional) use a key ID of 0 instead of the public key IDs - * @param date (optional) override the creation date of the literal package - * @param userIds (optional) user IDs to encrypt for, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] - * @param streaming (optional) whether to process data as a stream - * @returns new message with encrypted content - */ - encrypt(keys?: any[], passwords?: any[], sessionKey?: object, wildcard?: boolean, date?: Date, userIds?: any[], streaming?: boolean): Promise; - - /** - * Sign the message (the literal data packet of the message) - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature to add to the message - * @param date (optional) override the creation time of the signature - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new message with signed content - */ - sign(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; - - /** - * Compresses the message (the literal and -if signed- signature data packets of the message) - * @param compression compression algorithm to be used - * @returns new message with compressed content - */ - compress(compression: enums.compression): Message; - - /** - * Create a detached signature for the message (the literal data packet of the message) - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature - * @param date (optional) override the creation time of the signature - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new detached signature of message content - */ - signDetached(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; - - /** - * Verify message signatures - * @param keys array of keys to verify signatures - * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @param streaming (optional) whether to process data as a stream - * @returns list of signer's keyid and validity of signature - */ - verify(keys: any[], date?: Date, streaming?: boolean): Promise>; - - /** - * Verify detached message signature - * @param keys array of keys to verify signatures - * @param signature - * @param date Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @returns list of signer's keyid and validity of signature - */ - verifyDetached(keys: any[], signature: signature.Signature, date?: Date): Promise>; - - /** - * Unwrap compressed message - * @returns message Content of compressed message - */ - unwrapCompressed(): Message; - - /** - * Append signature to unencrypted message object - * @param detachedSignature The detached ASCII-armored or Uint8Array PGP signature - */ - appendSignature(detachedSignature: string | Uint8Array): void; - - /** - * Returns ASCII armored text of message - * @returns ASCII armor - */ - armor(): ReadableStream; + storePrivate(keys: any[]): void; } + } +} + +export class LocalStore { + /** + * The class that deals with storage of the keyring. + * Currently the only option is to use HTML5 local storage. + * @param prefix prefix for itemnames in localstore + */ + constructor(prefix: string); + + /** + * Load the public keys from HTML5 local storage. + * @returns array of keys retrieved from localstore + */ + loadPublic(): any[]; + + /** + * Load the private keys from HTML5 local storage. + * @returns array of keys retrieved from localstore + */ + loadPrivate(): any[]; + + /** + * Saves the current state of the public keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore + */ + storePublic(keys: any[]): void; + + /** + * Saves the current state of the private keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore + */ + storePrivate(keys: any[]): void; +} + +export namespace message { + /** + * Class that represents an OpenPGP message. + * Can be an encrypted message, signed message, compressed message or literal message + */ + class Message { + packets: packet.List; /** - * Encrypt a session key either with public keys, passwords, or both at once. - * @param sessionKey session key for encryption - * @param symAlgo session key algorithm - * @param aeadAlgo (optional) aead algorithm, e.g. 'eax' or 'ocb' - * @param publicKeys (optional) public key(s) for message encryption - * @param passwords (optional) for message encryption + * @param packetlist The packets that form this message + * See {@link https://tools.ietf.org/html/rfc4880#section-11.3} + */ + constructor(packetlist: packet.List); + + /** + * Returns the key IDs of the keys to which the session key is encrypted + * @returns array of keyid objects + */ + getEncryptionKeyIds(): any[]; + + /** + * Returns the key IDs of the keys that signed the message + * @returns array of keyid objects + */ + getSigningKeyIds(): any[]; + + /** + * Decrypt the message. Either a private key, a session key, or a password must be specified. + * @param privateKeys (optional) private keys with decrypted secret data + * @param passwords (optional) passwords used to decrypt + * @param sessionKeys (optional) session keys in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } + * @param streaming (optional) whether to process data as a stream + * @returns new message with decrypted content + */ + decrypt(privateKeys?: any[], passwords?: any[], sessionKeys?: any[], streaming?: boolean): Promise; + + /** + * Decrypt encrypted session keys either with private keys or passwords. + * @param privateKeys (optional) private keys with decrypted secret data + * @param passwords (optional) passwords used to decrypt + * @returns array of object with potential sessionKey, algorithm pairs + */ + decryptSessionKeys(privateKeys?: any[], passwords?: any[]): Promise>; + + /** + * Get literal data that is the body of the message + * @returns literal body of the message as Uint8Array + */ + getLiteralData(): Uint8Array | null; + + /** + * Get filename from literal data packet + * @returns filename of literal data packet as string + */ + getFilename(): string | null; + + /** + * Get literal data as text + * @returns literal body of the message interpreted as text + */ + getText(): string | null; + + /** + * Encrypt the message either with public keys, passwords, or both at once. + * @param keys (optional) public key(s) for message encryption + * @param passwords (optional) password(s) for message encryption + * @param sessionKey (optional) session key in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } * @param wildcard (optional) use a key ID of 0 instead of the public key IDs - * @param date (optional) override the date + * @param date (optional) override the creation date of the literal package * @param userIds (optional) user IDs to encrypt for, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] + * @param streaming (optional) whether to process data as a stream * @returns new message with encrypted content */ - function encryptSessionKey(sessionKey: Uint8Array, symAlgo: string, aeadAlgo: string, publicKeys: any[], passwords: any[], wildcard: boolean, date: Date, userIds: any[]): Promise; + encrypt(keys?: any[], passwords?: any[], sessionKey?: object, wildcard?: boolean, date?: Date, userIds?: any[], streaming?: boolean): Promise; /** - * Create signature packets for the message - * @param literalDataPacket the literal data packet to sign + * Sign the message (the literal data packet of the message) * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature to append - * @param date (optional) override the creationtime of the signature + * @param signature (optional) any existing detached signature to add to the message + * @param date (optional) override the creation time of the signature * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns list of signature packets + * @returns new message with signed content */ - function createSignaturePackets(literalDataPacket: packet.Literal, privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + sign(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; /** - * Create object containing signer's keyid and validity of signature - * @param signature signature packets - * @param literalDataList array of literal data packets + * Compresses the message (the literal and -if signed- signature data packets of the message) + * @param compression compression algorithm to be used + * @returns new message with compressed content + */ + compress(compression: enums.compression): Message; + + /** + * Create a detached signature for the message (the literal data packet of the message) + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature + * @param date (optional) override the creation time of the signature + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns new detached signature of message content + */ + signDetached(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; + + /** + * Verify message signatures * @param keys array of keys to verify signatures - * @param date Verify the signature against the given date, - * i.e. check signature creation time < date < expiration time + * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time + * @param streaming (optional) whether to process data as a stream * @returns list of signer's keyid and validity of signature */ - function createVerificationObject(signature: packet.Signature, literalDataList: any[], keys: any[], date: Date): Promise>; + verify(keys: any[], date?: Date, streaming?: boolean): Promise>; /** - * Create list of objects containing signer's keyid and validity of signature - * @param signatureList array of signature packets - * @param literalDataList array of literal data packets + * Verify detached message signature * @param keys array of keys to verify signatures - * @param date Verify the signature against the given date, - * i.e. check signature creation time < date < expiration time + * @param signature + * @param date Verify the signature against the given date, i.e. check signature creation time < date < expiration time * @returns list of signer's keyid and validity of signature */ - function createVerificationObjects(signatureList: any[], literalDataList: any[], keys: any[], date: Date): Promise>; + verifyDetached(keys: any[], signature: signature.Signature, date?: Date): Promise>; /** - * reads an OpenPGP armored message and returns a message object - * @param armoredText text to be parsed - * @returns new message object + * Unwrap compressed message + * @returns message Content of compressed message */ - function readArmored(armoredText: string | ReadableStream): Promise; + unwrapCompressed(): Message; /** - * reads an OpenPGP message as byte array and returns a message object - * @param input binary message - * @param fromStream whether the message was created from a Stream - * @returns new message object + * Append signature to unencrypted message object + * @param detachedSignature The detached ASCII-armored or Uint8Array PGP signature */ - function read(input: Uint8Array | ReadableStream, fromStream?: boolean): Promise; + appendSignature(detachedSignature: string | Uint8Array): void; /** - * creates new message object from text - * @param text - * @param filename (optional) - * @param date (optional) - * @param {utf8 | binary | text | mime} type (optional) data packet type - * @returns new message object + * Returns ASCII armored text of message + * @returns ASCII armor */ - function fromText(text: string | ReadableStream, filename?: string, date?: Date, type?: any): Message; - - /** - * creates new message object from binary data - * @param bytes - * @param filename (optional) - * @param date (optional) - * @param {utf8 | binary | text | mime} type (optional) data packet type - * @returns new message object - */ - function fromBinary(bytes: Uint8Array | ReadableStream, filename?: string, date?: Date, type?: any): Message; - } - - interface revokeKey_reasonForRevocation { - /** - * (optional) flag indicating the reason for revocation - */ - flag: enums.reasonForRevocation; - /** - * (optional) string explaining the reason for revocation - */ - string: string; + armor(): ReadableStream; } /** - * @see module:packet/all_packets - * @see module:packet/clone - * @see module:packet.List + * Encrypt a session key either with public keys, passwords, or both at once. + * @param sessionKey session key for encryption + * @param symAlgo session key algorithm + * @param aeadAlgo (optional) aead algorithm, e.g. 'eax' or 'ocb' + * @param publicKeys (optional) public key(s) for message encryption + * @param passwords (optional) for message encryption + * @param wildcard (optional) use a key ID of 0 instead of the public key IDs + * @param date (optional) override the date + * @param userIds (optional) user IDs to encrypt for, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] + * @returns new message with encrypted content */ + function encryptSessionKey(sessionKey: Uint8Array, symAlgo: string, aeadAlgo: string, publicKeys: any[], passwords: any[], wildcard: boolean, date: Date, userIds: any[]): Promise; + + /** + * Create signature packets for the message + * @param literalDataPacket the literal data packet to sign + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature to append + * @param date (optional) override the creationtime of the signature + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns list of signature packets + */ + function createSignaturePackets(literalDataPacket: packet.Literal, privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + + /** + * Create object containing signer's keyid and validity of signature + * @param signature signature packets + * @param literalDataList array of literal data packets + * @param keys array of keys to verify signatures + * @param date Verify the signature against the given date, + * i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + function createVerificationObject(signature: packet.Signature, literalDataList: any[], keys: any[], date: Date): Promise>; + + /** + * Create list of objects containing signer's keyid and validity of signature + * @param signatureList array of signature packets + * @param literalDataList array of literal data packets + * @param keys array of keys to verify signatures + * @param date Verify the signature against the given date, + * i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + function createVerificationObjects(signatureList: any[], literalDataList: any[], keys: any[], date: Date): Promise>; + + /** + * reads an OpenPGP armored message and returns a message object + * @param armoredText text to be parsed + * @returns new message object + */ + function readArmored(armoredText: string | ReadableStream): Promise; + + /** + * reads an OpenPGP message as byte array and returns a message object + * @param input binary message + * @param fromStream whether the message was created from a Stream + * @returns new message object + */ + function read(input: Uint8Array | ReadableStream, fromStream?: boolean): Promise; + + /** + * creates new message object from text + * @param text + * @param filename (optional) + * @param date (optional) + * @param {utf8 | binary | text | mime} type (optional) data packet type + * @returns new message object + */ + function fromText(text: string | ReadableStream, filename?: string, date?: Date, type?: any): Message; + + /** + * creates new message object from binary data + * @param bytes + * @param filename (optional) + * @param date (optional) + * @param {utf8 | binary | text | mime} type (optional) data packet type + * @returns new message object + */ + function fromBinary(bytes: Uint8Array | ReadableStream, filename?: string, date?: Date, type?: any): Message; +} + +export interface revokeKey_reasonForRevocation { + /** + * (optional) flag indicating the reason for revocation + */ + flag: enums.reasonForRevocation; + /** + * (optional) string explaining the reason for revocation + */ + string: string; +} + +/** + * @see module:packet/all_packets + * @see module:packet/clone + * @see module:packet.List + */ +export namespace packet { + /** + * Allocate a new packet + * @param tag property name from {@link module:enums.packet} + * @returns new packet object with type based on tag + */ + function newPacketFromTag(tag: string): object; + + /** + * Allocate a new packet from structured packet clone + * @see + * @param packetClone packet clone + * @returns new packet object with data from packet clone + */ + function fromStructuredClone(packetClone: object): object; + + class Compressed { + /** + * Implementation of the Compressed Data Packet (Tag 8) + * {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: + * The Compressed Data packet contains compressed data. Typically, + * this packet is found as the contents of an encrypted packet, or following + * a Signature or One-Pass Signature packet, and contains a literal data packet. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * List of packets + */ + packets: List; + + /** + * Compression algorithm + * @type {compression} + */ + algorithm: any; + + /** + * Compressed packet data + */ + compressed: Uint8Array | ReadableStream; + + /** + * Parsing function for the packet. + * @param bytes Payload of a tag 8 packet + */ + read(bytes: Uint8Array | ReadableStream): void; + + /** + * Return the compressed packet. + * @returns binary compressed packet + */ + write(): Uint8Array | ReadableStream; + + /** + * Decompression method for decompressing the compressed data + * read by read_packet + */ + decompress(): void; + + /** + * Compress the packet data (member decompressedData) + */ + compress(): void; + } + + class Literal { + /** + * Implementation of the Literal Data Packet (Tag 11) + * {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: + * A Literal Data packet contains the body of a message; data that is not to be + * further interpreted. + * @param date the creation date of the literal package + */ + constructor(date: Date); + + /** + * Set the packet data to a javascript native string, end of line + * will be normalized to \r\n and by default text is converted to UTF8 + * @param text Any native javascript string + * @param {utf8 | binary | text | mime} format (optional) The format of the string of bytes + */ + setText(text: string | ReadableStream, format: any): void; + + /** + * Returns literal data packets as native JavaScript string + * with normalized end of line to \n + * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again + * @returns literal data as text + */ + getText(clone: boolean): string | ReadableStream; + + /** + * Set the packet data to value represented by the provided string of bytes. + * @param bytes The string of bytes + * @param {utf8 | binary | text | mime} format The format of the string of bytes + */ + setBytes(bytes: Uint8Array | ReadableStream, format: any): void; + + /** + * Get the byte sequence representing the literal packet data + * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again + * @returns A sequence of bytes + */ + getBytes(clone: boolean): Uint8Array | ReadableStream; + + /** + * Sets the filename of the literal packet data + * @param filename Any native javascript string + */ + setFilename(filename: string): void; + + /** + * Get the filename of the literal packet data + * @returns filename + */ + getFilename(): string; + + /** + * Parsing function for a literal data packet (tag 11). + * @param input Payload of a tag 11 packet + * @returns object representation + */ + read(input: Uint8Array | ReadableStream): Literal; + + /** + * Creates a string representation of the packet + * @returns Uint8Array representation of the packet + */ + write(): Uint8Array | ReadableStream; + } + + class Marker { + /** + * Implementation of the strange "Marker packet" (Tag 10) + * {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: + * An experimental version of PGP used this packet as the Literal + * packet, but no released version of PGP generated Literal packets with this + * tag. With PGP 5.x, this packet has been reassigned and is reserved for use as + * the Marker packet. + * Such a packet MUST be ignored when received. + */ + constructor(); + + /** + * Parsing function for a literal data packet (tag 10). + * @param input Payload of a tag 10 packet + * @param position Position to start reading from the input string + * @param len Length of the packet or the remaining length of + * input at position + * @returns Object representation + */ + read(input: string, position: Integer, len: Integer): Marker; + } + + class OnePassSignature { + /** + * Implementation of the One-Pass Signature Packets (Tag 4) + * {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: + * The One-Pass Signature packet precedes the signed data and contains + * enough information to allow the receiver to begin calculating any + * hashes needed to verify the signature. It allows the Signature + * packet to be placed at the end of the message, so that the signer + * can compute the entire signed message in one pass. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * A one-octet version number. The current version is 3. + */ + version: any; + + /** + * A one-octet signature type. + * Signature types are described in + * {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}. + */ + signatureType: any; + + /** + * A one-octet number describing the hash algorithm used. + * @see + */ + hashAlgorithm: any; + + /** + * A one-octet number describing the public-key algorithm used. + * @see + */ + publicKeyAlgorithm: any; + + /** + * An eight-octet number holding the Key ID of the signing key. + */ + issuerKeyId: any; + + /** + * A one-octet number holding a flag showing whether the signature is nested. + * A zero value indicates that the next packet is another One-Pass Signature packet + * that describes another signature to be applied to the same message data. + */ + flags: any; + + /** + * parsing function for a one-pass signature packet (tag 4). + * @param bytes payload of a tag 4 packet + * @returns object representation + */ + read(bytes: Uint8Array): OnePassSignature; + + /** + * creates a string representation of a one-pass signature packet + * @returns a Uint8Array representation of a one-pass signature packet + */ + write(): Uint8Array; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class List { + /** + * This class represents a list of openpgp packets. + * Take care when iterating over it - the packets themselves + * are stored as numerical indices. + */ + constructor(); + + /** + * The number of packets contained within the list. + */ + readonly length: Integer; + + /** + * Reads a stream of binary data and interprents it as a list of packets. + * @param A Uint8Array of bytes. + */ + read(A: Uint8Array | ReadableStream): void; + + /** + * Creates a binary representation of openpgp objects contained within the + * class instance. + * @returns A Uint8Array containing valid openpgp packets. + */ + write(): Uint8Array; + + /** + * Adds a packet to the list. This is the only supported method of doing so; + * writing to packetlist[i] directly will result in an error. + * @param packet Packet to push + */ + push(packet: object): void; + + /** + * Creates a new PacketList with all packets from the given types + */ + filterByTag(): void; + + /** + * Traverses packet tree and returns first matching packet + * @param type The packet type + * @returns + */ + findPacket(type: enums.packet): List | undefined; + + /** + * Returns array of found indices by tag + */ + indexOfTag(): void; + + /** + * Concatenates packetlist or array of packets + */ + concat(): void; + + /** + * Allocate a new packetlist from structured packetlist clone + * See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data} + * @param packetClone packetlist clone + * @returns new packetlist object with data from packetlist clone + */ + static fromStructuredClone(packetClone: object): object; + } + + class PublicKey { + /** + * Implementation of the Key Material Packet (Tag 5,6,7,14) + * {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}: + * A key material packet contains all the information about a public or + * private key. There are four variants of this packet type, and two + * major versions. + * A Public-Key packet starts a series of packets that forms an OpenPGP + * key (sometimes called an OpenPGP certificate). + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} + * called by read_tag<num> + * @param bytes Input array to read the packet from + * @returns This object with attributes set by the parser + */ + read(bytes: Uint8Array): object; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Same as write_private_key, but has less information because of + * public key. + * @returns OpenPGP packet body contents, + */ + write(): Uint8Array; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class PublicKeyEncryptedSessionKey { + /** + * Public-Key Encrypted Session Key Packets (Tag 1) + * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: + * A Public-Key Encrypted Session Key packet holds the session key + * used to encrypt a message. Zero or more Public-Key Encrypted Session Key + * packets and/or Symmetric-Key Encrypted Session Key packets may precede a + * Symmetrically Encrypted Data Packet, which holds an encrypted message. The + * message is encrypted with the session key, and the session key is itself + * encrypted and stored in the Encrypted Session Key packet(s). The + * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted + * Session Key packet for each OpenPGP key to which the message is encrypted. + * The recipient of the message finds a session key that is encrypted to their + * public key, decrypts the session key, and then uses the session key to + * decrypt the message. + */ + constructor(); + + encrypted: any[]; + + /** + * Parsing function for a publickey encrypted session key packet (tag 1). + * @param input Payload of a tag 1 packet + * @param position Position to start reading from the input string + * @param len Length of the packet or the remaining length of + * input at position + * @returns Object representation + */ + read(input: Uint8Array, position: Integer, len: Integer): PublicKeyEncryptedSessionKey + + /** + * Create a string representation of a tag 1 packet + * @returns The Uint8Array representation + */ + write(): Uint8Array; + + /** + * Encrypt session key packet + * @param key Public key + * @returns + */ + encrypt(key: PublicKey): Promise; + + /** + * Decrypts the session key (only for public key encrypted session key + * packets (tag 1) + * @param key Private key with secret params unlocked + * @returns + */ + decrypt(key: SecretKey): Promise; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class PublicSubkey { + /** + * A Public-Subkey packet (tag 14) has exactly the same format as a + * Public-Key packet, but denotes a subkey. One or more subkeys may be + * associated with a top-level key. By convention, the top-level key + * provides signature services, and the subkeys provide encryption + * services. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} + * called by read_tag<num> + * @param bytes Input array to read the packet from + * @returns This object with attributes set by the parser + */ + read(bytes: Uint8Array): object; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Same as write_private_key, but has less information because of + * public key. + * @returns OpenPGP packet body contents, + */ + write(): Uint8Array; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class SecretKey { + /** + * A Secret-Key packet contains all the information that is found in a + * Public-Key packet, including the public-key material, but also + * includes the secret-key material after all the public-key fields. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Encrypted secret-key data + */ + encrypted: any; + + /** + * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. + */ + isEncrypted: any; + + /** + * Internal parser for private keys as specified in + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} + * @param bytes Input string to read the packet from + */ + read(bytes: string): void; + + /** + * Creates an OpenPGP key packet for the given key. + * @returns A string of bytes containing the secret key OpenPGP packet + */ + write(): string; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Encrypt the payload. By default, we use aes256 and iterated, salted string + * to key specifier. If the key is in a decrypted state (isEncrypted === false) + * and the passphrase is empty or undefined, the key will be set as not encrypted. + * This can be used to remove passphrase protection after calling decrypt(). + * @param passphrase + * @returns + */ + encrypt(passphrase: string): Promise; + + /** + * Decrypts the private key params which are needed to use the key. + * {@link module:packet.SecretKey.isDecrypted} should be false, as + * otherwise calls to this function will throw an error. + * @param passphrase The passphrase for this private key as string + * @returns + */ + decrypt(passphrase: string): Promise; + + /** + * Clear private params, return to initial state + */ + clearPrivateParams(): void; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + } + + class SecretSubkey { + /** + * A Secret-Subkey packet (tag 7) is the subkey analog of the Secret + * Key packet and has exactly the same format. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Encrypted secret-key data + */ + encrypted: any; + + /** + * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. + */ + isEncrypted: any; + + /** + * Internal parser for private keys as specified in + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} + * @param bytes Input string to read the packet from + */ + read(bytes: string): void; + + /** + * Creates an OpenPGP key packet for the given key. + * @returns A string of bytes containing the secret key OpenPGP packet + */ + write(): string; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Encrypt the payload. By default, we use aes256 and iterated, salted string + * to key specifier. If the key is in a decrypted state (isEncrypted === false) + * and the passphrase is empty or undefined, the key will be set as not encrypted. + * This can be used to remove passphrase protection after calling decrypt(). + * @param passphrase + * @returns + */ + encrypt(passphrase: string): Promise; + + /** + * Decrypts the private key params which are needed to use the key. + * {@link module:packet.SecretKey.isDecrypted} should be false, as + * otherwise calls to this function will throw an error. + * @param passphrase The passphrase for this private key as string + * @returns + */ + decrypt(passphrase: string): Promise; + + /** + * Clear private params, return to initial state + */ + clearPrivateParams(): void; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + } + + class Signature { + /** + * Implementation of the Signature Packet (Tag 2) + * {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}: + * A Signature packet describes a binding between some public key and + * some data. The most common signatures are a signature of a file or a + * block of text, and a signature that is a certification of a User ID. + * @param date the creation date of the signature + */ + constructor(date: Date); + + /** + * parsing function for a signature packet (tag 2). + * @param bytes payload of a tag 2 packet + * @param position position to start reading from the bytes string + * @param len length of the packet or the remaining length of bytes at position + * @returns object representation + */ + read(bytes: string, position: Integer, len: Integer): Signature; + + /** + * Signs provided data. This needs to be done prior to serialization. + * @param key private key used to sign the message. + * @param data Contains packets to be signed. + * @returns + */ + sign(key: SecretKey, data: object): Promise; + + /** + * Creates Uint8Array of bytes of all subpacket data except Issuer and Embedded Signature subpackets + * @returns subpacket data + */ + write_hashed_sub_packets(): Uint8Array; + + /** + * Creates Uint8Array of bytes of Issuer and Embedded Signature subpackets + * @returns subpacket data + */ + write_unhashed_sub_packets(): Uint8Array; + + /** + * verifys the signature packet. Note: not signature types are implemented + * @param key the public key to verify the signature + * @param signatureType expected signature type + * @param data data which on the signature applies + * @returns True if message is verified, else false. + */ + verify(key: PublicSubkey | PublicKey | SecretSubkey | SecretKey, signatureType: enums.signature, data: string | object): Promise; + + /** + * Verifies signature expiration date + * @param date (optional) use the given date for verification instead of the current time + * @returns true if expired + */ + isExpired(date: Date): boolean; + + /** + * Returns the expiration time of the signature or Infinity if signature does not expire + * @returns expiration time + */ + getExpirationTime(): Date; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class SymEncryptedAEADProtected { + /** + * Implementation of the Symmetrically Encrypted Authenticated Encryption with + * Additional Data (AEAD) Protected Data Packet + * {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1}: + * AEAD Protected Data Packet + */ + constructor(); + + /** + * Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification) + * @param bytes + */ + read(bytes: Uint8Array | ReadableStream): void; + + /** + * Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification) + * @returns The encrypted payload + */ + write(): Uint8Array | ReadableStream; + + /** + * Decrypt the encrypted payload. + * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' + * @param key The session key used to encrypt the payload + * @param streaming Whether the top-level function will return a stream + * @returns + */ + decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): boolean; + + /** + * Encrypt the packet list payload. + * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' + * @param key The session key used to encrypt the payload + * @param streaming Whether the top-level function will return a stream + */ + encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): void; + + /** + * En/decrypt the payload. + * @param {encrypt | decrypt} fn Whether to encrypt or decrypt + * @param key The session key used to en/decrypt the payload + * @param data The data to en/decrypt + * @param streaming Whether the top-level function will return a stream + * @returns + */ + crypt(fn: any, key: Uint8Array, data: Uint8Array | ReadableStream, streaming: boolean): Uint8Array | ReadableStream; + } + + class SymEncryptedIntegrityProtected { + /** + * Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) + * {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}: + * The Symmetrically Encrypted Integrity Protected Data packet is + * a variant of the Symmetrically Encrypted Data packet. It is a new feature + * created for OpenPGP that addresses the problem of detecting a modification to + * encrypted data. It is used in combination with a Modification Detection Code + * packet. + */ + constructor(); + + /** + * The encrypted payload. + */ + encrypted: any; + + /** + * If after decrypting the packet this is set to true, + * a modification has been detected and thus the contents + * should be discarded. + */ + modification: boolean; + + /** + * Encrypt the payload in the packet. + * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' + * @param key The key of cipher blocksize length to be used + * @param streaming Whether to set this.encrypted to a stream + * @returns + */ + encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; + + /** + * Decrypts the encrypted data contained in the packet. + * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' + * @param key The key of cipher blocksize length to be used + * @param streaming Whether to read this.encrypted as a stream + * @returns + */ + decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; + } + + class SymEncryptedSessionKey { + /** + * Public-Key Encrypted Session Key Packets (Tag 1) + * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: + * A Public-Key Encrypted Session Key packet holds the session key + * used to encrypt a message. Zero or more Public-Key Encrypted Session Key + * packets and/or Symmetric-Key Encrypted Session Key packets may precede a + * Symmetrically Encrypted Data Packet, which holds an encrypted message. The + * message is encrypted with the session key, and the session key is itself + * encrypted and stored in the Encrypted Session Key packet(s). The + * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted + * Session Key packet for each OpenPGP key to which the message is encrypted. + * The recipient of the message finds a session key that is encrypted to their + * public key, decrypts the session key, and then uses the session key to + * decrypt the message. + */ + constructor(); + + /** + * Parsing function for a symmetric encrypted session key packet (tag 3). + * @param input Payload of a tag 1 packet + * @param position Position to start reading from the input string + * @param len Length of the packet or the remaining length of + * input at position + * @returns Object representation + */ + read(input: Uint8Array, position: Integer, len: Integer): SymEncryptedSessionKey; + + /** + * Decrypts the session key + * @param passphrase The passphrase in string form + * @returns + */ + decrypt(passphrase: string): Promise; + + /** + * Encrypts the session key + * @param passphrase The passphrase in string form + * @returns + */ + encrypt(passphrase: string): Promise; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class SymmetricallyEncrypted { + /** + * Implementation of the Symmetrically Encrypted Data Packet (Tag 9) + * {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: + * The Symmetrically Encrypted Data packet contains data encrypted with a + * symmetric-key algorithm. When it has been decrypted, it contains other + * packets (usually a literal data packet or compressed data packet, but in + * theory other Symmetrically Encrypted Data packets or sequences of packets + * that form whole OpenPGP messages). + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Encrypted secret-key data + */ + encrypted: any; + + /** + * Decrypted packets contained within. + */ + packets: List; + + /** + * When true, decrypt fails if message is not integrity protected + * @see module:config.ignore_mdc_error + */ + ignore_mdc_error: any; + + /** + * Decrypt the symmetrically-encrypted packet data + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param sessionKeyAlgorithm Symmetric key algorithm to use + * @param key The key of cipher blocksize length to be used + * @returns + */ + decrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; + + /** + * Encrypt the symmetrically-encrypted packet data + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param sessionKeyAlgorithm Symmetric key algorithm to use + * @param key The key of cipher blocksize length to be used + * @returns + */ + encrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; + } + + class Trust { + /** + * Implementation of the Trust Packet (Tag 12) + * {@link https://tools.ietf.org/html/rfc4880#section-5.10|RFC4880 5.10}: + * The Trust packet is used only within keyrings and is not normally + * exported. Trust packets contain data that record the user's + * specifications of which key holders are trustworthy introducers, + * along with other information that implementing software uses for + * trust information. The format of Trust packets is defined by a given + * implementation. + * Trust packets SHOULD NOT be emitted to output streams that are + * transferred to other users, and they SHOULD be ignored on any input + * other than local keyring files. + */ + constructor(); + + /** + * Parsing function for a trust packet (tag 12). + * Currently not implemented as we ignore trust packets + * @param byptes payload of a tag 12 packet + */ + read(byptes: string): void; + } + + class UserAttribute { + /** + * Implementation of the User Attribute Packet (Tag 17) + * The User Attribute packet is a variation of the User ID packet. It + * is capable of storing more types of data than the User ID packet, + * which is limited to text. Like the User ID packet, a User Attribute + * packet may be certified by the key owner ("self-signed") or any other + * key owner who cares to certify it. Except as noted, a User Attribute + * packet may be used anywhere that a User ID packet may be used. + * While User Attribute packets are not a required part of the OpenPGP + * standard, implementations SHOULD provide at least enough + * compatibility to properly handle a certification signature on the + * User Attribute packet. A simple way to do this is by treating the + * User Attribute packet as a User ID packet with opaque contents, but + * an implementation may use any method desired. + */ + constructor(); + + /** + * parsing function for a user attribute packet (tag 17). + * @param input payload of a tag 17 packet + */ + read(input: Uint8Array): void; + + /** + * Creates a binary representation of the user attribute packet + * @returns string representation + */ + write(): Uint8Array; + + /** + * Compare for equality + * @param usrAttr + * @returns true if equal + */ + equals(usrAttr: UserAttribute): boolean; + } + + class Userid { + /** + * Implementation of the User ID Packet (Tag 13) + * A User ID packet consists of UTF-8 text that is intended to represent + * the name and email address of the key holder. By convention, it + * includes an RFC 2822 [RFC2822] mail name-addr, but there are no + * restrictions on its content. The packet length in the header + * specifies the length of the User ID. + */ + constructor(); + + /** + * A string containing the user id. Usually in the form + * John Doe + */ + userid: string; + + /** + * Parsing function for a user id packet (tag 13). + * @param input payload of a tag 13 packet + */ + read(input: Uint8Array): void; + + /** + * Parse userid string, e.g. 'John Doe ' + */ + parse(): void; + + /** + * Creates a binary representation of the user id packet + * @returns binary representation + */ + write(): Uint8Array; + + /** + * Set userid string from object, e.g. { name:'Phil Zimmermann', email:'phil@openpgp.org' } + */ + format(): void; + } + + namespace all_packets { + /** + * @see module:packet.Compressed + */ + var Compressed: any; + + /** + * @see module:packet.SymEncryptedIntegrityProtected + */ + var SymEncryptedIntegrityProtected: any; + + /** + * @see module:packet.SymEncryptedAEADProtected + */ + var SymEncryptedAEADProtected: any; + + /** + * @see module:packet.PublicKeyEncryptedSessionKey + */ + var PublicKeyEncryptedSessionKey: any; + + /** + * @see module:packet.SymEncryptedSessionKey + */ + var SymEncryptedSessionKey: any; + + /** + * @see module:packet.Literal + */ + var Literal: any; + + /** + * @see module:packet.PublicKey + */ + var PublicKey: any; + + /** + * @see module:packet.SymmetricallyEncrypted + */ + var SymmetricallyEncrypted: any; + + /** + * @see module:packet.Marker + */ + var Marker: any; + + /** + * @see module:packet.PublicSubkey + */ + var PublicSubkey: any; + + /** + * @see module:packet.UserAttribute + */ + var UserAttribute: any; + + /** + * @see module:packet.OnePassSignature + */ + var OnePassSignature: any; + + /** + * @see module:packet.SecretKey + */ + var SecretKey: any; + + /** + * @see module:packet.Userid + */ + var Userid: any; + + /** + * @see module:packet.SecretSubkey + */ + var SecretSubkey: any; + + /** + * @see module:packet.Signature + */ + var Signature: any; + + /** + * @see module:packet.Trust + */ + var Trust: any; + } + + namespace clone { + /** + * Create a packetlist from the correspoding object types. + * @param options the object passed to and from the web worker + * @returns a mutated version of the options optject + */ + function clonePackets(options: object): object; + + /** + * Creates an object with the correct prototype from a corresponding packetlist. + * @param options the object passed to and from the web worker + * @param method the public api function name to be delegated to the worker + * @returns a mutated version of the options optject + */ + function parseClonedPackets(options: object, method: string): object; + } + namespace packet { /** - * Allocate a new packet - * @param tag property name from {@link module:enums.packet} - * @returns new packet object with type based on tag + * Encodes a given integer of length to the openpgp length specifier to a + * string + * @param length The length to encode + * @returns String with openpgp length representation */ - function newPacketFromTag(tag: string): object; + function writeSimpleLength(length: Integer): Uint8Array; /** - * Allocate a new packet from structured packet clone - * @see - * @param packetClone packet clone - * @returns new packet object with data from packet clone + * Writes a packet header version 4 with the given tag_type and length to a + * string + * @param tag_type Tag type + * @param length Length of the payload + * @returns String of the header */ - function fromStructuredClone(packetClone: object): object; - - class Compressed { - /** - * Implementation of the Compressed Data Packet (Tag 8) - * {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: - * The Compressed Data packet contains compressed data. Typically, - * this packet is found as the contents of an encrypted packet, or following - * a Signature or One-Pass Signature packet, and contains a literal data packet. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * List of packets - */ - packets: List; - - /** - * Compression algorithm - * @type {compression} - */ - algorithm: any; - - /** - * Compressed packet data - */ - compressed: Uint8Array | ReadableStream; - - /** - * Parsing function for the packet. - * @param bytes Payload of a tag 8 packet - */ - read(bytes: Uint8Array | ReadableStream): void; - - /** - * Return the compressed packet. - * @returns binary compressed packet - */ - write(): Uint8Array | ReadableStream; - - /** - * Decompression method for decompressing the compressed data - * read by read_packet - */ - decompress(): void; - - /** - * Compress the packet data (member decompressedData) - */ - compress(): void; - } - - class Literal { - /** - * Implementation of the Literal Data Packet (Tag 11) - * {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: - * A Literal Data packet contains the body of a message; data that is not to be - * further interpreted. - * @param date the creation date of the literal package - */ - constructor(date: Date); - - /** - * Set the packet data to a javascript native string, end of line - * will be normalized to \r\n and by default text is converted to UTF8 - * @param text Any native javascript string - * @param {utf8 | binary | text | mime} format (optional) The format of the string of bytes - */ - setText(text: string | ReadableStream, format: any): void; - - /** - * Returns literal data packets as native JavaScript string - * with normalized end of line to \n - * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again - * @returns literal data as text - */ - getText(clone: boolean): string | ReadableStream; - - /** - * Set the packet data to value represented by the provided string of bytes. - * @param bytes The string of bytes - * @param {utf8 | binary | text | mime} format The format of the string of bytes - */ - setBytes(bytes: Uint8Array | ReadableStream, format: any): void; - - /** - * Get the byte sequence representing the literal packet data - * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again - * @returns A sequence of bytes - */ - getBytes(clone: boolean): Uint8Array | ReadableStream; - - /** - * Sets the filename of the literal packet data - * @param filename Any native javascript string - */ - setFilename(filename: string): void; - - /** - * Get the filename of the literal packet data - * @returns filename - */ - getFilename(): string; - - /** - * Parsing function for a literal data packet (tag 11). - * @param input Payload of a tag 11 packet - * @returns object representation - */ - read(input: Uint8Array | ReadableStream): Literal; - - /** - * Creates a string representation of the packet - * @returns Uint8Array representation of the packet - */ - write(): Uint8Array | ReadableStream; - } - - class Marker { - /** - * Implementation of the strange "Marker packet" (Tag 10) - * {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: - * An experimental version of PGP used this packet as the Literal - * packet, but no released version of PGP generated Literal packets with this - * tag. With PGP 5.x, this packet has been reassigned and is reserved for use as - * the Marker packet. - * Such a packet MUST be ignored when received. - */ - constructor(); - - /** - * Parsing function for a literal data packet (tag 10). - * @param input Payload of a tag 10 packet - * @param position Position to start reading from the input string - * @param len Length of the packet or the remaining length of - * input at position - * @returns Object representation - */ - read(input: string, position: Integer, len: Integer): Marker; - } - - class OnePassSignature { - /** - * Implementation of the One-Pass Signature Packets (Tag 4) - * {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: - * The One-Pass Signature packet precedes the signed data and contains - * enough information to allow the receiver to begin calculating any - * hashes needed to verify the signature. It allows the Signature - * packet to be placed at the end of the message, so that the signer - * can compute the entire signed message in one pass. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * A one-octet version number. The current version is 3. - */ - version: any; - - /** - * A one-octet signature type. - * Signature types are described in - * {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}. - */ - signatureType: any; - - /** - * A one-octet number describing the hash algorithm used. - * @see - */ - hashAlgorithm: any; - - /** - * A one-octet number describing the public-key algorithm used. - * @see - */ - publicKeyAlgorithm: any; - - /** - * An eight-octet number holding the Key ID of the signing key. - */ - issuerKeyId: any; - - /** - * A one-octet number holding a flag showing whether the signature is nested. - * A zero value indicates that the next packet is another One-Pass Signature packet - * that describes another signature to be applied to the same message data. - */ - flags: any; - - /** - * parsing function for a one-pass signature packet (tag 4). - * @param bytes payload of a tag 4 packet - * @returns object representation - */ - read(bytes: Uint8Array): OnePassSignature; - - /** - * creates a string representation of a one-pass signature packet - * @returns a Uint8Array representation of a one-pass signature packet - */ - write(): Uint8Array; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class List { - /** - * This class represents a list of openpgp packets. - * Take care when iterating over it - the packets themselves - * are stored as numerical indices. - */ - constructor(); - - /** - * The number of packets contained within the list. - */ - readonly length: Integer; - - /** - * Reads a stream of binary data and interprents it as a list of packets. - * @param A Uint8Array of bytes. - */ - read(A: Uint8Array | ReadableStream): void; - - /** - * Creates a binary representation of openpgp objects contained within the - * class instance. - * @returns A Uint8Array containing valid openpgp packets. - */ - write(): Uint8Array; - - /** - * Adds a packet to the list. This is the only supported method of doing so; - * writing to packetlist[i] directly will result in an error. - * @param packet Packet to push - */ - push(packet: object): void; - - /** - * Creates a new PacketList with all packets from the given types - */ - filterByTag(): void; - - /** - * Traverses packet tree and returns first matching packet - * @param type The packet type - * @returns - */ - findPacket(type: enums.packet): List | undefined; - - /** - * Returns array of found indices by tag - */ - indexOfTag(): void; - - /** - * Concatenates packetlist or array of packets - */ - concat(): void; - - /** - * Allocate a new packetlist from structured packetlist clone - * See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data} - * @param packetClone packetlist clone - * @returns new packetlist object with data from packetlist clone - */ - static fromStructuredClone(packetClone: object): object; - } - - class PublicKey { - /** - * Implementation of the Key Material Packet (Tag 5,6,7,14) - * {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}: - * A key material packet contains all the information about a public or - * private key. There are four variants of this packet type, and two - * major versions. - * A Public-Key packet starts a series of packets that forms an OpenPGP - * key (sometimes called an OpenPGP certificate). - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} - * called by read_tag<num> - * @param bytes Input array to read the packet from - * @returns This object with attributes set by the parser - */ - read(bytes: Uint8Array): object; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Same as write_private_key, but has less information because of - * public key. - * @returns OpenPGP packet body contents, - */ - write(): Uint8Array; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class PublicKeyEncryptedSessionKey { - /** - * Public-Key Encrypted Session Key Packets (Tag 1) - * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: - * A Public-Key Encrypted Session Key packet holds the session key - * used to encrypt a message. Zero or more Public-Key Encrypted Session Key - * packets and/or Symmetric-Key Encrypted Session Key packets may precede a - * Symmetrically Encrypted Data Packet, which holds an encrypted message. The - * message is encrypted with the session key, and the session key is itself - * encrypted and stored in the Encrypted Session Key packet(s). The - * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted - * Session Key packet for each OpenPGP key to which the message is encrypted. - * The recipient of the message finds a session key that is encrypted to their - * public key, decrypts the session key, and then uses the session key to - * decrypt the message. - */ - constructor(); - - encrypted: any[]; - - /** - * Parsing function for a publickey encrypted session key packet (tag 1). - * @param input Payload of a tag 1 packet - * @param position Position to start reading from the input string - * @param len Length of the packet or the remaining length of - * input at position - * @returns Object representation - */ - read(input: Uint8Array, position: Integer, len: Integer): PublicKeyEncryptedSessionKey - - /** - * Create a string representation of a tag 1 packet - * @returns The Uint8Array representation - */ - write(): Uint8Array; - - /** - * Encrypt session key packet - * @param key Public key - * @returns - */ - encrypt(key: PublicKey): Promise; - - /** - * Decrypts the session key (only for public key encrypted session key - * packets (tag 1) - * @param key Private key with secret params unlocked - * @returns - */ - decrypt(key: SecretKey): Promise; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class PublicSubkey { - /** - * A Public-Subkey packet (tag 14) has exactly the same format as a - * Public-Key packet, but denotes a subkey. One or more subkeys may be - * associated with a top-level key. By convention, the top-level key - * provides signature services, and the subkeys provide encryption - * services. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} - * called by read_tag<num> - * @param bytes Input array to read the packet from - * @returns This object with attributes set by the parser - */ - read(bytes: Uint8Array): object; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Same as write_private_key, but has less information because of - * public key. - * @returns OpenPGP packet body contents, - */ - write(): Uint8Array; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class SecretKey { - /** - * A Secret-Key packet contains all the information that is found in a - * Public-Key packet, including the public-key material, but also - * includes the secret-key material after all the public-key fields. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Encrypted secret-key data - */ - encrypted: any; - - /** - * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. - */ - isEncrypted: any; - - /** - * Internal parser for private keys as specified in - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} - * @param bytes Input string to read the packet from - */ - read(bytes: string): void; - - /** - * Creates an OpenPGP key packet for the given key. - * @returns A string of bytes containing the secret key OpenPGP packet - */ - write(): string; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Encrypt the payload. By default, we use aes256 and iterated, salted string - * to key specifier. If the key is in a decrypted state (isEncrypted === false) - * and the passphrase is empty or undefined, the key will be set as not encrypted. - * This can be used to remove passphrase protection after calling decrypt(). - * @param passphrase - * @returns - */ - encrypt(passphrase: string): Promise; - - /** - * Decrypts the private key params which are needed to use the key. - * {@link module:packet.SecretKey.isDecrypted} should be false, as - * otherwise calls to this function will throw an error. - * @param passphrase The passphrase for this private key as string - * @returns - */ - decrypt(passphrase: string): Promise; - - /** - * Clear private params, return to initial state - */ - clearPrivateParams(): void; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - } - - class SecretSubkey { - /** - * A Secret-Subkey packet (tag 7) is the subkey analog of the Secret - * Key packet and has exactly the same format. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Encrypted secret-key data - */ - encrypted: any; - - /** - * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. - */ - isEncrypted: any; - - /** - * Internal parser for private keys as specified in - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} - * @param bytes Input string to read the packet from - */ - read(bytes: string): void; - - /** - * Creates an OpenPGP key packet for the given key. - * @returns A string of bytes containing the secret key OpenPGP packet - */ - write(): string; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Encrypt the payload. By default, we use aes256 and iterated, salted string - * to key specifier. If the key is in a decrypted state (isEncrypted === false) - * and the passphrase is empty or undefined, the key will be set as not encrypted. - * This can be used to remove passphrase protection after calling decrypt(). - * @param passphrase - * @returns - */ - encrypt(passphrase: string): Promise; - - /** - * Decrypts the private key params which are needed to use the key. - * {@link module:packet.SecretKey.isDecrypted} should be false, as - * otherwise calls to this function will throw an error. - * @param passphrase The passphrase for this private key as string - * @returns - */ - decrypt(passphrase: string): Promise; - - /** - * Clear private params, return to initial state - */ - clearPrivateParams(): void; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - } - - class Signature { - /** - * Implementation of the Signature Packet (Tag 2) - * {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}: - * A Signature packet describes a binding between some public key and - * some data. The most common signatures are a signature of a file or a - * block of text, and a signature that is a certification of a User ID. - * @param date the creation date of the signature - */ - constructor(date: Date); - - /** - * parsing function for a signature packet (tag 2). - * @param bytes payload of a tag 2 packet - * @param position position to start reading from the bytes string - * @param len length of the packet or the remaining length of bytes at position - * @returns object representation - */ - read(bytes: string, position: Integer, len: Integer): Signature; - - /** - * Signs provided data. This needs to be done prior to serialization. - * @param key private key used to sign the message. - * @param data Contains packets to be signed. - * @returns - */ - sign(key: SecretKey, data: object): Promise; - - /** - * Creates Uint8Array of bytes of all subpacket data except Issuer and Embedded Signature subpackets - * @returns subpacket data - */ - write_hashed_sub_packets(): Uint8Array; - - /** - * Creates Uint8Array of bytes of Issuer and Embedded Signature subpackets - * @returns subpacket data - */ - write_unhashed_sub_packets(): Uint8Array; - - /** - * verifys the signature packet. Note: not signature types are implemented - * @param key the public key to verify the signature - * @param signatureType expected signature type - * @param data data which on the signature applies - * @returns True if message is verified, else false. - */ - verify(key: PublicSubkey | PublicKey | SecretSubkey | SecretKey, signatureType: enums.signature, data: string | object): Promise; - - /** - * Verifies signature expiration date - * @param date (optional) use the given date for verification instead of the current time - * @returns true if expired - */ - isExpired(date: Date): boolean; - - /** - * Returns the expiration time of the signature or Infinity if signature does not expire - * @returns expiration time - */ - getExpirationTime(): Date; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class SymEncryptedAEADProtected { - /** - * Implementation of the Symmetrically Encrypted Authenticated Encryption with - * Additional Data (AEAD) Protected Data Packet - * {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1}: - * AEAD Protected Data Packet - */ - constructor(); - - /** - * Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification) - * @param bytes - */ - read(bytes: Uint8Array | ReadableStream): void; - - /** - * Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification) - * @returns The encrypted payload - */ - write(): Uint8Array | ReadableStream; - - /** - * Decrypt the encrypted payload. - * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' - * @param key The session key used to encrypt the payload - * @param streaming Whether the top-level function will return a stream - * @returns - */ - decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): boolean; - - /** - * Encrypt the packet list payload. - * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' - * @param key The session key used to encrypt the payload - * @param streaming Whether the top-level function will return a stream - */ - encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): void; - - /** - * En/decrypt the payload. - * @param {encrypt | decrypt} fn Whether to encrypt or decrypt - * @param key The session key used to en/decrypt the payload - * @param data The data to en/decrypt - * @param streaming Whether the top-level function will return a stream - * @returns - */ - crypt(fn: any, key: Uint8Array, data: Uint8Array | ReadableStream, streaming: boolean): Uint8Array | ReadableStream; - } - - class SymEncryptedIntegrityProtected { - /** - * Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) - * {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}: - * The Symmetrically Encrypted Integrity Protected Data packet is - * a variant of the Symmetrically Encrypted Data packet. It is a new feature - * created for OpenPGP that addresses the problem of detecting a modification to - * encrypted data. It is used in combination with a Modification Detection Code - * packet. - */ - constructor(); - - /** - * The encrypted payload. - */ - encrypted: any; - - /** - * If after decrypting the packet this is set to true, - * a modification has been detected and thus the contents - * should be discarded. - */ - modification: boolean; - - /** - * Encrypt the payload in the packet. - * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' - * @param key The key of cipher blocksize length to be used - * @param streaming Whether to set this.encrypted to a stream - * @returns - */ - encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; - - /** - * Decrypts the encrypted data contained in the packet. - * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' - * @param key The key of cipher blocksize length to be used - * @param streaming Whether to read this.encrypted as a stream - * @returns - */ - decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; - } - - class SymEncryptedSessionKey { - /** - * Public-Key Encrypted Session Key Packets (Tag 1) - * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: - * A Public-Key Encrypted Session Key packet holds the session key - * used to encrypt a message. Zero or more Public-Key Encrypted Session Key - * packets and/or Symmetric-Key Encrypted Session Key packets may precede a - * Symmetrically Encrypted Data Packet, which holds an encrypted message. The - * message is encrypted with the session key, and the session key is itself - * encrypted and stored in the Encrypted Session Key packet(s). The - * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted - * Session Key packet for each OpenPGP key to which the message is encrypted. - * The recipient of the message finds a session key that is encrypted to their - * public key, decrypts the session key, and then uses the session key to - * decrypt the message. - */ - constructor(); - - /** - * Parsing function for a symmetric encrypted session key packet (tag 3). - * @param input Payload of a tag 1 packet - * @param position Position to start reading from the input string - * @param len Length of the packet or the remaining length of - * input at position - * @returns Object representation - */ - read(input: Uint8Array, position: Integer, len: Integer): SymEncryptedSessionKey; - - /** - * Decrypts the session key - * @param passphrase The passphrase in string form - * @returns - */ - decrypt(passphrase: string): Promise; - - /** - * Encrypts the session key - * @param passphrase The passphrase in string form - * @returns - */ - encrypt(passphrase: string): Promise; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class SymmetricallyEncrypted { - /** - * Implementation of the Symmetrically Encrypted Data Packet (Tag 9) - * {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: - * The Symmetrically Encrypted Data packet contains data encrypted with a - * symmetric-key algorithm. When it has been decrypted, it contains other - * packets (usually a literal data packet or compressed data packet, but in - * theory other Symmetrically Encrypted Data packets or sequences of packets - * that form whole OpenPGP messages). - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Encrypted secret-key data - */ - encrypted: any; - - /** - * Decrypted packets contained within. - */ - packets: List; - - /** - * When true, decrypt fails if message is not integrity protected - * @see module:config.ignore_mdc_error - */ - ignore_mdc_error: any; - - /** - * Decrypt the symmetrically-encrypted packet data - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param sessionKeyAlgorithm Symmetric key algorithm to use - * @param key The key of cipher blocksize length to be used - * @returns - */ - decrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; - - /** - * Encrypt the symmetrically-encrypted packet data - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param sessionKeyAlgorithm Symmetric key algorithm to use - * @param key The key of cipher blocksize length to be used - * @returns - */ - encrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; - } - - class Trust { - /** - * Implementation of the Trust Packet (Tag 12) - * {@link https://tools.ietf.org/html/rfc4880#section-5.10|RFC4880 5.10}: - * The Trust packet is used only within keyrings and is not normally - * exported. Trust packets contain data that record the user's - * specifications of which key holders are trustworthy introducers, - * along with other information that implementing software uses for - * trust information. The format of Trust packets is defined by a given - * implementation. - * Trust packets SHOULD NOT be emitted to output streams that are - * transferred to other users, and they SHOULD be ignored on any input - * other than local keyring files. - */ - constructor(); - - /** - * Parsing function for a trust packet (tag 12). - * Currently not implemented as we ignore trust packets - * @param byptes payload of a tag 12 packet - */ - read(byptes: string): void; - } - - class UserAttribute { - /** - * Implementation of the User Attribute Packet (Tag 17) - * The User Attribute packet is a variation of the User ID packet. It - * is capable of storing more types of data than the User ID packet, - * which is limited to text. Like the User ID packet, a User Attribute - * packet may be certified by the key owner ("self-signed") or any other - * key owner who cares to certify it. Except as noted, a User Attribute - * packet may be used anywhere that a User ID packet may be used. - * While User Attribute packets are not a required part of the OpenPGP - * standard, implementations SHOULD provide at least enough - * compatibility to properly handle a certification signature on the - * User Attribute packet. A simple way to do this is by treating the - * User Attribute packet as a User ID packet with opaque contents, but - * an implementation may use any method desired. - */ - constructor(); - - /** - * parsing function for a user attribute packet (tag 17). - * @param input payload of a tag 17 packet - */ - read(input: Uint8Array): void; - - /** - * Creates a binary representation of the user attribute packet - * @returns string representation - */ - write(): Uint8Array; - - /** - * Compare for equality - * @param usrAttr - * @returns true if equal - */ - equals(usrAttr: UserAttribute): boolean; - } - - class Userid { - /** - * Implementation of the User ID Packet (Tag 13) - * A User ID packet consists of UTF-8 text that is intended to represent - * the name and email address of the key holder. By convention, it - * includes an RFC 2822 [RFC2822] mail name-addr, but there are no - * restrictions on its content. The packet length in the header - * specifies the length of the User ID. - */ - constructor(); - - /** - * A string containing the user id. Usually in the form - * John Doe - */ - userid: string; - - /** - * Parsing function for a user id packet (tag 13). - * @param input payload of a tag 13 packet - */ - read(input: Uint8Array): void; - - /** - * Parse userid string, e.g. 'John Doe ' - */ - parse(): void; - - /** - * Creates a binary representation of the user id packet - * @returns binary representation - */ - write(): Uint8Array; - - /** - * Set userid string from object, e.g. { name:'Phil Zimmermann', email:'phil@openpgp.org' } - */ - format(): void; - } - - namespace all_packets { - /** - * @see module:packet.Compressed - */ - var Compressed: any; - - /** - * @see module:packet.SymEncryptedIntegrityProtected - */ - var SymEncryptedIntegrityProtected: any; - - /** - * @see module:packet.SymEncryptedAEADProtected - */ - var SymEncryptedAEADProtected: any; - - /** - * @see module:packet.PublicKeyEncryptedSessionKey - */ - var PublicKeyEncryptedSessionKey: any; - - /** - * @see module:packet.SymEncryptedSessionKey - */ - var SymEncryptedSessionKey: any; - - /** - * @see module:packet.Literal - */ - var Literal: any; - - /** - * @see module:packet.PublicKey - */ - var PublicKey: any; - - /** - * @see module:packet.SymmetricallyEncrypted - */ - var SymmetricallyEncrypted: any; - - /** - * @see module:packet.Marker - */ - var Marker: any; - - /** - * @see module:packet.PublicSubkey - */ - var PublicSubkey: any; - - /** - * @see module:packet.UserAttribute - */ - var UserAttribute: any; - - /** - * @see module:packet.OnePassSignature - */ - var OnePassSignature: any; - - /** - * @see module:packet.SecretKey - */ - var SecretKey: any; - - /** - * @see module:packet.Userid - */ - var Userid: any; - - /** - * @see module:packet.SecretSubkey - */ - var SecretSubkey: any; - - /** - * @see module:packet.Signature - */ - var Signature: any; - - /** - * @see module:packet.Trust - */ - var Trust: any; - } - - namespace clone { - /** - * Create a packetlist from the correspoding object types. - * @param options the object passed to and from the web worker - * @returns a mutated version of the options optject - */ - function clonePackets(options: object): object; - - /** - * Creates an object with the correct prototype from a corresponding packetlist. - * @param options the object passed to and from the web worker - * @param method the public api function name to be delegated to the worker - * @returns a mutated version of the options optject - */ - function parseClonedPackets(options: object, method: string): object; - } - - namespace packet { - /** - * Encodes a given integer of length to the openpgp length specifier to a - * string - * @param length The length to encode - * @returns String with openpgp length representation - */ - function writeSimpleLength(length: Integer): Uint8Array; - - /** - * Writes a packet header version 4 with the given tag_type and length to a - * string - * @param tag_type Tag type - * @param length Length of the payload - * @returns String of the header - */ - function writeHeader(tag_type: Integer, length: Integer): string; - - /** - * Writes a packet header Version 3 with the given tag_type and length to a - * string - * @param tag_type Tag type - * @param length Length of the payload - * @returns String of the header - */ - function writeOldHeader(tag_type: Integer, length: Integer): string; - - /** - * Whether the packet type supports partial lengths per RFC4880 - * @param tag_type Tag type - * @returns String of the header - */ - function supportsStreaming(tag_type: Integer): boolean; - - /** - * Generic static Packet Parser function - * @param input Input stream as string - * @param callback Function to call with the parsed packet - * @returns Returns false if the stream was empty and parsing is done, and true otherwise. - */ - function read(input: Uint8Array | ReadableStream, callback: Function): boolean; - } + function writeHeader(tag_type: Integer, length: Integer): string; + + /** + * Writes a packet header Version 3 with the given tag_type and length to a + * string + * @param tag_type Tag type + * @param length Length of the payload + * @returns String of the header + */ + function writeOldHeader(tag_type: Integer, length: Integer): string; + + /** + * Whether the packet type supports partial lengths per RFC4880 + * @param tag_type Tag type + * @returns String of the header + */ + function supportsStreaming(tag_type: Integer): boolean; + + /** + * Generic static Packet Parser function + * @param input Input stream as string + * @param callback Function to call with the parsed packet + * @returns Returns false if the stream was empty and parsing is done, and true otherwise. + */ + function read(input: Uint8Array | ReadableStream, callback: Function): boolean; } +} - namespace polyfills { - } +export namespace polyfills { +} - namespace signature { - /** - * Class that represents an OpenPGP signature. - */ - class Signature { - /** - * @param packetlist The signature packets - */ - constructor(packetlist: packet.List); - - /** - * Returns ASCII armored text of signature - * @returns ASCII armor - */ - armor(): ReadableStream; - } - - /** - * reads an OpenPGP armored signature and returns a signature object - * @param armoredText text to be parsed - * @returns new signature object - */ - function readArmored(armoredText: string | ReadableStream): Signature; - - /** - * reads an OpenPGP signature as byte array and returns a signature object - * @param input binary signature - * @returns new signature object - */ - function read(input: Uint8Array | ReadableStream): Signature; - } - - namespace type { - /** - * Encoded symmetric key for ECDH - */ - namespace ecdh_symkey { - class ECDHSymmetricKey { - constructor(); - - /** - * Read an ECDHSymmetricKey from an Uint8Array - * @param input Where to read the encoded symmetric key from - * @returns Number of read bytes - */ - read(input: Uint8Array): number; - - /** - * Write an ECDHSymmetricKey as an Uint8Array - * @returns An array containing the value - */ - write(): Uint8Array; - } - } - - /** - * Implementation of type KDF parameters - * {@link https://tools.ietf.org/html/rfc6637#section-7|RFC 6637 7}: - * A key derivation function (KDF) is necessary to implement the EC - * encryption. The Concatenation Key Derivation Function (Approved - * Alternative 1) [NIST-SP800-56A] with the KDF hash function that is - * SHA2-256 [FIPS-180-3] or stronger is REQUIRED. - */ - namespace kdf_params { - class KDFParams { - /** - * @param hash Hash algorithm - * @param cipher Symmetric algorithm - */ - constructor(hash: enums.hash, cipher: enums.symmetric); - - /** - * Read KDFParams from an Uint8Array - * @param input Where to read the KDFParams from - * @returns Number of read bytes - */ - read(input: Uint8Array): number; - - /** - * Write KDFParams to an Uint8Array - * @returns Array with the KDFParams value - */ - write(): Uint8Array; - } - } - - /** - * Implementation of type key id - * {@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3}: - * A Key ID is an eight-octet scalar that identifies a key. - * Implementations SHOULD NOT assume that Key IDs are unique. The - * section "Enhanced Key Formats" below describes how Key IDs are - * formed. - */ - namespace keyid { - class Keyid { - constructor(); - - /** - * Parsing method for a key id - * @param input Input to read the key id from - */ - read(input: Uint8Array): void; - - /** - * Checks equality of Key ID's - * @param keyid - * @param matchWildcard Indicates whether to check if either keyid is a wildcard - */ - equals(keyid: Keyid, matchWildcard: boolean): void; - } - } - - /** - * Implementation of type MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}) - * Multiprecision integers (also called MPIs) are unsigned integers used - * to hold large integers such as the ones used in cryptographic - * calculations. - * An MPI consists of two pieces: a two-octet scalar that is the length - * of the MPI in bits followed by a string of octets that contain the - * actual integer. - */ - namespace mpi { - class MPI { - constructor(); - - /** - * Parsing function for a MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC 4880 3.2}). - * @param input Payload of MPI data - * @param endian Endianness of the data; 'be' for big-endian or 'le' for little-endian - * @returns Length of data read - */ - read(input: Uint8Array, endian: string): Integer; - - /** - * Converts the mpi object to a bytes as specified in - * {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2} - * @param endian Endianness of the payload; 'be' for big-endian or 'le' for little-endian - * @param length Length of the data part of the MPI - * @returns mpi Byte representation - */ - write(endian: string, length: Integer): Uint8Array; - } - } - - /** - * Wrapper to an OID value - * {@link https://tools.ietf.org/html/rfc6637#section-11|RFC6637, section 11}: - * The sequence of octets in the third column is the result of applying - * the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier - * with subsequent truncation. The truncation removes the two fields of - * encoded Object Identifier. The first omitted field is one octet - * representing the Object Identifier tag, and the second omitted field - * is the length of the Object Identifier body. For example, the - * complete ASN.1 DER encoding for the NIST P-256 curve OID is "06 08 2A - * 86 48 CE 3D 03 01 07", from which the first entry in the table above - * is constructed by omitting the first two octets. Only the truncated - * sequence of octets is the valid representation of a curve OID. - */ - namespace oid { - class OID { - constructor(); - - /** - * Method to read an OID object - * @param input Where to read the OID from - * @returns Number of read bytes - */ - read(input: Uint8Array): number; - - /** - * Serialize an OID object - * @returns Array with the serialized value the OID - */ - write(): Uint8Array; - - /** - * Serialize an OID object as a hex string - * @returns String with the hex value of the OID - */ - toHex(): string; - - /** - * If a known curve object identifier, return the canonical name of the curve - * @returns String with the canonical name of the curve - */ - getName(): string; - } - } - - /** - * Implementation of the String-to-key specifier - * {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7}: - * String-to-key (S2K) specifiers are used to convert passphrase strings - * into symmetric-key encryption/decryption keys. They are used in two - * places, currently: to encrypt the secret part of private keys in the - * private keyring, and to convert passphrases to encryption keys for - * symmetrically encrypted messages. +export namespace signature { + /** + * Class that represents an OpenPGP signature. */ - namespace s2k { - class S2K { - constructor(); + class Signature { + /** + * @param packetlist The signature packets + */ + constructor(packetlist: packet.List); - algorithm: enums.hash; + /** + * Returns ASCII armored text of signature + * @returns ASCII armor + */ + armor(): ReadableStream; + } - type: enums.s2k; + /** + * reads an OpenPGP armored signature and returns a signature object + * @param armoredText text to be parsed + * @returns new signature object + */ + function readArmored(armoredText: string | ReadableStream): Signature; - c: Integer; + /** + * reads an OpenPGP signature as byte array and returns a signature object + * @param input binary signature + * @returns new signature object + */ + function read(input: Uint8Array | ReadableStream): Signature; +} - /** - * Eight bytes of salt in a binary string. - */ - salt: string; +export namespace type { + /** + * Encoded symmetric key for ECDH + */ + namespace ecdh_symkey { + class ECDHSymmetricKey { + constructor(); - /** - * Parsing function for a string-to-key specifier ( {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}). - * @param input Payload of string-to-key specifier - * @returns Actual length of the object - */ - read(input: string): Integer; + /** + * Read an ECDHSymmetricKey from an Uint8Array + * @param input Where to read the encoded symmetric key from + * @returns Number of read bytes + */ + read(input: Uint8Array): number; - /** - * Serializes s2k information - * @returns binary representation of s2k - */ - write(): Uint8Array; - - /** - * Produces a key using the specified passphrase and the defined - * hashAlgorithm - * @param passphrase Passphrase containing user input - * @returns Produced key with a length corresponding to - * hashAlgorithm hash length - */ - produce_key(passphrase: string): Uint8Array; - } + /** + * Write an ECDHSymmetricKey as an Uint8Array + * @returns An array containing the value + */ + write(): Uint8Array; } } /** - * This object contains utility functions + * Implementation of type KDF parameters + * {@link https://tools.ietf.org/html/rfc6637#section-7|RFC 6637 7}: + * A key derivation function (KDF) is necessary to implement the EC + * encryption. The Concatenation Key Derivation Function (Approved + * Alternative 1) [NIST-SP800-56A] with the KDF hash function that is + * SHA2-256 [FIPS-180-3] or stronger is REQUIRED. */ - namespace util { - /** - * Get transferable objects to pass buffers with zero copy (similar to "pass by reference" in C++) - * See: https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage - * Also, convert ReadableStreams to MessagePorts - * @param obj the options object to be passed to the web worker - * @returns an array of binary data to be passed - */ - function getTransferables(obj: object): any[]; + namespace kdf_params { + class KDFParams { + /** + * @param hash Hash algorithm + * @param cipher Symmetric algorithm + */ + constructor(hash: enums.hash, cipher: enums.symmetric); - /** - * Convert MessagePorts back to ReadableStreams - * @param obj - * @returns - */ - function restoreStreams(obj: object): object; + /** + * Read KDFParams from an Uint8Array + * @param input Where to read the KDFParams from + * @returns Number of read bytes + */ + read(input: Uint8Array): number; - /** - * Create hex string from a binary - * @param str String to convert - * @returns String containing the hexadecimal values - */ - function str_to_hex(str: string): string; - - /** - * Create binary string from a hex encoded string - * @param str Hex string to convert - * @returns - */ - function hex_to_str(str: string): string; - - /** - * Convert a Uint8Array to an MPI-formatted Uint8Array. - * Note: the output is **not** an MPI object. - * @see - * @see - * @param bin An array of 8-bit integers to convert - * @returns MPI-formatted Uint8Array - */ - function Uint8Array_to_MPI(bin: Uint8Array): Uint8Array; - - /** - * Convert a Base-64 encoded string an array of 8-bit integer - * Note: accepts both Radix-64 and URL-safe strings - * @param base64 Base-64 encoded string to convert - * @returns An array of 8-bit integers - */ - function b64_to_Uint8Array(base64: string): Uint8Array; - - /** - * Convert an array of 8-bit integer to a Base-64 encoded string - * @param bytes An array of 8-bit integers to convert - * @param url If true, output is URL-safe - * @returns Base-64 encoded string - */ - function Uint8Array_to_b64(bytes: Uint8Array, url: boolean): string; - - /** - * Convert a hex string to an array of 8-bit integers - * @param hex A hex string to convert - * @returns An array of 8-bit integers - */ - function hex_to_Uint8Array(hex: string): Uint8Array; - - /** - * Convert an array of 8-bit integers to a hex string - * @param bytes Array of 8-bit integers to convert - * @returns Hexadecimal representation of the array - */ - function Uint8Array_to_hex(bytes: Uint8Array): string; - - /** - * Convert a string to an array of 8-bit integers - * @param str String to convert - * @returns An array of 8-bit integers - */ - function str_to_Uint8Array(str: string): Uint8Array; - - /** - * Convert an array of 8-bit integers to a string - * @param bytes An array of 8-bit integers to convert - * @returns String representation of the array - */ - function Uint8Array_to_str(bytes: Uint8Array): string; - - /** - * Convert a native javascript string to a Uint8Array of utf8 bytes - * @param str The string to convert - * @returns A valid squence of utf8 bytes - */ - function encode_utf8(str: string | ReadableStream): Uint8Array | ReadableStream; - - /** - * Convert a Uint8Array of utf8 bytes to a native javascript string - * @param utf8 A valid squence of utf8 bytes - * @returns A native javascript string - */ - function decode_utf8(utf8: Uint8Array | ReadableStream): string | ReadableStream; - - /** - * Concat a list of Uint8Arrays, Strings or Streams - * The caller must not mix Uint8Arrays with Strings, but may mix Streams with non-Streams. - * @param Array of Uint8Arrays/Strings/Streams to concatenate - * @returns Concatenated array - */ - var concat: any; - - /** - * Concat Uint8Arrays - * @param Array of Uint8Arrays to concatenate - * @returns Concatenated array - */ - var concatUint8Array: any; - - /** - * Check Uint8Array equality - * @param first array - * @param second array - * @returns equality - */ - function equalsUint8Array(first: Uint8Array, second: Uint8Array): boolean; - - /** - * Calculates a 16bit sum of a Uint8Array by adding each character - * codes modulus 65535 - * @param Uint8Array to create a sum of - * @returns 2 bytes containing the sum of all charcodes % 65535 - */ - function write_checksum(Uint8Array: Uint8Array): Uint8Array; - - /** - * Helper function to print a debug message. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug(str: string): void; - - /** - * Helper function to print a debug message. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug_hexarray_dump(str: string): void; - - /** - * Helper function to print a debug message. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug_hexstr_dump(str: string): void; - - /** - * Helper function to print a debug error. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug_error(str: string): void; - - /** - * Read a stream to the end and print it to the console when it's closed. - * @param str String of the debug message - * @param input Stream to print - * @param concat Function to concatenate chunks of the stream (defaults to util.concat). - */ - function print_entire_stream(str: string, input: ReadableStream | Uint8Array | string, concat: Function): void; - - /** - * If S[1] == 0, then double(S) == (S[2..128] || 0); - * otherwise, double(S) == (S[2..128] || 0) xor - * (zeros(120) || 10000111). - * Both OCB and EAX (through CMAC) require this function to be constant-time. - * @param data - */ - /* Illegal function name 'double' can't be used here - function double(data: Uint8Array): void; - */ - - /** - * Shift a Uint8Array to the right by n bits - * @param array The array to shift - * @param bits Amount of bits to shift (MUST be smaller - * than 8) - * @returns Resulting array. - */ - function shiftRight(array: Uint8Array, bits: Integer): string; - - /** - * Get native Web Cryptography api, only the current version of the spec. - * The default configuration is to use the api when available. But it can - * be deactivated with config.use_native - * @returns The SubtleCrypto api or 'undefined' - */ - function getWebCrypto(): object; - - /** - * Get native Web Cryptography api for all browsers, including legacy - * implementations of the spec e.g IE11 and Safari 8/9. The default - * configuration is to use the api when available. But it can be deactivated - * with config.use_native - * @returns The SubtleCrypto api or 'undefined' - */ - function getWebCryptoAll(): object; - - /** - * Detect Node.js runtime. - */ - function detectNode(): void; - - /** - * Get native Node.js module - * @param The module to require - * @returns The required module or 'undefined' - */ - function nodeRequire(The: string): object; - - /** - * Get native Node.js crypto api. The default configuration is to use - * the api when available. But it can also be deactivated with config.use_native - * @returns The crypto module or 'undefined' - */ - function getNodeCrypto(): object; - - /** - * Get native Node.js Buffer constructor. This should be used since - * Buffer is not available under browserify. - * @returns The Buffer constructor or 'undefined' - */ - function getNodeBuffer(): Function; - - /** - * Format user id for internal use. - */ - function formatUserId(): void; - - /** - * Parse user id. - */ - function parseUserId(): void; - - /** - * Normalize line endings to \r\n - */ - function canonicalizeEOL(): void; - - /** - * Convert line endings from canonicalized \r\n to native \n - */ - function nativeEOL(): void; - - /** - * Remove trailing spaces and tabs from each line - */ - function removeTrailingSpaces(): void; - - /** - * Encode input buffer using Z-Base32 encoding. - * See: https://tools.ietf.org/html/rfc6189#section-5.1.6 - * @param data The binary data to encode - * @returns Binary data encoded using Z-Base32 - */ - function encodeZBase32(data: Uint8Array): string; + /** + * Write KDFParams to an Uint8Array + * @returns Array with the KDFParams value + */ + write(): Uint8Array; + } } - namespace wkd { - class WKD { - /** - * Initialize the WKD client - */ + /** + * Implementation of type key id + * {@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3}: + * A Key ID is an eight-octet scalar that identifies a key. + * Implementations SHOULD NOT assume that Key IDs are unique. The + * section "Enhanced Key Formats" below describes how Key IDs are + * formed. + */ + namespace keyid { + class Keyid { constructor(); /** - * Search for a public key using Web Key Directory protocol. - * @param options.email User's email. - * @param options.rawBytes Returns Uint8Array instead of parsed key. - * @returns The public key. + * Parsing method for a key id + * @param input Input to read the key id from */ - lookup(): Promise, err: Array | null }>; + read(input: Uint8Array): void; + + /** + * Checks equality of Key ID's + * @param keyid + * @param matchWildcard Indicates whether to check if either keyid is a wildcard + */ + equals(keyid: Keyid, matchWildcard: boolean): void; } } - namespace worker { - /** - * @see module:openpgp.initWorker - * @see module:openpgp.getWorker - * @see module:openpgp.destroyWorker - * @see module:worker/worker + /** + * Implementation of type MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}) + * Multiprecision integers (also called MPIs) are unsigned integers used + * to hold large integers such as the ones used in cryptographic + * calculations. + * An MPI consists of two pieces: a two-octet scalar that is the length + * of the MPI in bits followed by a string of octets that contain the + * actual integer. */ - namespace async_proxy { - class AsyncProxy { - /** - * Initializes a new proxy and loads the web worker - * @param path The path to the worker or 'openpgp.worker.js' by default - * @param n number of workers to initialize if path given - * @param config config The worker configuration - * @param worker alternative to path parameter: web worker initialized with 'openpgp.worker.js' - */ - constructor(path: string, n: number, config: object, worker: any[]); + namespace mpi { + class MPI { + constructor(); - /** - * Message handling - */ - handleMessage(): void; + /** + * Parsing function for a MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC 4880 3.2}). + * @param input Payload of MPI data + * @param endian Endianness of the data; 'be' for big-endian or 'le' for little-endian + * @returns Length of data read + */ + read(input: Uint8Array, endian: string): Integer; - /** - * Get new request ID - * @returns New unique request ID - */ - getID(): Integer; - - /** - * Send message to worker with random data - * @param size Number of bytes to send - */ - seedRandom(size: Integer): void; - - /** - * Terminates the workers - */ - terminate(): void; - - /** - * Generic proxy function that handles all commands from the public api. - * @param method the public api function to be delegated to the worker thread - * @param options the api function's options - * @returns see the corresponding public api functions for their return types - */ - delegate(method: string, options: object): Promise; - } + /** + * Converts the mpi object to a bytes as specified in + * {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2} + * @param endian Endianness of the payload; 'be' for big-endian or 'le' for little-endian + * @param length Length of the data part of the MPI + * @returns mpi Byte representation + */ + write(endian: string, length: Integer): Uint8Array; } + } + + /** + * Wrapper to an OID value + * {@link https://tools.ietf.org/html/rfc6637#section-11|RFC6637, section 11}: + * The sequence of octets in the third column is the result of applying + * the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier + * with subsequent truncation. The truncation removes the two fields of + * encoded Object Identifier. The first omitted field is one octet + * representing the Object Identifier tag, and the second omitted field + * is the length of the Object Identifier body. For example, the + * complete ASN.1 DER encoding for the NIST P-256 curve OID is "06 08 2A + * 86 48 CE 3D 03 01 07", from which the first entry in the table above + * is constructed by omitting the first two octets. Only the truncated + * sequence of octets is the valid representation of a curve OID. + */ + namespace oid { + class OID { + constructor(); + + /** + * Method to read an OID object + * @param input Where to read the OID from + * @returns Number of read bytes + */ + read(input: Uint8Array): number; + + /** + * Serialize an OID object + * @returns Array with the serialized value the OID + */ + write(): Uint8Array; + + /** + * Serialize an OID object as a hex string + * @returns String with the hex value of the OID + */ + toHex(): string; + + /** + * If a known curve object identifier, return the canonical name of the curve + * @returns String with the canonical name of the curve + */ + getName(): string; + } + } + + /** + * Implementation of the String-to-key specifier + * {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7}: + * String-to-key (S2K) specifiers are used to convert passphrase strings + * into symmetric-key encryption/decryption keys. They are used in two + * places, currently: to encrypt the secret part of private keys in the + * private keyring, and to convert passphrases to encryption keys for + * symmetrically encrypted messages. + */ + namespace s2k { + class S2K { + constructor(); + + algorithm: enums.hash; + + type: enums.s2k; + + c: Integer; + + /** + * Eight bytes of salt in a binary string. + */ + salt: string; + + /** + * Parsing function for a string-to-key specifier ( {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}). + * @param input Payload of string-to-key specifier + * @returns Actual length of the object + */ + read(input: string): Integer; + + /** + * Serializes s2k information + * @returns binary representation of s2k + */ + write(): Uint8Array; + + /** + * Produces a key using the specified passphrase and the defined + * hashAlgorithm + * @param passphrase Passphrase containing user input + * @returns Produced key with a length corresponding to + * hashAlgorithm hash length + */ + produce_key(passphrase: string): Uint8Array; + } + } +} + +/** + * This object contains utility functions + */ +export namespace util { + /** + * Get transferable objects to pass buffers with zero copy (similar to "pass by reference" in C++) + * See: https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage + * Also, convert ReadableStreams to MessagePorts + * @param obj the options object to be passed to the web worker + * @returns an array of binary data to be passed + */ + function getTransferables(obj: object): any[]; + + /** + * Convert MessagePorts back to ReadableStreams + * @param obj + * @returns + */ + function restoreStreams(obj: object): object; + + /** + * Create hex string from a binary + * @param str String to convert + * @returns String containing the hexadecimal values + */ + function str_to_hex(str: string): string; + + /** + * Create binary string from a hex encoded string + * @param str Hex string to convert + * @returns + */ + function hex_to_str(str: string): string; + + /** + * Convert a Uint8Array to an MPI-formatted Uint8Array. + * Note: the output is **not** an MPI object. + * @see + * @see + * @param bin An array of 8-bit integers to convert + * @returns MPI-formatted Uint8Array + */ + function Uint8Array_to_MPI(bin: Uint8Array): Uint8Array; + + /** + * Convert a Base-64 encoded string an array of 8-bit integer + * Note: accepts both Radix-64 and URL-safe strings + * @param base64 Base-64 encoded string to convert + * @returns An array of 8-bit integers + */ + function b64_to_Uint8Array(base64: string): Uint8Array; + + /** + * Convert an array of 8-bit integer to a Base-64 encoded string + * @param bytes An array of 8-bit integers to convert + * @param url If true, output is URL-safe + * @returns Base-64 encoded string + */ + function Uint8Array_to_b64(bytes: Uint8Array, url: boolean): string; + + /** + * Convert a hex string to an array of 8-bit integers + * @param hex A hex string to convert + * @returns An array of 8-bit integers + */ + function hex_to_Uint8Array(hex: string): Uint8Array; + + /** + * Convert an array of 8-bit integers to a hex string + * @param bytes Array of 8-bit integers to convert + * @returns Hexadecimal representation of the array + */ + function Uint8Array_to_hex(bytes: Uint8Array): string; + + /** + * Convert a string to an array of 8-bit integers + * @param str String to convert + * @returns An array of 8-bit integers + */ + function str_to_Uint8Array(str: string): Uint8Array; + + /** + * Convert an array of 8-bit integers to a string + * @param bytes An array of 8-bit integers to convert + * @returns String representation of the array + */ + function Uint8Array_to_str(bytes: Uint8Array): string; + + /** + * Convert a native javascript string to a Uint8Array of utf8 bytes + * @param str The string to convert + * @returns A valid squence of utf8 bytes + */ + function encode_utf8(str: string | ReadableStream): Uint8Array | ReadableStream; + + /** + * Convert a Uint8Array of utf8 bytes to a native javascript string + * @param utf8 A valid squence of utf8 bytes + * @returns A native javascript string + */ + function decode_utf8(utf8: Uint8Array | ReadableStream): string | ReadableStream; + + /** + * Concat a list of Uint8Arrays, Strings or Streams + * The caller must not mix Uint8Arrays with Strings, but may mix Streams with non-Streams. + * @param Array of Uint8Arrays/Strings/Streams to concatenate + * @returns Concatenated array + */ + var concat: any; + + /** + * Concat Uint8Arrays + * @param Array of Uint8Arrays to concatenate + * @returns Concatenated array + */ + var concatUint8Array: any; + + /** + * Check Uint8Array equality + * @param first array + * @param second array + * @returns equality + */ + function equalsUint8Array(first: Uint8Array, second: Uint8Array): boolean; + + /** + * Calculates a 16bit sum of a Uint8Array by adding each character + * codes modulus 65535 + * @param Uint8Array to create a sum of + * @returns 2 bytes containing the sum of all charcodes % 65535 + */ + function write_checksum(Uint8Array: Uint8Array): Uint8Array; + + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug(str: string): void; + + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug_hexarray_dump(str: string): void; + + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug_hexstr_dump(str: string): void; + + /** + * Helper function to print a debug error. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug_error(str: string): void; + + /** + * Read a stream to the end and print it to the console when it's closed. + * @param str String of the debug message + * @param input Stream to print + * @param concat Function to concatenate chunks of the stream (defaults to util.concat). + */ + function print_entire_stream(str: string, input: ReadableStream | Uint8Array | string, concat: Function): void; + + /** + * If S[1] == 0, then double(S) == (S[2..128] || 0); + * otherwise, double(S) == (S[2..128] || 0) xor + * (zeros(120) || 10000111). + * Both OCB and EAX (through CMAC) require this function to be constant-time. + * @param data + */ + /* Illegal function name 'double' can't be used here + function double(data: Uint8Array): void; + */ + + /** + * Shift a Uint8Array to the right by n bits + * @param array The array to shift + * @param bits Amount of bits to shift (MUST be smaller + * than 8) + * @returns Resulting array. + */ + function shiftRight(array: Uint8Array, bits: Integer): string; + + /** + * Get native Web Cryptography api, only the current version of the spec. + * The default configuration is to use the api when available. But it can + * be deactivated with config.use_native + * @returns The SubtleCrypto api or 'undefined' + */ + function getWebCrypto(): object; + + /** + * Get native Web Cryptography api for all browsers, including legacy + * implementations of the spec e.g IE11 and Safari 8/9. The default + * configuration is to use the api when available. But it can be deactivated + * with config.use_native + * @returns The SubtleCrypto api or 'undefined' + */ + function getWebCryptoAll(): object; + + /** + * Detect Node.js runtime. + */ + function detectNode(): void; + + /** + * Get native Node.js module + * @param The module to require + * @returns The required module or 'undefined' + */ + function nodeRequire(The: string): object; + + /** + * Get native Node.js crypto api. The default configuration is to use + * the api when available. But it can also be deactivated with config.use_native + * @returns The crypto module or 'undefined' + */ + function getNodeCrypto(): object; + + /** + * Get native Node.js Buffer constructor. This should be used since + * Buffer is not available under browserify. + * @returns The Buffer constructor or 'undefined' + */ + function getNodeBuffer(): Function; + + /** + * Format user id for internal use. + */ + function formatUserId(): void; + + /** + * Parse user id. + */ + function parseUserId(): void; + + /** + * Normalize line endings to \r\n + */ + function canonicalizeEOL(): void; + + /** + * Convert line endings from canonicalized \r\n to native \n + */ + function nativeEOL(): void; + + /** + * Remove trailing spaces and tabs from each line + */ + function removeTrailingSpaces(): void; + + /** + * Encode input buffer using Z-Base32 encoding. + * See: https://tools.ietf.org/html/rfc6189#section-5.1.6 + * @param data The binary data to encode + * @returns Binary data encoded using Z-Base32 + */ + function encodeZBase32(data: Uint8Array): string; +} + +export namespace wkd { + class WKD { + /** + * Initialize the WKD client + */ + constructor(); /** - * @see module:openpgp.initWorker - * @see module:openpgp.getWorker - * @see module:openpgp.destroyWorker - * @see module:worker/async_proxy - */ - namespace worker { + * Search for a public key using Web Key Directory protocol. + * @param options.email User's email. + * @param options.rawBytes Returns Uint8Array instead of parsed key. + * @returns The public key. + */ + lookup(): Promise, err: Array | null }>; + } +} + +export namespace worker { + /** + * @see module:openpgp.initWorker + * @see module:openpgp.getWorker + * @see module:openpgp.destroyWorker + * @see module:worker/worker + */ + namespace async_proxy { + class AsyncProxy { /** - * Handle random buffer exhaustion by requesting more random bytes from the main window - * @returns Empty Promise whose resolution indicates that the buffer has been refilled + * Initializes a new proxy and loads the web worker + * @param path The path to the worker or 'openpgp.worker.js' by default + * @param n number of workers to initialize if path given + * @param config config The worker configuration + * @param worker alternative to path parameter: web worker initialized with 'openpgp.worker.js' */ - function randomCallback(): Promise; + constructor(path: string, n: number, config: object, worker: any[]); /** - * Set config from main context to worker context. - * @param config The openpgp configuration + * Message handling */ - function configure(config: object): void; + handleMessage(): void; /** - * Seed the library with entropy gathered window.crypto.getRandomValues - * as this api is only avalible in the main window. - * @param buffer Some random bytes + * Get new request ID + * @returns New unique request ID */ - function seedRandom(buffer: any[]): void; + getID(): Integer; + + /** + * Send message to worker with random data + * @param size Number of bytes to send + */ + seedRandom(size: Integer): void; + + /** + * Terminates the workers + */ + terminate(): void; /** * Generic proxy function that handles all commands from the public api. - * @param method The public api function to be delegated to the worker thread - * @param options The api function's options + * @param method the public api function to be delegated to the worker thread + * @param options the api function's options + * @returns see the corresponding public api functions for their return types */ - function delegate(method: string, options: object): void; - - /** - * Respond to the main window. - * @param event Contains event type and data - */ - function response(event: object): void; + delegate(method: string, options: object): Promise; } } - /** - * Set the path for the web worker script and create an instance of the async proxy - * @param path relative path to the worker scripts, default: 'openpgp.worker.js' - * @param n number of workers to initialize - * @param workers alternative to path parameter: web workers initialized with 'openpgp.worker.js' - */ - function initWorker(path: string, n?: number, workers?: any[]): void; + * @see module:openpgp.initWorker + * @see module:openpgp.getWorker + * @see module:openpgp.destroyWorker + * @see module:worker/async_proxy + */ + namespace worker { + /** + * Handle random buffer exhaustion by requesting more random bytes from the main window + * @returns Empty Promise whose resolution indicates that the buffer has been refilled + */ + function randomCallback(): Promise; - /** - * Returns a reference to the async proxy if the worker was initialized with openpgp.initWorker() - * @returns the async proxy or null if not initialized - */ - function getWorker(): worker.async_proxy.AsyncProxy | null; + /** + * Set config from main context to worker context. + * @param config The openpgp configuration + */ + function configure(config: object): void; - /** - * Cleanup the current instance of the web worker. - */ - function destroyWorker(): void; + /** + * Seed the library with entropy gathered window.crypto.getRandomValues + * as this api is only avalible in the main window. + * @param buffer Some random bytes + */ + function seedRandom(buffer: any[]): void; - interface UserID { - name: string; - email: string; + /** + * Generic proxy function that handles all commands from the public api. + * @param method The public api function to be delegated to the worker thread + * @param options The api function's options + */ + function delegate(method: string, options: object): void; + + /** + * Respond to the main window. + * @param event Contains event type and data + */ + function response(event: object): void; } - - interface KeyOptions { - /** - * array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] - */ - userIds: UserID[]; - /** - * (optional) The passphrase used to encrypt the resulting private key - */ - passphrase?: string; - /** - * (optional) number of bits for RSA keys: 2048 or 4096. - */ - numBits?: number; - /** - * (optional) The number of seconds after the key creation time that the key expires - */ - keyExpirationTime?: number; - /** - * (optional) elliptic curve for ECC keys: elliptic curve for ECC keys: - * curve25519, p256, p384, p521, secp256k1, - * brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1. - */ - curve?: string; - /** - * (optional) override the creation date of the key and the key signatures - */ - date?: Date; - /** - * (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] - * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt - */ - subkeys?: { sign: true, passphrase: "string" }[]; - } - - /** - * Generates a new OpenPGP key pair. Supports RSA and ECC keys. Primary and subkey will be of same type. - * @param options - * @returns The generated key object in the form: - * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } - */ - function generateKey(option: KeyOptions): Promise<{ key: key.Key, privateKeyArmored: string, publicKeyArmored: string, revocationCertificate: string }>; - - /** - * Reformats signature packets for a key and rewraps key object. - * @param privateKey private key to reformat - * @param userIds array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] - * @param passphrase (optional) The passphrase used to encrypt the resulting private key - * @param keyExpirationTime (optional) The number of seconds after the key creation time that the key expires - * @param revocationCertificate (optional) Whether the returned object should include a revocation certificate to revoke the public key - * @returns The generated key object in the form: - * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } - */ - function reformatKey(privateKey: key.Key, userIds: any[], passphrase?: string, keyExpirationTime?: number, revocationCertificate?: boolean): Promise; - - /** - * Revokes a key. Requires either a private key or a revocation certificate. - * If a revocation certificate is passed, the reasonForRevocation parameters will be ignored. - * @param key (optional) public or private key to revoke - * @param revocationCertificate (optional) revocation certificate to revoke the key with - * @param reasonForRevocation (optional) object indicating the reason for revocation - * @param reasonForRevocation.flag (optional) flag indicating the reason for revocation - * @param reasonForRevocation.string (optional) string explaining the reason for revocation - * @returns The revoked key object in the form: - * { privateKey:Key, privateKeyArmored:String, publicKey:Key, publicKeyArmored:String } - * (if private key is passed) or { publicKey:Key, publicKeyArmored:String } (otherwise) - */ - function revokeKey(key?: key.Key, revocationCertificate?: string, reasonForRevocation?: revokeKey_reasonForRevocation): Promise<{ - privateKey: key.Key, - privateKeyArmored: string, - publicKey: key.Key, - publicKeyArmored: string - } | { - publicKey: key.Key, - publicKeyArmored: string - }>; - - /** - * Unlock a private key with your passphrase. - * @param privateKey the private key that is to be decrypted - * @param passphrase the user's passphrase(s) chosen during key generation - * @returns the unlocked key object in the form: { key:Key } - */ - function decryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; - - /** - * Lock a private key with your passphrase. - * @param privateKey the private key that is to be decrypted - * @param passphrase the user's passphrase(s) chosen during key generation - * @returns the locked key object in the form: { key:Key } - */ - function encryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; - - interface EncryptOptions { - /** - * message to be encrypted as created by openpgp.message.fromText or openpgp.message.fromBinary - */ - message: message.Message; - /** - * (optional) array of keys or single key, used to encrypt the message - */ - publicKeys?: key.Key | any[]; - /** - * (optional) private keys for signing. If omitted message will not be signed - */ - privateKeys?: key.Key | any[]; - /** - * (optional) array of passwords or a single password to encrypt the message - */ - passwords?: string | any[]; - /** - * (optional) session key in the form: { data:Uint8Array, algorithm:String } - */ - sessionKey?: { data: Uint8Array, algorithm: string }; - /** - * (optional) which compression algorithm to compress the message with, defaults to what is specified in config - */ - compression?: enums.compression; - /** - * (optional) if the return values should be ascii armored or the message/signature objects - */ - armor?: boolean; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) if the signature should be detached (if true, signature will be added to returned object) - */ - detached?: boolean; - /** - * (optional) a detached signature to add to the encrypted message - */ - signature?: signature.Signature; - /** - * (optional) if the unencrypted session key should be added to returned object - */ - returnSessionKey?: boolean; - /** - * (optional) use a key ID of 0 instead of the public key IDs - */ - wildcard?: boolean; - /** - * (optional) override the creation date of the message signature - */ - date?: Date; - /** - * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - */ - fromUserIds?: UserID[]; - /** - * (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] - */ - toUserIds?: UserID[] - } - - interface EncryptResult { - data: string | ReadableStream; - message: message.Message; - signature: string | ReadableStream | signature.Signature; - sessionKey: { data: Uint8Array, algorithm: string, aeadAlgorithm: string }; - } - - /** - * Encrypts message text/data with public keys, passwords or both at once. At least either public keys or passwords - * must be specified. If private keys are specified, those will be used to sign the message. - * @param options - * @returns Object containing encrypted (and optionally signed) message in the form: - * { - * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) - * message: Message, (if `armor` was false) - * signature: string|ReadableStream|NodeStream, (if `detached` was true and `armor` was true) - * signature: Signature (if `detached` was true and `armor` was false) - * sessionKey: { data, algorithm, aeadAlgorithm } (if `returnSessionKey` was true) - * } - */ - function encrypt(options: EncryptOptions): Promise; - - interface DecryptOptions { - /** - * the message object with the encrypted data - */ - message: message.Message; - /** - * (optional) private keys with decrypted secret key data or session key - */ - privateKeys?: key.Key | key.Key[]; - /** - * (optional) passwords to decrypt the message - */ - passwords?: string | string[]; - /** - * (optional) session keys in the form: { data:Uint8Array, algorithm:String } - */ - sessionKeys?: { data: Uint8Array, algorithm: string } | { data: Uint8Array, algorithm: string }[]; - /** - * (optional) array of public keys or single key, to verify signatures - */ - publicKeys?: key.Key | key.Key[]; - /** - * (optional) whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines. - */ - format?: 'utf8' | 'binary'; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) detached signature for verification - */ - signature?: signature.Signature; - /** - * (optional) use the given date for verification instead of the current time - */ - date?: Date - } - - interface DecryptResult { - data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream, - filename: string, - signatures: { - keyid: type.keyid.Keyid, - verified: Promise, - valid: boolean - }[] - } - - /** - * Decrypts a message with the user's private key, a session key or a password. Either a private key, - * a session key or a password must be specified. - * @param options - * @returns Object containing decrypted and verified message in the form: - * { - * data: string|ReadableStream|NodeStream, (if format was 'utf8', the default) - * data: Uint8Array|ReadableStream|NodeStream, (if format was 'binary') - * filename: string, - * signatures: [ - * { - * keyid: module:type/keyid, - * verified: Promise, - * valid: boolean (if streaming was false) - * }, ... - * ] - * } - */ - function decrypt(options: DecryptOptions): Promise; - - interface SignOptions { - /** - * (cleartext) message to be signed - */ - message: cleartext.CleartextMessage | message.Message; - /** - * array of keys or single key with decrypted secret key data to sign cleartext - */ - privateKeys: key.Key | any[]; - /** - * (optional) if the return value should be ascii armored or the message object - */ - armor?: boolean; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) if the return value should contain a detached signature - */ - detached?: boolean; - /** - * (optional) override the creation date of the signature - */ - date?: Date; - /** - * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - */ - fromUserIds?: UserID[] - } - - interface SignResult { - data: string | ReadableStream | NodeStream, - message: message.Message, - signature: string | ReadableStream | NodeStream | signature.Signature - } - - /** - * Signs a cleartext message. - * @param options - * @returns Object containing signed message in the form: - * { - * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) - * message: Message (if `armor` was false) - * } - * Or, if `detached` was true: - * { - * signature: string|ReadableStream|NodeStream, (if `armor` was true, the default) - * signature: Signature (if `armor` was false) - * } - */ - function sign(options: SignOptions): Promise; - - interface VerifyOptions { - /** - * array of publicKeys or single key, to verify signatures - */ - publicKeys: key.Key | any[]; - /** - * (cleartext) message object with signatures - */ - message: cleartext.CleartextMessage | message.Message; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) detached signature for verification - */ - signature?: signature.Signature; - /** - * (optional) use the given date for verification instead of the current time - */ - date?: Date - } - - interface VerifyResult { - data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream | NodeStream, - signatures: { - keyid: type.keyid.Keyid, - verified: Promise, - valid: boolean - }[] - } - - /** - * Verifies signatures of cleartext signed message - * @param options - * @returns Object containing verified message in the form: - * { - * data: string|ReadableStream|NodeStream, (if `message` was a CleartextMessage) - * data: Uint8Array|ReadableStream|NodeStream, (if `message` was a Message) - * signatures: [ - * { - * keyid: module:type/keyid, - * verified: Promise, - * valid: boolean (if `streaming` was false) - * }, ... - * ] - * } - */ - function verify(options: VerifyOptions): Promise; - - /** - * Encrypt a symmetric session key with public keys, passwords, or both at once. At least either public keys - * or passwords must be specified. - * @param data the session key to be encrypted e.g. 16 random bytes (for aes128) - * @param algorithm algorithm of the symmetric session key e.g. 'aes128' or 'aes256' - * @param aeadAlgorithm (optional) aead algorithm, e.g. 'eax' or 'ocb' - * @param publicKeys (optional) array of public keys or single key, used to encrypt the key - * @param passwords (optional) passwords for the message - * @param wildcard (optional) use a key ID of 0 instead of the public key IDs - * @param date (optional) override the date - * @param toUserIds (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] - * @returns the encrypted session key packets contained in a message object - */ - function encryptSessionKey(data: Uint8Array, algorithm: string, aeadAlgorithm?: string, publicKeys?: key.Key | key.Key[], passwords?: string | string[], wildcard?: boolean, date?: Date, toUserIds?: any[]): Promise; - - /** - * Decrypt symmetric session keys with a private key or password. Either a private key or - * a password must be specified. - * @param message a message object containing the encrypted session key packets - * @param privateKeys (optional) private keys with decrypted secret key data - * @param passwords (optional) passwords to decrypt the session key - * @returns Array of decrypted session key, algorithm pairs in form: - * { data:Uint8Array, algorithm:String } - * or 'undefined' if no key packets found - */ - function decryptSessionKeys(message: message.Message, privateKeys?: key.Key | key.Key[], passwords?: string | string[]): Promise<{ data: Uint8Array, algorithm: string }[] | undefined>; - - /** - * Input validation - */ - function checkString(): void; - - /** - * Normalize parameter to an array if it is not undefined. - * @param param the parameter to be normalized - * @returns the resulting array or undefined - */ - function toArray(param: object): any[] | undefined; - - /** - * Convert data to or from Stream - * @param data the data to convert - * @param streaming (optional) whether to return a ReadableStream - * @returns the data in the respective format - */ - function convertStream(data: object, streaming?: 'web' | 'node' | false): object; - - /** - * Convert object properties from Stream - * @param obj the data to convert - * @param streaming (optional) whether to return ReadableStreams - * @param keys (optional) which keys to return as streams, if possible - * @returns the data in the respective format - */ - function convertStreams(obj: object, streaming: 'web' | 'node' | false, keys: any[]): object; - - /** - * Link result.data to the message stream for cancellation. - * Also, forward errors in the message to result.data. - * @param result the data to convert - * @param message message object - * @param erroringStream (optional) stream which either errors or gets closed without data - * @returns - */ - function linkStreams(result: object, message: message.Message, erroringStream: ReadableStream): object; - - /** - * Wait until signature objects have been verified - * @param signatures list of signatures - */ - function prepareSignatures(signatures: object): void; - - /** - * Global error handler that logs the stack trace and rethrows a high lvl error message. - * @param message A human readable high level error Message - * @param error The internal error that caused the failure - */ - function onError(message: string, error: Error): void; - - /** - * Check for native AEAD support and configuration by the user. Only - * browsers that implement the current WebCrypto specification support - * native GCM. Native EAX is built on CTR and CBC, which current - * browsers support. OCB and CFB are not natively supported. - * @returns If authenticated encryption should be used - */ - function nativeAEAD(): boolean; } + + +/** + * Set the path for the web worker script and create an instance of the async proxy + * @param path relative path to the worker scripts, default: 'openpgp.worker.js' + * @param n number of workers to initialize + * @param workers alternative to path parameter: web workers initialized with 'openpgp.worker.js' + */ +export function initWorker(path: string, n?: number, workers?: any[]): void; + +/** + * Returns a reference to the async proxy if the worker was initialized with openpgp.initWorker() + * @returns the async proxy or null if not initialized + */ +export function getWorker(): worker.async_proxy.AsyncProxy | null; + +/** + * Cleanup the current instance of the web worker. + */ +export function destroyWorker(): void; + +export interface UserID { + name: string; + email: string; +} + +export interface KeyOptions { + /** + * array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] + */ + userIds: UserID[]; + /** + * (optional) The passphrase used to encrypt the resulting private key + */ + passphrase?: string; + /** + * (optional) number of bits for RSA keys: 2048 or 4096. + */ + numBits?: number; + /** + * (optional) The number of seconds after the key creation time that the key expires + */ + keyExpirationTime?: number; + /** + * (optional) elliptic curve for ECC keys: elliptic curve for ECC keys: + * curve25519, p256, p384, p521, secp256k1, + * brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1. + */ + curve?: string; + /** + * (optional) override the creation date of the key and the key signatures + */ + date?: Date; + /** + * (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt + */ + subkeys?: { sign: true, passphrase: "string" }[]; +} + +/** + * Generates a new OpenPGP key pair. Supports RSA and ECC keys. Primary and subkey will be of same type. + * @param options + * @returns The generated key object in the form: + * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } + */ +export function generateKey(option: KeyOptions): Promise<{ key: key.Key, privateKeyArmored: string, publicKeyArmored: string, revocationCertificate: string }>; + +/** + * Reformats signature packets for a key and rewraps key object. + * @param privateKey private key to reformat + * @param userIds array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] + * @param passphrase (optional) The passphrase used to encrypt the resulting private key + * @param keyExpirationTime (optional) The number of seconds after the key creation time that the key expires + * @param revocationCertificate (optional) Whether the returned object should include a revocation certificate to revoke the public key + * @returns The generated key object in the form: + * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } + */ +export function reformatKey(privateKey: key.Key, userIds: any[], passphrase?: string, keyExpirationTime?: number, revocationCertificate?: boolean): Promise; + +/** + * Revokes a key. Requires either a private key or a revocation certificate. + * If a revocation certificate is passed, the reasonForRevocation parameters will be ignored. + * @param key (optional) public or private key to revoke + * @param revocationCertificate (optional) revocation certificate to revoke the key with + * @param reasonForRevocation (optional) object indicating the reason for revocation + * @param reasonForRevocation.flag (optional) flag indicating the reason for revocation + * @param reasonForRevocation.string (optional) string explaining the reason for revocation + * @returns The revoked key object in the form: + * { privateKey:Key, privateKeyArmored:String, publicKey:Key, publicKeyArmored:String } + * (if private key is passed) or { publicKey:Key, publicKeyArmored:String } (otherwise) + */ +export function revokeKey(key?: key.Key, revocationCertificate?: string, reasonForRevocation?: revokeKey_reasonForRevocation): Promise<{ + privateKey: key.Key, + privateKeyArmored: string, + publicKey: key.Key, + publicKeyArmored: string +} | { + publicKey: key.Key, + publicKeyArmored: string +}>; + +/** + * Unlock a private key with your passphrase. + * @param privateKey the private key that is to be decrypted + * @param passphrase the user's passphrase(s) chosen during key generation + * @returns the unlocked key object in the form: { key:Key } + */ +export function decryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; + +/** + * Lock a private key with your passphrase. + * @param privateKey the private key that is to be decrypted + * @param passphrase the user's passphrase(s) chosen during key generation + * @returns the locked key object in the form: { key:Key } + */ +export function encryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; + +export interface EncryptOptions { + /** + * message to be encrypted as created by openpgp.message.fromText or openpgp.message.fromBinary + */ + message: message.Message; + /** + * (optional) array of keys or single key, used to encrypt the message + */ + publicKeys?: key.Key | any[]; + /** + * (optional) private keys for signing. If omitted message will not be signed + */ + privateKeys?: key.Key | any[]; + /** + * (optional) array of passwords or a single password to encrypt the message + */ + passwords?: string | any[]; + /** + * (optional) session key in the form: { data:Uint8Array, algorithm:String } + */ + sessionKey?: { data: Uint8Array, algorithm: string }; + /** + * (optional) which compression algorithm to compress the message with, defaults to what is specified in config + */ + compression?: enums.compression; + /** + * (optional) if the return values should be ascii armored or the message/signature objects + */ + armor?: boolean; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) if the signature should be detached (if true, signature will be added to returned object) + */ + detached?: boolean; + /** + * (optional) a detached signature to add to the encrypted message + */ + signature?: signature.Signature; + /** + * (optional) if the unencrypted session key should be added to returned object + */ + returnSessionKey?: boolean; + /** + * (optional) use a key ID of 0 instead of the public key IDs + */ + wildcard?: boolean; + /** + * (optional) override the creation date of the message signature + */ + date?: Date; + /** + * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + */ + fromUserIds?: UserID[]; + /** + * (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] + */ + toUserIds?: UserID[] +} + +export interface EncryptResult { + data: string | ReadableStream; + message: message.Message; + signature: string | ReadableStream | signature.Signature; + sessionKey: { data: Uint8Array, algorithm: string, aeadAlgorithm: string }; +} + +/** + * Encrypts message text/data with public keys, passwords or both at once. At least either public keys or passwords + * must be specified. If private keys are specified, those will be used to sign the message. + * @param options + * @returns Object containing encrypted (and optionally signed) message in the form: + * { + * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) + * message: Message, (if `armor` was false) + * signature: string|ReadableStream|NodeStream, (if `detached` was true and `armor` was true) + * signature: Signature (if `detached` was true and `armor` was false) + * sessionKey: { data, algorithm, aeadAlgorithm } (if `returnSessionKey` was true) + * } + */ +export function encrypt(options: EncryptOptions): Promise; + +export interface DecryptOptions { + /** + * the message object with the encrypted data + */ + message: message.Message; + /** + * (optional) private keys with decrypted secret key data or session key + */ + privateKeys?: key.Key | key.Key[]; + /** + * (optional) passwords to decrypt the message + */ + passwords?: string | string[]; + /** + * (optional) session keys in the form: { data:Uint8Array, algorithm:String } + */ + sessionKeys?: { data: Uint8Array, algorithm: string } | { data: Uint8Array, algorithm: string }[]; + /** + * (optional) array of public keys or single key, to verify signatures + */ + publicKeys?: key.Key | key.Key[]; + /** + * (optional) whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines. + */ + format?: 'utf8' | 'binary'; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) detached signature for verification + */ + signature?: signature.Signature; + /** + * (optional) use the given date for verification instead of the current time + */ + date?: Date +} + +export interface DecryptResult { + data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream, + filename: string, + signatures: { + keyid: type.keyid.Keyid, + verified: Promise, + valid: boolean + }[] +} + +/** + * Decrypts a message with the user's private key, a session key or a password. Either a private key, + * a session key or a password must be specified. + * @param options + * @returns Object containing decrypted and verified message in the form: + * { + * data: string|ReadableStream|NodeStream, (if format was 'utf8', the default) + * data: Uint8Array|ReadableStream|NodeStream, (if format was 'binary') + * filename: string, + * signatures: [ + * { + * keyid: module:type/keyid, + * verified: Promise, + * valid: boolean (if streaming was false) + * }, ... + * ] + * } + */ +export function decrypt(options: DecryptOptions): Promise; + +export interface SignOptions { + /** + * (cleartext) message to be signed + */ + message: cleartext.CleartextMessage | message.Message; + /** + * array of keys or single key with decrypted secret key data to sign cleartext + */ + privateKeys: key.Key | any[]; + /** + * (optional) if the return value should be ascii armored or the message object + */ + armor?: boolean; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) if the return value should contain a detached signature + */ + detached?: boolean; + /** + * (optional) override the creation date of the signature + */ + date?: Date; + /** + * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + */ + fromUserIds?: UserID[] +} + +export interface SignResult { + data: string | ReadableStream | NodeStream, + message: message.Message, + signature: string | ReadableStream | NodeStream | signature.Signature +} + +/** + * Signs a cleartext message. + * @param options + * @returns Object containing signed message in the form: + * { + * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) + * message: Message (if `armor` was false) + * } + * Or, if `detached` was true: + * { + * signature: string|ReadableStream|NodeStream, (if `armor` was true, the default) + * signature: Signature (if `armor` was false) + * } + */ +export function sign(options: SignOptions): Promise; + +export interface VerifyOptions { + /** + * array of publicKeys or single key, to verify signatures + */ + publicKeys: key.Key | any[]; + /** + * (cleartext) message object with signatures + */ + message: cleartext.CleartextMessage | message.Message; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) detached signature for verification + */ + signature?: signature.Signature; + /** + * (optional) use the given date for verification instead of the current time + */ + date?: Date +} + +export interface VerifyResult { + data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream | NodeStream, + signatures: { + keyid: type.keyid.Keyid, + verified: Promise, + valid: boolean + }[] +} + +/** + * Verifies signatures of cleartext signed message + * @param options + * @returns Object containing verified message in the form: + * { + * data: string|ReadableStream|NodeStream, (if `message` was a CleartextMessage) + * data: Uint8Array|ReadableStream|NodeStream, (if `message` was a Message) + * signatures: [ + * { + * keyid: module:type/keyid, + * verified: Promise, + * valid: boolean (if `streaming` was false) + * }, ... + * ] + * } + */ +export function verify(options: VerifyOptions): Promise; + +/** + * Encrypt a symmetric session key with public keys, passwords, or both at once. At least either public keys + * or passwords must be specified. + * @param data the session key to be encrypted e.g. 16 random bytes (for aes128) + * @param algorithm algorithm of the symmetric session key e.g. 'aes128' or 'aes256' + * @param aeadAlgorithm (optional) aead algorithm, e.g. 'eax' or 'ocb' + * @param publicKeys (optional) array of public keys or single key, used to encrypt the key + * @param passwords (optional) passwords for the message + * @param wildcard (optional) use a key ID of 0 instead of the public key IDs + * @param date (optional) override the date + * @param toUserIds (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] + * @returns the encrypted session key packets contained in a message object + */ +export function encryptSessionKey(data: Uint8Array, algorithm: string, aeadAlgorithm?: string, publicKeys?: key.Key | key.Key[], passwords?: string | string[], wildcard?: boolean, date?: Date, toUserIds?: any[]): Promise; + +/** + * Decrypt symmetric session keys with a private key or password. Either a private key or + * a password must be specified. + * @param message a message object containing the encrypted session key packets + * @param privateKeys (optional) private keys with decrypted secret key data + * @param passwords (optional) passwords to decrypt the session key + * @returns Array of decrypted session key, algorithm pairs in form: + * { data:Uint8Array, algorithm:String } + * or 'undefined' if no key packets found + */ +export function decryptSessionKeys(message: message.Message, privateKeys?: key.Key | key.Key[], passwords?: string | string[]): Promise<{ data: Uint8Array, algorithm: string }[] | undefined>; + +/** + * Input validation + */ +export function checkString(): void; + +/** + * Normalize parameter to an array if it is not undefined. + * @param param the parameter to be normalized + * @returns the resulting array or undefined + */ +export function toArray(param: object): any[] | undefined; + +/** + * Convert data to or from Stream + * @param data the data to convert + * @param streaming (optional) whether to return a ReadableStream + * @returns the data in the respective format + */ +export function convertStream(data: object, streaming?: 'web' | 'node' | false): object; + +/** + * Convert object properties from Stream + * @param obj the data to convert + * @param streaming (optional) whether to return ReadableStreams + * @param keys (optional) which keys to return as streams, if possible + * @returns the data in the respective format + */ +export function convertStreams(obj: object, streaming: 'web' | 'node' | false, keys: any[]): object; + +/** + * Link result.data to the message stream for cancellation. + * Also, forward errors in the message to result.data. + * @param result the data to convert + * @param message message object + * @param erroringStream (optional) stream which either errors or gets closed without data + * @returns + */ +export function linkStreams(result: object, message: message.Message, erroringStream: ReadableStream): object; + +/** + * Wait until signature objects have been verified + * @param signatures list of signatures + */ +export function prepareSignatures(signatures: object): void; + +/** + * Global error handler that logs the stack trace and rethrows a high lvl error message. + * @param message A human readable high level error Message + * @param error The internal error that caused the failure + */ +export function onError(message: string, error: Error): void; + +/** + * Check for native AEAD support and configuration by the user. Only + * browsers that implement the current WebCrypto specification support + * native GCM. Native EAX is built on CTR and CBC, which current + * browsers support. OCB and CFB are not natively supported. + * @returns If authenticated encryption should be used + */ +export function nativeAEAD(): boolean; diff --git a/types/openpgp/openpgp-tests.ts b/types/openpgp/openpgp-tests.ts index 3d5a1e3717..45a69aad1f 100644 --- a/types/openpgp/openpgp-tests.ts +++ b/types/openpgp/openpgp-tests.ts @@ -1,4 +1,4 @@ -import { openpgp } from "openpgp" +import openpgp from "openpgp" // Open PGP Sample codes diff --git a/types/openpgp/ts3.2/index.d.ts b/types/openpgp/ts3.2/index.d.ts index 62bccca432..442a458ccd 100644 --- a/types/openpgp/ts3.2/index.d.ts +++ b/types/openpgp/ts3.2/index.d.ts @@ -16,1589 +16,1560 @@ type NodeStream = stream; type Integer = number; type Infinity = any; - -export namespace openpgp { - namespace cleartext { +export namespace cleartext { + /** + * Class that represents an OpenPGP cleartext signed message. + * See {@link https://tools.ietf.org/html/rfc4880#section-7} + */ + class CleartextMessage { /** - * Class that represents an OpenPGP cleartext signed message. - * See {@link https://tools.ietf.org/html/rfc4880#section-7} + * @param text The cleartext of the signed message + * @param signature The detached signature or an empty signature for unsigned messages */ - class CleartextMessage { - /** - * @param text The cleartext of the signed message - * @param signature The detached signature or an empty signature for unsigned messages - */ - constructor(text: string, signature: signature.Signature); - - /** - * Returns the key IDs of the keys that signed the cleartext message - * @returns array of keyid objects - */ - getSigningKeyIds(): any[]; - - /** - * Sign the cleartext message - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature - * @param date (optional) The creation time of the signature that should be created - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new cleartext message with signed content - */ - sign(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; - - /** - * Sign the cleartext message - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature - * @param date (optional) The creation time of the signature that should be created - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new detached signature of message content - */ - signDetached(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; - - /** - * Verify signatures of cleartext signed message - * @param keys array of keys to verify signatures - * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @returns list of signer's keyid and validity of signature - */ - verify(keys: any[], date: Date): Promise>; - - /** - * Verify signatures of cleartext signed message - * @param keys array of keys to verify signatures - * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @returns list of signer's keyid and validity of signature - */ - verifyDetached(keys: any[], date: Date): Promise>; - - /** - * Get cleartext - * @returns cleartext of message - */ - getText(): string; - - /** - * Returns ASCII armored text of cleartext signed message - * @returns ASCII armor - */ - armor(): string | ReadableStream; - } + constructor(text: string, signature: signature.Signature); /** - * reads an OpenPGP cleartext signed message and returns a CleartextMessage object - * @param armoredText text to be parsed - * @returns new cleartext message object + * Returns the key IDs of the keys that signed the cleartext message + * @returns array of keyid objects */ - function readArmored(armoredText: string | ReadableStream): CleartextMessage; + getSigningKeyIds(): any[]; /** - * Creates a new CleartextMessage object from text - * @param text + * Sign the cleartext message + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature + * @param date (optional) The creation time of the signature that should be created + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns new cleartext message with signed content */ - function fromText(text: string): void; + sign(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + + /** + * Sign the cleartext message + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature + * @param date (optional) The creation time of the signature that should be created + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns new detached signature of message content + */ + signDetached(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + + /** + * Verify signatures of cleartext signed message + * @param keys array of keys to verify signatures + * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + verify(keys: any[], date: Date): Promise>; + + /** + * Verify signatures of cleartext signed message + * @param keys array of keys to verify signatures + * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + verifyDetached(keys: any[], date: Date): Promise>; + + /** + * Get cleartext + * @returns cleartext of message + */ + getText(): string; + + /** + * Returns ASCII armored text of cleartext signed message + * @returns ASCII armor + */ + armor(): string | ReadableStream; } /** - * @see module:config/config + * reads an OpenPGP cleartext signed message and returns a CleartextMessage object + * @param armoredText text to be parsed + * @returns new cleartext message object */ - namespace config { - var prefer_hash_algorithm: any; - - var encryption_cipher: any; - - var compression: any; - - var deflate_level: any; - - /** - * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. - * **NOT INTEROPERABLE WITH OTHER OPENPGP IMPLEMENTATIONS** - * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION** - */ - var aead_protect: any; - - /** - * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. - * 0 means we implement a variant of {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00|this IETF draft}. - * 4 means we implement {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04|RFC4880bis-04}. - * Note that this determines how AEAD packets are parsed even when aead_protect is set to false - */ - var aead_protect_version: any; - - /** - * Default Authenticated Encryption with Additional Data (AEAD) encryption mode - * Only has an effect when aead_protect is set to true. - */ - var aead_mode: any; - - /** - * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode - * Only has an effect when aead_protect is set to true. - * Must be an integer value from 0 to 56. - */ - var aead_chunk_size_byte: any; - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}: - * Iteration Count Byte for S2K (String to Key) - */ - var s2k_iteration_count_byte: any; - - /** - * Use integrity protection for symmetric encryption - */ - var integrity_protect: any; - - var ignore_mdc_error: any; - - var allow_unauthenticated_stream: any; - - var checksum_required: any; - - var rsa_blinding: any; - - /** - * Work-around for rare GPG decryption bug when encrypting with multiple passwords. - * **Slower and slightly less secure** - */ - var password_collision_check: any; - - var revocations_expire: any; - - var use_native: any; - - var min_bytes_for_web_crypto: any; - - var zero_copy: any; - - var debug: any; - - var tolerant: any; - - var show_version: any; - - var show_comment: any; - - var versionstring: any; - - var commentstring: any; - - var keyserver: any; - - var node_store: any; - - /** - * Max userid string length (used for parsing) - */ - var max_userid_length: any; - - namespace localStorage { - class LocalStorage { - /** - * This object is used for storing and retrieving configuration from HTML5 local storage. - */ - constructor(); - - /** - * Reads the config out of the HTML5 local storage - * and initializes the object config. - * if config is null the default config will be used - */ - read(): void; - - /** - * Writes the config to HTML5 local storage - */ - write(): void; - } - } - } - - class LocalStorage { - /** - * This object is used for storing and retrieving configuration from HTML5 local storage. - */ - constructor(); - - /** - * Reads the config out of the HTML5 local storage - * and initializes the object config. - * if config is null the default config will be used - */ - read(): void; - - /** - * Writes the config to HTML5 local storage - */ - write(): void; - } - - + function readArmored(armoredText: string | ReadableStream): CleartextMessage; /** - * @see module:crypto/crypto - * @see module:crypto/signature - * @see module:crypto/public_key - * @see module:crypto/cipher - * @see module:crypto/random - * @see module:crypto/hash + * Creates a new CleartextMessage object from text + * @param text */ + function fromText(text: string): void; +} + +/** + * @see module:config/config + */ +export namespace config { + var prefer_hash_algorithm: any; + + var encryption_cipher: any; + + var compression: any; + + var deflate_level: any; + + /** + * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. + * **NOT INTEROPERABLE WITH OTHER OPENPGP IMPLEMENTATIONS** + * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION** + */ + var aead_protect: any; + + /** + * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. + * 0 means we implement a variant of {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00|this IETF draft}. + * 4 means we implement {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04|RFC4880bis-04}. + * Note that this determines how AEAD packets are parsed even when aead_protect is set to false + */ + var aead_protect_version: any; + + /** + * Default Authenticated Encryption with Additional Data (AEAD) encryption mode + * Only has an effect when aead_protect is set to true. + */ + var aead_mode: any; + + /** + * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode + * Only has an effect when aead_protect is set to true. + * Must be an integer value from 0 to 56. + */ + var aead_chunk_size_byte: any; + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}: + * Iteration Count Byte for S2K (String to Key) + */ + var s2k_iteration_count_byte: any; + + /** + * Use integrity protection for symmetric encryption + */ + var integrity_protect: any; + + var ignore_mdc_error: any; + + var allow_unauthenticated_stream: any; + + var checksum_required: any; + + var rsa_blinding: any; + + /** + * Work-around for rare GPG decryption bug when encrypting with multiple passwords. + * **Slower and slightly less secure** + */ + var password_collision_check: any; + + var revocations_expire: any; + + var use_native: any; + + var min_bytes_for_web_crypto: any; + + var zero_copy: any; + + var debug: any; + + var tolerant: any; + + var show_version: any; + + var show_comment: any; + + var versionstring: any; + + var commentstring: any; + + var keyserver: any; + + var node_store: any; + + /** + * Max userid string length (used for parsing) + */ + var max_userid_length: any; + + namespace localStorage { + class LocalStorage { + /** + * This object is used for storing and retrieving configuration from HTML5 local storage. + */ + constructor(); + + /** + * Reads the config out of the HTML5 local storage + * and initializes the object config. + * if config is null the default config will be used + */ + read(): void; + + /** + * Writes the config to HTML5 local storage + */ + write(): void; + } + } +} + +export class LocalStorage { + /** + * This object is used for storing and retrieving configuration from HTML5 local storage. + */ + constructor(); + + /** + * Reads the config out of the HTML5 local storage + * and initializes the object config. + * if config is null the default config will be used + */ + read(): void; + + /** + * Writes the config to HTML5 local storage + */ + write(): void; +} + + + +/** + * @see module:crypto/crypto + * @see module:crypto/signature + * @see module:crypto/public_key + * @see module:crypto/cipher + * @see module:crypto/random + * @see module:crypto/hash + */ +export namespace crypto { + /** + * @see module:crypto/public_key/elliptic/ecdh + */ + namespace aes_kw { + /** + * AES key wrap + * @param key + * @param data + * @returns + */ + function wrap(key: string, data: string): Uint8Array; + + /** + * AES key unwrap + * @param key + * @param data + * @returns + * @throws + */ + function unwrap(key: string, data: string): Uint8Array; + } + + namespace cfb { + function encrypt(algo: any, key: any, plaintext: any, iv: any): any + function decrypt(algo: any, key: any, ciphertext: any, iv: any): Promise + } + + namespace cipher { + /** + * AES-128 encryption and decryption (ID 7) + * @param key 128-bit key + * @see + * @see + * @returns + */ + function aes128(key: string): object; + + /** + * AES-128 Block Cipher (ID 8) + * @param key 192-bit key + * @see + * @see + * @returns + */ + function aes192(key: string): object; + + /** + * AES-128 Block Cipher (ID 9) + * @param key 256-bit key + * @see + * @see + * @returns + */ + function aes256(key: string): object; + + /** + * Triple DES Block Cipher (ID 2) + * @param key 192-bit key + * @see + * @returns + */ + function tripledes(key: string): object; + + /** + * CAST-128 Block Cipher (ID 3) + * @param key 128-bit key + * @see + * @returns + */ + function cast5(key: string): object; + + /** + * Twofish Block Cipher (ID 10) + * @param key 256-bit key + * @see + * @returns + */ + function twofish(key: string): object; + + /** + * Blowfish Block Cipher (ID 4) + * @param key 128-bit key + * @see + * @returns + */ + function blowfish(key: string): object; + + /** + * Not implemented + * @throws + */ + function idea(): void; + } + + namespace cmac { + /** + * This implementation of CMAC is based on the description of OMAC in + * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that + * document: + * We have made a small modification to the OMAC algorithm as it was + * originally presented, changing one of its two constants. + * Specifically, the constant 4 at line 85 was the constant 1/2 (the + * multiplicative inverse of 2) in the original definition of OMAC [14]. + * The OMAC authors indicate that they will promulgate this modification + * [15], which slightly simplifies implementations. + */ + const blockLength: any; + + /** + * xor `padding` into the end of `data`. This function implements "the + * operation xor→ [which] xors the shorter string into the end of longer + * one". Since data is always as least as long as padding, we can + * simplify the implementation. + * @param data + * @param padding + */ + function rightXorMut(data: Uint8Array, padding: Uint8Array): void; + } + namespace crypto { /** - * @see module:crypto/public_key/elliptic/ecdh + * Encrypts data using specified algorithm and public key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. + * @param algo Public key algorithm + * @param pub_params Algorithm-specific public key parameters + * @param data Data to be encrypted as MPI + * @param fingerprint Recipient fingerprint + * @returns encrypted session key parameters + */ + function publicKeyEncrypt(algo: enums.publicKey, pub_params: Array, data: type.mpi.MPI, fingerprint: string): any[]; + + /** + * Decrypts data using specified algorithm and private key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. + * @param algo Public key algorithm + * @param key_params Algorithm-specific public, private key parameters + * @param data_params encrypted session key parameters + * @param fingerprint Recipient fingerprint + * @returns An MPI containing the decrypted data + */ + function publicKeyDecrypt(algo: enums.publicKey, key_params: Array, data_params: Array, fingerprint: string): type.mpi.MPI; + + /** + * Returns the types comprising the private key of an algorithm + * @param algo The public key algorithm + * @returns The array of types + */ + function getPrivKeyParamTypes(algo: string): any[]; + + /** + * Returns the types comprising the public key of an algorithm + * @param algo The public key algorithm + * @returns The array of types + */ + function getPubKeyParamTypes(algo: string): any[]; + + /** + * Returns the types comprising the encrypted session key of an algorithm + * @param algo The public key algorithm + * @returns The array of types + */ + function getEncSessionKeyParamTypes(algo: string): any[]; + + /** + * Generate algorithm-specific key parameters + * @param algo The public key algorithm + * @param bits Bit length for RSA keys + * @param oid Object identifier for ECC keys + * @returns The array of parameters + */ + function generateParams(algo: string, bits: Integer, oid: type.oid.OID): any[]; + + /** + * Generates a random byte prefix for the specified algorithm + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param algo Symmetric encryption algorithm + * @returns Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated. + */ + function getPrefixRandom(algo: enums.symmetric): Uint8Array; + + /** + * Generating a session key for the specified symmetric algorithm + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param algo Symmetric encryption algorithm + * @returns Random bytes as a string to be used as a key + */ + function generateSessionKey(algo: enums.symmetric): Uint8Array; + } + + namespace eax { + /** + * Class to en/decrypt using EAX mode. + * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' + * @param key The encryption key + */ + function EAX(cipher: string, key: Uint8Array): void; + + /** + * Encrypt plaintext input. + * @param plaintext The cleartext input to be encrypted + * @param nonce The nonce (16 bytes) + * @param adata Associated data to sign + * @returns The ciphertext output + */ + function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + + /** + * Decrypt ciphertext input. + * @param ciphertext The ciphertext input to be decrypted + * @param nonce The nonce (16 bytes) + * @param adata Associated data to verify + * @returns The plaintext output + */ + function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + } + + namespace gcm { + /** + * Class to en/decrypt using GCM mode. + * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' + * @param key The encryption key + */ + function GCM(cipher: string, key: Uint8Array): void; + } + + /** + * @see + * @see */ - namespace aes_kw { + namespace hash { + /** + * @see module:md5 + */ + var md5: any; + + /** + * @see asmCrypto + */ + var sha1: any; + + /** + * @see hash.js + */ + var sha224: any; + + /** + * @see asmCrypto + */ + var sha256: any; + + /** + * @see hash.js + */ + var sha384: any; + + /** + * @see asmCrypto + */ + var sha512: any; + + /** + * @see hash.js + */ + var ripemd: any; + + /** + * Create a hash on the specified data using the specified algorithm + * @param algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) + * @param data Data to be hashed + * @returns hash value + */ + function digest(algo: enums.hash, data: Uint8Array): Promise; + + /** + * Returns the hash size in bytes of the specified hash algorithm type + * @param algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) + * @returns Size in bytes of the resulting hash + */ + function getHashByteLength(algo: enums.hash): Integer; + } + + /** + * @see module:packet.PublicKeyEncryptedSessionKey + */ + namespace pkcs5 { + /** + * Add pkcs5 padding to a text. + * @param msg Text to add padding + * @returns Text with padding added + */ + function encode(msg: string): string; + + /** + * Remove pkcs5 padding from a string. + * @param msg Text to remove padding from + * @returns Text with padding removed + */ + function decode(msg: string): string; + } + + namespace ocb { + /** + * Class to en/decrypt using OCB mode. + * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' + * @param key The encryption key + */ + function OCB(cipher: string, key: Uint8Array): void; + + /** + * Encrypt plaintext input. + * @param plaintext The cleartext input to be encrypted + * @param nonce The nonce (15 bytes) + * @param adata Associated data to sign + * @returns The ciphertext output + */ + function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + + /** + * Decrypt ciphertext input. + * @param ciphertext The ciphertext input to be decrypted + * @param nonce The nonce (15 bytes) + * @param adata Associated data to sign + * @returns The ciphertext output + */ + function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; + } + + /** + * @see module:crypto/public_key/rsa + * @see module:crypto/public_key/elliptic/ecdh + * @see module:packet.PublicKeyEncryptedSessionKey + */ + namespace pkcs1 { + namespace eme { /** - * AES key wrap - * @param key - * @param data - * @returns + * Create a EME-PKCS1-v1_5 padded message + * @see + * @param M message to be encoded + * @param k the length in octets of the key modulus + * @returns EME-PKCS1 padded message */ - function wrap(key: string, data: string): Uint8Array; + function encode(M: string, k: Integer): Promise; /** - * AES key unwrap - * @param key - * @param data - * @returns - * @throws + * Decode a EME-PKCS1-v1_5 padded message + * @see + * @param EM encoded message, an octet string + * @returns message, an octet string */ - function unwrap(key: string, data: string): Uint8Array; + function decode(EM: string): string; } - namespace cfb { - function encrypt(algo: any, key: any, plaintext: any, iv: any): any - function decrypt(algo: any, key: any, ciphertext: any, iv: any): Promise - } - - namespace cipher { + namespace emsa { /** - * AES-128 encryption and decryption (ID 7) - * @param key 128-bit key + * Create a EMSA-PKCS1-v1_5 padded message * @see - * @see - * @returns + * @param algo Hash algorithm type used + * @param hashed message to be encoded + * @param emLen intended length in octets of the encoded message + * @returns encoded message */ - function aes128(key: string): object; - - /** - * AES-128 Block Cipher (ID 8) - * @param key 192-bit key - * @see - * @see - * @returns - */ - function aes192(key: string): object; - - /** - * AES-128 Block Cipher (ID 9) - * @param key 256-bit key - * @see - * @see - * @returns - */ - function aes256(key: string): object; - - /** - * Triple DES Block Cipher (ID 2) - * @param key 192-bit key - * @see - * @returns - */ - function tripledes(key: string): object; - - /** - * CAST-128 Block Cipher (ID 3) - * @param key 128-bit key - * @see - * @returns - */ - function cast5(key: string): object; - - /** - * Twofish Block Cipher (ID 10) - * @param key 256-bit key - * @see - * @returns - */ - function twofish(key: string): object; - - /** - * Blowfish Block Cipher (ID 4) - * @param key 128-bit key - * @see - * @returns - */ - function blowfish(key: string): object; - - /** - * Not implemented - * @throws - */ - function idea(): void; - } - - namespace cmac { - /** - * This implementation of CMAC is based on the description of OMAC in - * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that - * document: - * We have made a small modification to the OMAC algorithm as it was - * originally presented, changing one of its two constants. - * Specifically, the constant 4 at line 85 was the constant 1/2 (the - * multiplicative inverse of 2) in the original definition of OMAC [14]. - * The OMAC authors indicate that they will promulgate this modification - * [15], which slightly simplifies implementations. - */ - const blockLength: any; - - /** - * xor `padding` into the end of `data`. This function implements "the - * operation xor→ [which] xors the shorter string into the end of longer - * one". Since data is always as least as long as padding, we can - * simplify the implementation. - * @param data - * @param padding - */ - function rightXorMut(data: Uint8Array, padding: Uint8Array): void; - } - - namespace crypto { - /** - * Encrypts data using specified algorithm and public key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. - * @param algo Public key algorithm - * @param pub_params Algorithm-specific public key parameters - * @param data Data to be encrypted as MPI - * @param fingerprint Recipient fingerprint - * @returns encrypted session key parameters - */ - function publicKeyEncrypt(algo: enums.publicKey, pub_params: Array, data: type.mpi.MPI, fingerprint: string): any[]; - - /** - * Decrypts data using specified algorithm and private key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms. - * @param algo Public key algorithm - * @param key_params Algorithm-specific public, private key parameters - * @param data_params encrypted session key parameters - * @param fingerprint Recipient fingerprint - * @returns An MPI containing the decrypted data - */ - function publicKeyDecrypt(algo: enums.publicKey, key_params: Array, data_params: Array, fingerprint: string): type.mpi.MPI; - - /** - * Returns the types comprising the private key of an algorithm - * @param algo The public key algorithm - * @returns The array of types - */ - function getPrivKeyParamTypes(algo: string): any[]; - - /** - * Returns the types comprising the public key of an algorithm - * @param algo The public key algorithm - * @returns The array of types - */ - function getPubKeyParamTypes(algo: string): any[]; - - /** - * Returns the types comprising the encrypted session key of an algorithm - * @param algo The public key algorithm - * @returns The array of types - */ - function getEncSessionKeyParamTypes(algo: string): any[]; - - /** - * Generate algorithm-specific key parameters - * @param algo The public key algorithm - * @param bits Bit length for RSA keys - * @param oid Object identifier for ECC keys - * @returns The array of parameters - */ - function generateParams(algo: string, bits: Integer, oid: type.oid.OID): any[]; - - /** - * Generates a random byte prefix for the specified algorithm - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param algo Symmetric encryption algorithm - * @returns Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated. - */ - function getPrefixRandom(algo: enums.symmetric): Uint8Array; - - /** - * Generating a session key for the specified symmetric algorithm - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param algo Symmetric encryption algorithm - * @returns Random bytes as a string to be used as a key - */ - function generateSessionKey(algo: enums.symmetric): Uint8Array; - } - - namespace eax { - /** - * Class to en/decrypt using EAX mode. - * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' - * @param key The encryption key - */ - function EAX(cipher: string, key: Uint8Array): void; - - /** - * Encrypt plaintext input. - * @param plaintext The cleartext input to be encrypted - * @param nonce The nonce (16 bytes) - * @param adata Associated data to sign - * @returns The ciphertext output - */ - function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - - /** - * Decrypt ciphertext input. - * @param ciphertext The ciphertext input to be decrypted - * @param nonce The nonce (16 bytes) - * @param adata Associated data to verify - * @returns The plaintext output - */ - function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - } - - namespace gcm { - /** - * Class to en/decrypt using GCM mode. - * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' - * @param key The encryption key - */ - function GCM(cipher: string, key: Uint8Array): void; + function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; } /** - * @see + * ASN1 object identifiers for hashes * @see */ - namespace hash { + const hash_headers: any; + } + + namespace public_key { + namespace dsa { /** - * @see module:md5 + * DSA Sign function + * @param hash_algo + * @param hashed + * @param g + * @param p + * @param q + * @param x + * @returns */ - var md5: any; + function sign(hash_algo: Integer, hashed: Uint8Array, g: BN, p: BN, q: BN, x: BN): object; /** - * @see asmCrypto + * DSA Verify function + * @param hash_algo + * @param r + * @param s + * @param hashed + * @param g + * @param p + * @param q + * @param y + * @returns BN */ - var sha1: any; + function verify(hash_algo: Integer, r: BN, s: BN, hashed: Uint8Array, g: BN, p: BN, q: BN, y: BN): any; + } + + namespace elgamal { + /** + * ElGamal Encryption function + * @param m + * @param p + * @param g + * @param y + * @returns + */ + function encrypt(m: BN, p: BN, g: BN, y: BN): object; /** - * @see hash.js + * ElGamal Encryption function + * @param c1 + * @param c2 + * @param p + * @param x + * @returns BN */ - var sha224: any; - - /** - * @see asmCrypto - */ - var sha256: any; - - /** - * @see hash.js - */ - var sha384: any; - - /** - * @see asmCrypto - */ - var sha512: any; - - /** - * @see hash.js - */ - var ripemd: any; - - /** - * Create a hash on the specified data using the specified algorithm - * @param algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) - * @param data Data to be hashed - * @returns hash value - */ - function digest(algo: enums.hash, data: Uint8Array): Promise; - - /** - * Returns the hash size in bytes of the specified hash algorithm type - * @param algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) - * @returns Size in bytes of the resulting hash - */ - function getHashByteLength(algo: enums.hash): Integer; + function decrypt(c1: BN, c2: BN, p: BN, x: BN): any; } /** - * @see module:packet.PublicKeyEncryptedSessionKey - */ - namespace pkcs5 { - /** - * Add pkcs5 padding to a text. - * @param msg Text to add padding - * @returns Text with padding added - */ - function encode(msg: string): string; - - /** - * Remove pkcs5 padding from a string. - * @param msg Text to remove padding from - * @returns Text with padding removed - */ - function decode(msg: string): string; - } - - namespace ocb { - /** - * Class to en/decrypt using OCB mode. - * @param cipher The symmetric cipher algorithm to use e.g. 'aes128' - * @param key The encryption key - */ - function OCB(cipher: string, key: Uint8Array): void; - - /** - * Encrypt plaintext input. - * @param plaintext The cleartext input to be encrypted - * @param nonce The nonce (15 bytes) - * @param adata Associated data to sign - * @returns The ciphertext output - */ - function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - - /** - * Decrypt ciphertext input. - * @param ciphertext The ciphertext input to be decrypted - * @param nonce The nonce (15 bytes) - * @param adata Associated data to sign - * @returns The ciphertext output - */ - function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise; - } - - /** - * @see module:crypto/public_key/rsa + * @see module:crypto/public_key/elliptic/curve * @see module:crypto/public_key/elliptic/ecdh - * @see module:packet.PublicKeyEncryptedSessionKey + * @see module:crypto/public_key/elliptic/ecdsa + * @see module:crypto/public_key/elliptic/eddsa */ - namespace pkcs1 { - namespace eme { - /** - * Create a EME-PKCS1-v1_5 padded message - * @see - * @param M message to be encoded - * @param k the length in octets of the key modulus - * @returns EME-PKCS1 padded message - */ - function encode(M: string, k: Integer): Promise; - - /** - * Decode a EME-PKCS1-v1_5 padded message - * @see - * @param EM encoded message, an octet string - * @returns message, an octet string - */ - function decode(EM: string): string; - } - - namespace emsa { - /** - * Create a EMSA-PKCS1-v1_5 padded message - * @see - * @param algo Hash algorithm type used - * @param hashed message to be encoded - * @param emLen intended length in octets of the encoded message - * @returns encoded message - */ - function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; - } - - /** - * ASN1 object identifiers for hashes - * @see - */ - const hash_headers: any; - } - - namespace public_key { - namespace dsa { - /** - * DSA Sign function - * @param hash_algo - * @param hashed - * @param g - * @param p - * @param q - * @param x - * @returns - */ - function sign(hash_algo: Integer, hashed: Uint8Array, g: BN, p: BN, q: BN, x: BN): object; - - /** - * DSA Verify function - * @param hash_algo - * @param r - * @param s - * @param hashed - * @param g - * @param p - * @param q - * @param y - * @returns BN - */ - function verify(hash_algo: Integer, r: BN, s: BN, hashed: Uint8Array, g: BN, p: BN, q: BN, y: BN): any; - } - - namespace elgamal { - /** - * ElGamal Encryption function - * @param m - * @param p - * @param g - * @param y - * @returns - */ - function encrypt(m: BN, p: BN, g: BN, y: BN): object; - - /** - * ElGamal Encryption function - * @param c1 - * @param c2 - * @param p - * @param x - * @returns BN - */ - function decrypt(c1: BN, c2: BN, p: BN, x: BN): any; - } - - /** - * @see module:crypto/public_key/elliptic/curve - * @see module:crypto/public_key/elliptic/ecdh - * @see module:crypto/public_key/elliptic/ecdsa - * @see module:crypto/public_key/elliptic/eddsa - */ - namespace elliptic { - namespace curve { - class Curve { - } - } - - namespace ecdh { - /** - * Generate ECDHE ephemeral key and secret from public key - * @param curve Elliptic curve object - * @param Q Recipient public key - * @returns Returns public part of ephemeral key and generated ephemeral secret - */ - function genPublicEphemeralKey(curve: curve.Curve, Q: Uint8Array): Promise<{ V: Uint8Array, S: BN }>; - - /** - * Encrypt and wrap a session key - * @param oid Elliptic curve object identifier - * @param cipher_algo Symmetric cipher to use - * @param hash_algo Hash algorithm to use - * @param m Value derived from session key (RFC 6637) - * @param Q Recipient public key - * @param fingerprint Recipient fingerprint - * @returns Returns public part of ephemeral key and encoded session key - */ - function encrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, m: type.mpi.MPI, Q: Uint8Array, fingerprint: string): Promise<{ V: BN, C: BN }>; - - /** - * Generate ECDHE secret from private key and public part of ephemeral key - * @param curve Elliptic curve object - * @param V Public part of ephemeral key - * @param d Recipient private key - * @returns Generated ephemeral secret - */ - function genPrivateEphemeralKey(curve: curve.Curve, V: Uint8Array, d: Uint8Array): Promise; - - /** - * Decrypt and unwrap the value derived from session key - * @param oid Elliptic curve object identifier - * @param cipher_algo Symmetric cipher to use - * @param hash_algo Hash algorithm to use - * @param V Public part of ephemeral key - * @param C Encrypted and wrapped value derived from session key - * @param d Recipient private key - * @param fingerprint Recipient fingerprint - * @returns Value derived from session - */ - function decrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, V: Uint8Array, C: Uint8Array, d: Uint8Array, fingerprint: string): Promise; - } - - namespace ecdsa { - /** - * Sign a message using the provided key - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used to sign - * @param m Message to sign - * @param d Private key used to sign the message - * @param hashed The hashed message - * @returns Signature of the message - */ - function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; - - /** - * Verifies if a signature is valid for a message - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used in the signature - * @param signature Signature to verify - * @param m Message to verify - * @param Q Public key used to verify the message - * @param hashed The hashed message - * @returns - */ - function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; - } - - namespace eddsa { - /** - * Sign a message using the provided keygit - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used to sign - * @param m Message to sign - * @param d Private key used to sign - * @param hashed The hashed message - * @returns Signature of the message - */ - function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; - - /** - * Verifies if a signature is valid for a message - * @param oid Elliptic curve object identifier - * @param hash_algo Hash algorithm used in the signature - * @param signature Signature to verify the message - * @param m Message to verify - * @param Q Public key used to verify the message - * @param hashed The hashed message - * @returns - */ - function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; - } - - namespace key { - class KeyPair { - } + namespace elliptic { + namespace curve { + class Curve { } } - namespace prime { + namespace ecdh { /** - * Probabilistic random number generator - * @param bits Bit length of the prime - * @param e Optional RSA exponent to check against the prime - * @param k Optional number of iterations of Miller-Rabin test - * @returns BN + * Generate ECDHE ephemeral key and secret from public key + * @param curve Elliptic curve object + * @param Q Recipient public key + * @returns Returns public part of ephemeral key and generated ephemeral secret */ - function randomProbablePrime(bits: Integer, e: BN, k: Integer): any; + function genPublicEphemeralKey(curve: curve.Curve, Q: Uint8Array): Promise<{ V: Uint8Array, S: BN }>; /** - * Probabilistic primality testing - * @param n Number to test - * @param e Optional RSA exponent to check against the prime - * @param k Optional number of iterations of Miller-Rabin test - * @returns + * Encrypt and wrap a session key + * @param oid Elliptic curve object identifier + * @param cipher_algo Symmetric cipher to use + * @param hash_algo Hash algorithm to use + * @param m Value derived from session key (RFC 6637) + * @param Q Recipient public key + * @param fingerprint Recipient fingerprint + * @returns Returns public part of ephemeral key and encoded session key */ - function isProbablePrime(n: BN, e: BN, k: Integer): boolean; + function encrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, m: type.mpi.MPI, Q: Uint8Array, fingerprint: string): Promise<{ V: BN, C: BN }>; /** - * Tests whether n is probably prime or not using Fermat's test with b = 2. - * Fails if b^(n-1) mod n === 1. - * @param n Number to test - * @param b Optional Fermat test base - * @returns + * Generate ECDHE secret from private key and public part of ephemeral key + * @param curve Elliptic curve object + * @param V Public part of ephemeral key + * @param d Recipient private key + * @returns Generated ephemeral secret */ - function fermat(n: BN, b: Integer): boolean; + function genPrivateEphemeralKey(curve: curve.Curve, V: Uint8Array, d: Uint8Array): Promise; /** - * Tests whether n is probably prime or not using the Miller-Rabin test. - * See HAC Remark 4.28. - * @param n Number to test - * @param k Optional number of iterations of Miller-Rabin test - * @param rand Optional function to generate potential witnesses - * @returns + * Decrypt and unwrap the value derived from session key + * @param oid Elliptic curve object identifier + * @param cipher_algo Symmetric cipher to use + * @param hash_algo Hash algorithm to use + * @param V Public part of ephemeral key + * @param C Encrypted and wrapped value derived from session key + * @param d Recipient private key + * @param fingerprint Recipient fingerprint + * @returns Value derived from session */ - function millerRabin(n: BN, k: Integer, rand: Function): boolean; + function decrypt(oid: type.oid.OID, cipher_algo: enums.symmetric, hash_algo: enums.hash, V: Uint8Array, C: Uint8Array, d: Uint8Array, fingerprint: string): Promise; } - namespace rsa { + namespace ecdsa { /** - * Create signature - * @param m message - * @param n RSA public modulus - * @param e RSA public exponent - * @param d RSA private exponent - * @returns RSA Signature + * Sign a message using the provided key + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used to sign + * @param m Message to sign + * @param d Private key used to sign the message + * @param hashed The hashed message + * @returns Signature of the message */ - function sign(m: BN, n: BN, e: BN, d: BN): BN; + function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; /** - * Verify signature - * @param s signature - * @param n RSA public modulus - * @param e RSA public exponent + * Verifies if a signature is valid for a message + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used in the signature + * @param signature Signature to verify + * @param m Message to verify + * @param Q Public key used to verify the message + * @param hashed The hashed message * @returns */ - function verify(s: BN, n: BN, e: BN): BN; + function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; + } + + namespace eddsa { + /** + * Sign a message using the provided keygit + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used to sign + * @param m Message to sign + * @param d Private key used to sign + * @param hashed The hashed message + * @returns Signature of the message + */ + function sign(oid: type.oid.OID, hash_algo: enums.hash, m: Uint8Array, d: Uint8Array, hashed: Uint8Array): object; /** - * Encrypt message - * @param m message - * @param n RSA public modulus - * @param e RSA public exponent - * @returns RSA Ciphertext + * Verifies if a signature is valid for a message + * @param oid Elliptic curve object identifier + * @param hash_algo Hash algorithm used in the signature + * @param signature Signature to verify the message + * @param m Message to verify + * @param Q Public key used to verify the message + * @param hashed The hashed message + * @returns */ - function encrypt(m: BN, n: BN, e: BN): BN; + function verify(oid: type.oid.OID, hash_algo: enums.hash, signature: object, m: Uint8Array, Q: Uint8Array, hashed: Uint8Array): boolean; + } - /** - * Decrypt RSA message - * @param m message - * @param n RSA public modulus - * @param e RSA public exponent - * @param d RSA private exponent - * @param p RSA private prime p - * @param q RSA private prime q - * @param u RSA private inverse of prime q - * @returns RSA Plaintext - */ - function decrypt(m: BN, n: BN, e: BN, d: BN, p: BN, q: BN, u: BN): BN; - - /** - * Generate a new random private key B bits long with public exponent E. - * When possible, webCrypto is used. Otherwise, primes are generated using - * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm. - * @see module:crypto/public_key/prime - * @param B RSA bit length - * @param E RSA public exponent in hex string - * @returns RSA public modulus, RSA public exponent, RSA private exponent, - * RSA private prime p, RSA private prime q, u = q ** -1 mod p - */ - function generate(B: Integer, E: string): object; + namespace key { + class KeyPair { + } } } - namespace random { + namespace prime { /** - * Retrieve secure random byte array of the specified length - * @param length Length in bytes to generate - * @returns Random byte array + * Probabilistic random number generator + * @param bits Bit length of the prime + * @param e Optional RSA exponent to check against the prime + * @param k Optional number of iterations of Miller-Rabin test + * @returns BN */ - function getRandomBytes(length: Integer): Uint8Array; + function randomProbablePrime(bits: Integer, e: BN, k: Integer): any; /** - * Create a secure random MPI that is greater than or equal to min and less than max. - * @param min Lower bound, included - * @param max Upper bound, excluded - * @returns Random MPI - */ - function getRandomBN(min: type.mpi.MPI, max: type.mpi.MPI): BN; - - /** - * Buffer for secure random numbers - */ - function RandomBuffer(): void; - } - - namespace signature { - /** - * Verifies the signature provided for data using specified algorithms and public key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} - * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} - * for public key and hash algorithms. - * @param algo Public key algorithm - * @param hash_algo Hash algorithm - * @param msg_MPIs Algorithm-specific signature parameters - * @param pub_MPIs Algorithm-specific public key parameters - * @param data Data for which the signature was created - * @param hashed The hashed data - * @returns True if signature is valid - */ - function verify(algo: enums.publicKey, hash_algo: enums.hash, msg_MPIs: type.mpi.MPI[], pub_MPIs: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): boolean; - - /** - * Creates a signature on data using specified algorithms and private key parameters. - * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} - * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} - * for public key and hash algorithms. - * @param algo Public key algorithm - * @param hash_algo Hash algorithm - * @param key_params Algorithm-specific public and private key parameters - * @param data Data to be signed - * @param hashed The hashed data - * @returns Signature - */ - function sign(algo: enums.publicKey, hash_algo: enums.hash, key_params: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): Uint8Array; - } - } - - namespace eme { - /** - * Create a EME-PKCS1-v1_5 padded message - * @see - * @param M message to be encoded - * @param k the length in octets of the key modulus - * @returns EME-PKCS1 padded message - */ - function encode(M: string, k: Integer): Promise; - - /** - * Decode a EME-PKCS1-v1_5 padded message - * @see - * @param EM encoded message, an octet string - * @returns message, an octet string - */ - function decode(EM: string): string; - } - - namespace emsa { - /** - * Create a EMSA-PKCS1-v1_5 padded message - * @see - * @param algo Hash algorithm type used - * @param hashed message to be encoded - * @param emLen intended length in octets of the encoded message - * @returns encoded message - */ - function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; - } - - namespace encoding { - namespace armor { - /** - * Add additional information to the armor version of an OpenPGP binary - * packet block. - * @author Alex - * @version 2011-12-16 - * @param customComment (optional) additional comment to add to the armored string - * @returns The header information - */ - function addheader(customComment: string): string; - - /** - * Calculates a checksum over the given data and returns it base64 encoded - * @param data Data to create a CRC-24 checksum for - * @returns Base64 encoded checksum - */ - function getCheckSum(data: string | ReadableStream): string | ReadableStream; - - /** - * Internal function to calculate a CRC-24 checksum over a given string (data) - * @param data Data to create a CRC-24 checksum for - * @returns The CRC-24 checksum - */ - function createcrc24(data: string | ReadableStream): Uint8Array | ReadableStream; - - /** - * Splits a message into two parts, the body and the checksum. This is an internal function - * @param text OpenPGP armored message part - * @returns An object with attribute "body" containing the body - * and an attribute "checksum" containing the checksum. - */ - function splitChecksum(text: string): object; - - /** - * DeArmor an OpenPGP armored message; verify the checksum and return - * the encoded bytes - * @param text OpenPGP armored message - * @returns An object with attribute "text" containing the message text, - * an attribute "data" containing a stream of bytes and "type" for the ASCII armor type - */ - function dearmor(text: string): Promise; - - /** - * Armor an OpenPGP binary packet block - * @param messagetype type of the message - * @param body - * @param partindex - * @param parttotal - * @param customComment (optional) additional comment to add to the armored string - * @returns Armored text - */ - function armor(messagetype: Integer, body: any, partindex: Integer, parttotal: Integer, customComment?: string): string | ReadableStream; - } - - namespace base64 { - /** - * Convert binary array to radix-64 - * @param t Uint8Array to convert - * @param u if true, output is URL-safe - * @returns radix-64 version of input string - */ - function s2r(t: Uint8Array | ReadableStream, u?: boolean): string | ReadableStream; - - /** - * Convert radix-64 to binary array - * @param t radix-64 string to convert - * @param u if true, input is interpreted as URL-safe - * @returns binary array version of input string - */ - function r2s(t: string | ReadableStream, u: boolean): Uint8Array | ReadableStream; - } - } - - namespace enums { - /** - * Maps curve names under various standards to one - * @see - */ - enum curve { - /** - * NIST P-256 Curve - */ - p256 = "p256", - "P-256" = "p256", - secp256r1 = "p256", - prime256v1 = "p256", - "1.2.840.10045.3.1.7" = "p256", - "2a8648ce3d030107" = "p256", - "2A8648CE3D030107" = "p256", - /** - * NIST P-384 Curve - */ - p384 = "p384", - "P-384" = "p384", - secp384r1 = "p384", - "1.3.132.0.34" = "p384", - "2b81040022" = "p384", - "2B81040022" = "p384", - /** - * NIST P-521 Curve - */ - p521 = "p521", - "P-521" = "p521", - secp521r1 = "p521", - "1.3.132.0.35" = "p521", - "2b81040023" = "p521", - "2B81040023" = "p521", - /** - * SECG SECP256k1 Curve - */ - secp256k1 = "secp256k1", - "1.3.132.0.10" = "secp256k1", - "2b8104000a" = "secp256k1", - "2B8104000A" = "secp256k1", - /** - * Ed25519 - */ - ED25519 = "ed25519", - ed25519 = "ed25519", - Ed25519 = "ed25519", - "1.3.6.1.4.1.11591.15.1" = "ed25519", - "2b06010401da470f01" = "ed25519", - "2B06010401DA470F01" = "ed25519", - /** - * Curve25519 - */ - X25519 = "curve25519", - cv25519 = "curve25519", - curve25519 = "curve25519", - Curve25519 = "curve25519", - "1.3.6.1.4.1.3029.1.5.1" = "curve25519", - "2b060104019755010501" = "curve25519", - "2B060104019755010501" = "curve25519", - /** - * BrainpoolP256r1 Curve - */ - brainpoolP256r1 = "brainpoolP256r1", - "1.3.36.3.3.2.8.1.1.7" = "brainpoolP256r1", - "2b2403030208010107" = "brainpoolP256r1", - "2B2403030208010107" = "brainpoolP256r1", - /** - * BrainpoolP384r1 Curve - */ - brainpoolP384r1 = "brainpoolP384r1", - "1.3.36.3.3.2.8.1.1.11" = "brainpoolP384r1", - "2b240303020801010b" = "brainpoolP384r1", - "2B240303020801010B" = "brainpoolP384r1", - /** - * BrainpoolP512r1 Curve - */ - brainpoolP512r1 = "brainpoolP512r1", - "1.3.36.3.3.2.8.1.1.13" = "brainpoolP512r1", - "2b240303020801010d" = "brainpoolP512r1", - "2B240303020801010D" = "brainpoolP512r1", - } - - /** - * A string to key specifier type - */ - enum s2k { - simple = 0, - salted = 1, - iterated = 3, - gnu = 101, - } - - /** - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.1|RFC4880bis-04, section 9.1} - */ - enum publicKey { - /** - * RSA (Encrypt or Sign) [HAC] - */ - rsa_encrypt_sign = 1, - /** - * RSA (Encrypt only) [HAC] - */ - rsa_encrypt = 2, - /** - * RSA (Sign only) [HAC] - */ - rsa_sign = 3, - /** - * Elgamal (Encrypt only) [ELGAMAL] [HAC] - */ - elgamal = 16, - /** - * DSA (Sign only) [FIPS186] [HAC] - */ - dsa = 17, - /** - * ECDH (Encrypt only) [RFC6637] - */ - ecdh = 18, - /** - * ECDSA (Sign only) [RFC6637] - */ - ecdsa = 19, - /** - * EdDSA (Sign only) - * [ {@link https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-04|Draft RFC}] - */ - eddsa = 22, - /** - * Reserved for AEDH - */ - aedh = 23, - /** - * Reserved for AEDSA - */ - aedsa = 24, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2} - */ - enum symmetric { - plaintext = 0, - /** - * Not implemented! - */ - idea = 1, - "3des" = 2, - tripledes = 2, - cast5 = 3, - blowfish = 4, - aes128 = 7, - aes192 = 8, - aes256 = 9, - twofish = 10, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3} - */ - enum compression { - uncompressed = 0, - /** - * RFC1951 - */ - zip = 1, - /** - * RFC1950 - */ - zlib = 2, - bzip2 = 3, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4} - */ - enum hash { - md5 = 1, - sha1 = 2, - ripemd = 3, - sha256 = 8, - sha384 = 9, - sha512 = 10, - sha224 = 11, - } - - /** - * A list of hash names as accepted by webCrypto functions. - * {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest|Parameters, algo} - */ - enum webHash { - "SHA-1" = 2, - "SHA-256" = 8, - "SHA-384" = 9, - "SHA-512" = 10, - } - - /** - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.6|RFC4880bis-04, section 9.6} - */ - enum aead { - eax = 1, - ocb = 2, - experimental_gcm = 100, - } - - /** - * A list of packet types and numeric tags associated with them. - */ - enum packet { - publicKeyEncryptedSessionKey = 1, - signature = 2, - symEncryptedSessionKey = 3, - onePassSignature = 4, - secretKey = 5, - publicKey = 6, - secretSubkey = 7, - compressed = 8, - symmetricallyEncrypted = 9, - marker = 10, - literal = 11, - trust = 12, - userid = 13, - publicSubkey = 14, - userAttribute = 17, - symEncryptedIntegrityProtected = 18, - modificationDetectionCode = 19, - symEncryptedAEADProtected = 20, - } - - /** - * Data types in the literal packet - */ - enum literal { - /** - * Binary data 'b' - */ - binary = "", - /** - * Text data 't' - */ - text = "", - /** - * Utf8 data 'u' - */ - utf8 = "", - /** - * MIME message body part 'm' - */ - mime = "", - } - - /** - * One pass signature packet type - */ - enum signature { - /** - * 0x00: Signature of a binary document. - */ - binary = 0, - /** - * 0x01: Signature of a canonical text document. - * Canonicalyzing the document by converting line endings. - */ - text = 1, - /** - * 0x02: Standalone signature. - * This signature is a signature of only its own subpacket contents. - * It is calculated identically to a signature over a zero-lengh - * binary document. Note that it doesn't make sense to have a V3 - * standalone signature. - */ - standalone = 2, - /** - * 0x10: Generic certification of a User ID and Public-Key packet. - * The issuer of this certification does not make any particular - * assertion as to how well the certifier has checked that the owner - * of the key is in fact the person described by the User ID. - */ - cert_generic = 16, - /** - * 0x11: Persona certification of a User ID and Public-Key packet. - * The issuer of this certification has not done any verification of - * the claim that the owner of this key is the User ID specified. - */ - cert_persona = 17, - /** - * 0x12: Casual certification of a User ID and Public-Key packet. - * The issuer of this certification has done some casual - * verification of the claim of identity. - */ - cert_casual = 18, - /** - * 0x13: Positive certification of a User ID and Public-Key packet. - * The issuer of this certification has done substantial - * verification of the claim of identity. - * Most OpenPGP implementations make their "key signatures" as 0x10 - * certifications. Some implementations can issue 0x11-0x13 - * certifications, but few differentiate between the types. - */ - cert_positive = 19, - /** - * 0x30: Certification revocation signature - * This signature revokes an earlier User ID certification signature - * (signature class 0x10 through 0x13) or direct-key signature - * (0x1F). It should be issued by the same key that issued the - * revoked signature or an authorized revocation key. The signature - * is computed over the same data as the certificate that it - * revokes, and should have a later creation date than that - * certificate. - */ - cert_revocation = 48, - /** - * 0x18: Subkey Binding Signature - * This signature is a statement by the top-level signing key that - * indicates that it owns the subkey. This signature is calculated - * directly on the primary key and subkey, and not on any User ID or - * other packets. A signature that binds a signing subkey MUST have - * an Embedded Signature subpacket in this binding signature that - * contains a 0x19 signature made by the signing subkey on the - * primary key and subkey. - */ - subkey_binding = 24, - /** - * 0x19: Primary Key Binding Signature - * This signature is a statement by a signing subkey, indicating - * that it is owned by the primary key and subkey. This signature - * is calculated the same way as a 0x18 signature: directly on the - * primary key and subkey, and not on any User ID or other packets. - * When a signature is made over a key, the hash data starts with the - * octet 0x99, followed by a two-octet length of the key, and then body - * of the key packet. (Note that this is an old-style packet header for - * a key packet with two-octet length.) A subkey binding signature - * (type 0x18) or primary key binding signature (type 0x19) then hashes - * the subkey using the same format as the main key (also using 0x99 as - * the first octet). - */ - key_binding = 25, - /** - * 0x1F: Signature directly on a key - * This signature is calculated directly on a key. It binds the - * information in the Signature subpackets to the key, and is - * appropriate to be used for subpackets that provide information - * about the key, such as the Revocation Key subpacket. It is also - * appropriate for statements that non-self certifiers want to make - * about the key itself, rather than the binding between a key and a - * name. - */ - key = 31, - /** - * 0x20: Key revocation signature - * The signature is calculated directly on the key being revoked. A - * revoked key is not to be used. Only revocation signatures by the - * key being revoked, or by an authorized revocation key, should be - * considered valid revocation signatures.a - */ - key_revocation = 32, - /** - * 0x28: Subkey revocation signature - * The signature is calculated directly on the subkey being revoked. - * A revoked subkey is not to be used. Only revocation signatures - * by the top-level signature key that is bound to this subkey, or - * by an authorized revocation key, should be considered valid - * revocation signatures. - * Key revocation signatures (types 0x20 and 0x28) - * hash only the key being revoked. - */ - subkey_revocation = 40, - /** - * 0x40: Timestamp signature. - * This signature is only meaningful for the timestamp contained in - * it. - */ - timestamp = 64, - /** - * 0x50: Third-Party Confirmation signature. - * This signature is a signature over some other OpenPGP Signature - * packet(s). It is analogous to a notary seal on the signed data. - * A third-party signature SHOULD include Signature Target - * subpacket(s) to give easy identification. Note that we really do - * mean SHOULD. There are plausible uses for this (such as a blind - * party that only sees the signature, not the key or source - * document) that cannot include a target subpacket. - */ - third_party = 80, - } - - /** - * Signature subpacket type - */ - enum signatureSubpacket { - signature_creation_time = 2, - signature_expiration_time = 3, - exportable_certification = 4, - trust_signature = 5, - regular_expression = 6, - revocable = 7, - key_expiration_time = 9, - placeholder_backwards_compatibility = 10, - preferred_symmetric_algorithms = 11, - revocation_key = 12, - issuer = 16, - notation_data = 20, - preferred_hash_algorithms = 21, - preferred_compression_algorithms = 22, - key_server_preferences = 23, - preferred_key_server = 24, - primary_user_id = 25, - policy_uri = 26, - key_flags = 27, - signers_user_id = 28, - reason_for_revocation = 29, - features = 30, - signature_target = 31, - embedded_signature = 32, - issuer_fingerprint = 33, - preferred_aead_algorithms = 34, - } - - /** - * Key flags - */ - enum keyFlags { - /** - * 0x01 - This key may be used to certify other keys. - */ - certify_keys = 1, - /** - * 0x02 - This key may be used to sign data. - */ - sign_data = 2, - /** - * 0x04 - This key may be used to encrypt communications. - */ - encrypt_communication = 4, - /** - * 0x08 - This key may be used to encrypt storage. - */ - encrypt_storage = 8, - /** - * 0x10 - The private component of this key may have been split - * by a secret-sharing mechanism. - */ - split_private_key = 16, - /** - * 0x20 - This key may be used for authentication. - */ - authentication = 32, - /** - * 0x80 - The private component of this key may be in the - * possession of more than one person. - */ - shared_private_key = 128, - } - - /** - * Key status - */ - enum keyStatus { - invalid = 0, - expired = 1, - revoked = 2, - valid = 3, - no_self_cert = 4, - } - - /** - * Armor type - */ - enum armor { - multipart_section = 0, - multipart_last = 1, - signed = 2, - message = 3, - public_key = 4, - private_key = 5, - signature = 6, - } - - /** - * {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.23|RFC4880, section 5.2.3.23} - */ - enum reasonForRevocation { - /** - * No reason specified (key revocations or cert revocations) - */ - no_reason = 0, - /** - * Key is superseded (key revocations) - */ - key_superseded = 1, - /** - * Key material has been comPromised (key revocations) - */ - key_comPromised = 2, - /** - * Key is retired and no longer used (key revocations) - */ - key_retired = 3, - /** - * User ID information is no longer valid (cert revocations) - */ - userid_invalid = 32, - } - - /** - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.2.3.25|RFC4880bis-04, section 5.2.3.25} - */ - enum features { - /** - * 0x01 - Modification Detection (packets 18 and 19) - */ - modification_detection = 1, - /** - * 0x02 - AEAD Encrypted Data Packet (packet 20) and version 5 - * Symmetric-Key Encrypted Session Key Packets (packet 3) - */ - aead = 2, - /** - * 0x04 - Version 5 Public-Key Packet format and corresponding new - * fingerprint format - */ - v5_keys = 4, - } - - /** - * Asserts validity and converts from string/integer to integer. - */ - function write(): void; - - /** - * Converts from an integer to string. - */ - function read(): void; - } - - namespace hkp { - class HKP { - /** - * Initialize the HKP client and configure it with the key server url and fetch function. - * @param keyServerBaseUrl (optional) The HKP key server base url including - * the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to - * openpgp.config.keyserver (https://keyserver.ubuntu.com) - */ - constructor(keyServerBaseUrl: string); - - /** - * Search for a public key on the key server either by key ID or part of the user ID. - * @param options.keyID The long public key ID. - * @param options.query This can be any part of the key user ID such as name - * or email address. - * @returns The ascii armored public key. - */ - lookup(): Promise; - - /** - * Upload a public key to the server. - * @param publicKeyArmored An ascii armored public key to be uploaded. + * Probabilistic primality testing + * @param n Number to test + * @param e Optional RSA exponent to check against the prime + * @param k Optional number of iterations of Miller-Rabin test * @returns */ - upload(publicKeyArmored: string): Promise; + function isProbablePrime(n: BN, e: BN, k: Integer): boolean; + + /** + * Tests whether n is probably prime or not using Fermat's test with b = 2. + * Fails if b^(n-1) mod n === 1. + * @param n Number to test + * @param b Optional Fermat test base + * @returns + */ + function fermat(n: BN, b: Integer): boolean; + + /** + * Tests whether n is probably prime or not using the Miller-Rabin test. + * See HAC Remark 4.28. + * @param n Number to test + * @param k Optional number of iterations of Miller-Rabin test + * @param rand Optional function to generate potential witnesses + * @returns + */ + function millerRabin(n: BN, k: Integer, rand: Function): boolean; + } + + namespace rsa { + /** + * Create signature + * @param m message + * @param n RSA public modulus + * @param e RSA public exponent + * @param d RSA private exponent + * @returns RSA Signature + */ + function sign(m: BN, n: BN, e: BN, d: BN): BN; + + /** + * Verify signature + * @param s signature + * @param n RSA public modulus + * @param e RSA public exponent + * @returns + */ + function verify(s: BN, n: BN, e: BN): BN; + + /** + * Encrypt message + * @param m message + * @param n RSA public modulus + * @param e RSA public exponent + * @returns RSA Ciphertext + */ + function encrypt(m: BN, n: BN, e: BN): BN; + + /** + * Decrypt RSA message + * @param m message + * @param n RSA public modulus + * @param e RSA public exponent + * @param d RSA private exponent + * @param p RSA private prime p + * @param q RSA private prime q + * @param u RSA private inverse of prime q + * @returns RSA Plaintext + */ + function decrypt(m: BN, n: BN, e: BN, d: BN, p: BN, q: BN, u: BN): BN; + + /** + * Generate a new random private key B bits long with public exponent E. + * When possible, webCrypto is used. Otherwise, primes are generated using + * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm. + * @see module:crypto/public_key/prime + * @param B RSA bit length + * @param E RSA public exponent in hex string + * @returns RSA public modulus, RSA public exponent, RSA private exponent, + * RSA private prime p, RSA private prime q, u = q ** -1 mod p + */ + function generate(B: Integer, E: string): object; } } + namespace random { + /** + * Retrieve secure random byte array of the specified length + * @param length Length in bytes to generate + * @returns Random byte array + */ + function getRandomBytes(length: Integer): Uint8Array; + + /** + * Create a secure random MPI that is greater than or equal to min and less than max. + * @param min Lower bound, included + * @param max Upper bound, excluded + * @returns Random MPI + */ + function getRandomBN(min: type.mpi.MPI, max: type.mpi.MPI): BN; + + /** + * Buffer for secure random numbers + */ + function RandomBuffer(): void; + } + + namespace signature { + /** + * Verifies the signature provided for data using specified algorithms and public key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} + * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} + * for public key and hash algorithms. + * @param algo Public key algorithm + * @param hash_algo Hash algorithm + * @param msg_MPIs Algorithm-specific signature parameters + * @param pub_MPIs Algorithm-specific public key parameters + * @param data Data for which the signature was created + * @param hashed The hashed data + * @returns True if signature is valid + */ + function verify(algo: enums.publicKey, hash_algo: enums.hash, msg_MPIs: type.mpi.MPI[], pub_MPIs: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): boolean; + + /** + * Creates a signature on data using specified algorithms and private key parameters. + * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} + * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4} + * for public key and hash algorithms. + * @param algo Public key algorithm + * @param hash_algo Hash algorithm + * @param key_params Algorithm-specific public and private key parameters + * @param data Data to be signed + * @param hashed The hashed data + * @returns Signature + */ + function sign(algo: enums.publicKey, hash_algo: enums.hash, key_params: type.mpi.MPI[], data: Uint8Array, hashed: Uint8Array): Uint8Array; + } +} + +export namespace eme { + /** + * Create a EME-PKCS1-v1_5 padded message + * @see + * @param M message to be encoded + * @param k the length in octets of the key modulus + * @returns EME-PKCS1 padded message + */ + function encode(M: string, k: Integer): Promise; + + /** + * Decode a EME-PKCS1-v1_5 padded message + * @see + * @param EM encoded message, an octet string + * @returns message, an octet string + */ + function decode(EM: string): string; +} + +export namespace emsa { + /** + * Create a EMSA-PKCS1-v1_5 padded message + * @see + * @param algo Hash algorithm type used + * @param hashed message to be encoded + * @param emLen intended length in octets of the encoded message + * @returns encoded message + */ + function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string; +} + +export namespace encoding { + namespace armor { + /** + * Add additional information to the armor version of an OpenPGP binary + * packet block. + * @author Alex + * @version 2011-12-16 + * @param customComment (optional) additional comment to add to the armored string + * @returns The header information + */ + function addheader(customComment: string): string; + + /** + * Calculates a checksum over the given data and returns it base64 encoded + * @param data Data to create a CRC-24 checksum for + * @returns Base64 encoded checksum + */ + function getCheckSum(data: string | ReadableStream): string | ReadableStream; + + /** + * Internal function to calculate a CRC-24 checksum over a given string (data) + * @param data Data to create a CRC-24 checksum for + * @returns The CRC-24 checksum + */ + function createcrc24(data: string | ReadableStream): Uint8Array | ReadableStream; + + /** + * Splits a message into two parts, the body and the checksum. This is an internal function + * @param text OpenPGP armored message part + * @returns An object with attribute "body" containing the body + * and an attribute "checksum" containing the checksum. + */ + function splitChecksum(text: string): object; + + /** + * DeArmor an OpenPGP armored message; verify the checksum and return + * the encoded bytes + * @param text OpenPGP armored message + * @returns An object with attribute "text" containing the message text, + * an attribute "data" containing a stream of bytes and "type" for the ASCII armor type + */ + function dearmor(text: string): Promise; + + /** + * Armor an OpenPGP binary packet block + * @param messagetype type of the message + * @param body + * @param partindex + * @param parttotal + * @param customComment (optional) additional comment to add to the armored string + * @returns Armored text + */ + function armor(messagetype: Integer, body: any, partindex: Integer, parttotal: Integer, customComment?: string): string | ReadableStream; + } + + namespace base64 { + /** + * Convert binary array to radix-64 + * @param t Uint8Array to convert + * @param u if true, output is URL-safe + * @returns radix-64 version of input string + */ + function s2r(t: Uint8Array | ReadableStream, u?: boolean): string | ReadableStream; + + /** + * Convert radix-64 to binary array + * @param t radix-64 string to convert + * @param u if true, input is interpreted as URL-safe + * @returns binary array version of input string + */ + function r2s(t: string | ReadableStream, u: boolean): Uint8Array | ReadableStream; + } +} + +export namespace enums { + /** + * Maps curve names under various standards to one + * @see + */ + enum curve { + /** + * NIST P-256 Curve + */ + p256 = "p256", + "P-256" = "p256", + secp256r1 = "p256", + prime256v1 = "p256", + "1.2.840.10045.3.1.7" = "p256", + "2a8648ce3d030107" = "p256", + "2A8648CE3D030107" = "p256", + /** + * NIST P-384 Curve + */ + p384 = "p384", + "P-384" = "p384", + secp384r1 = "p384", + "1.3.132.0.34" = "p384", + "2b81040022" = "p384", + "2B81040022" = "p384", + /** + * NIST P-521 Curve + */ + p521 = "p521", + "P-521" = "p521", + secp521r1 = "p521", + "1.3.132.0.35" = "p521", + "2b81040023" = "p521", + "2B81040023" = "p521", + /** + * SECG SECP256k1 Curve + */ + secp256k1 = "secp256k1", + "1.3.132.0.10" = "secp256k1", + "2b8104000a" = "secp256k1", + "2B8104000A" = "secp256k1", + /** + * Ed25519 + */ + ED25519 = "ed25519", + ed25519 = "ed25519", + Ed25519 = "ed25519", + "1.3.6.1.4.1.11591.15.1" = "ed25519", + "2b06010401da470f01" = "ed25519", + "2B06010401DA470F01" = "ed25519", + /** + * Curve25519 + */ + X25519 = "curve25519", + cv25519 = "curve25519", + curve25519 = "curve25519", + Curve25519 = "curve25519", + "1.3.6.1.4.1.3029.1.5.1" = "curve25519", + "2b060104019755010501" = "curve25519", + "2B060104019755010501" = "curve25519", + /** + * BrainpoolP256r1 Curve + */ + brainpoolP256r1 = "brainpoolP256r1", + "1.3.36.3.3.2.8.1.1.7" = "brainpoolP256r1", + "2b2403030208010107" = "brainpoolP256r1", + "2B2403030208010107" = "brainpoolP256r1", + /** + * BrainpoolP384r1 Curve + */ + brainpoolP384r1 = "brainpoolP384r1", + "1.3.36.3.3.2.8.1.1.11" = "brainpoolP384r1", + "2b240303020801010b" = "brainpoolP384r1", + "2B240303020801010B" = "brainpoolP384r1", + /** + * BrainpoolP512r1 Curve + */ + brainpoolP512r1 = "brainpoolP512r1", + "1.3.36.3.3.2.8.1.1.13" = "brainpoolP512r1", + "2b240303020801010d" = "brainpoolP512r1", + "2B240303020801010D" = "brainpoolP512r1", + } + + /** + * A string to key specifier type + */ + enum s2k { + simple = 0, + salted = 1, + iterated = 3, + gnu = 101, + } + + /** + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.1|RFC4880bis-04, section 9.1} + */ + enum publicKey { + /** + * RSA (Encrypt or Sign) [HAC] + */ + rsa_encrypt_sign = 1, + /** + * RSA (Encrypt only) [HAC] + */ + rsa_encrypt = 2, + /** + * RSA (Sign only) [HAC] + */ + rsa_sign = 3, + /** + * Elgamal (Encrypt only) [ELGAMAL] [HAC] + */ + elgamal = 16, + /** + * DSA (Sign only) [FIPS186] [HAC] + */ + dsa = 17, + /** + * ECDH (Encrypt only) [RFC6637] + */ + ecdh = 18, + /** + * ECDSA (Sign only) [RFC6637] + */ + ecdsa = 19, + /** + * EdDSA (Sign only) + * [ {@link https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-04|Draft RFC}] + */ + eddsa = 22, + /** + * Reserved for AEDH + */ + aedh = 23, + /** + * Reserved for AEDSA + */ + aedsa = 24, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880, section 9.2} + */ + enum symmetric { + plaintext = 0, + /** + * Not implemented! + */ + idea = 1, + "3des" = 2, + tripledes = 2, + cast5 = 3, + blowfish = 4, + aes128 = 7, + aes192 = 8, + aes256 = 9, + twofish = 10, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-9.3|RFC4880, section 9.3} + */ + enum compression { + uncompressed = 0, + /** + * RFC1951 + */ + zip = 1, + /** + * RFC1950 + */ + zlib = 2, + bzip2 = 3, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC4880, section 9.4} + */ + enum hash { + md5 = 1, + sha1 = 2, + ripemd = 3, + sha256 = 8, + sha384 = 9, + sha512 = 10, + sha224 = 11, + } + + /** + * A list of hash names as accepted by webCrypto functions. + * {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest|Parameters, algo} + */ + enum webHash { + "SHA-1" = 2, + "SHA-256" = 8, + "SHA-384" = 9, + "SHA-512" = 10, + } + + /** + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-9.6|RFC4880bis-04, section 9.6} + */ + enum aead { + eax = 1, + ocb = 2, + experimental_gcm = 100, + } + + /** + * A list of packet types and numeric tags associated with them. + */ + enum packet { + publicKeyEncryptedSessionKey = 1, + signature = 2, + symEncryptedSessionKey = 3, + onePassSignature = 4, + secretKey = 5, + publicKey = 6, + secretSubkey = 7, + compressed = 8, + symmetricallyEncrypted = 9, + marker = 10, + literal = 11, + trust = 12, + userid = 13, + publicSubkey = 14, + userAttribute = 17, + symEncryptedIntegrityProtected = 18, + modificationDetectionCode = 19, + symEncryptedAEADProtected = 20, + } + + /** + * Data types in the literal packet + */ + enum literal { + /** + * Binary data 'b' + */ + binary = "", + /** + * Text data 't' + */ + text = "", + /** + * Utf8 data 'u' + */ + utf8 = "", + /** + * MIME message body part 'm' + */ + mime = "", + } + + /** + * One pass signature packet type + */ + enum signature { + /** + * 0x00: Signature of a binary document. + */ + binary = 0, + /** + * 0x01: Signature of a canonical text document. + * Canonicalyzing the document by converting line endings. + */ + text = 1, + /** + * 0x02: Standalone signature. + * This signature is a signature of only its own subpacket contents. + * It is calculated identically to a signature over a zero-lengh + * binary document. Note that it doesn't make sense to have a V3 + * standalone signature. + */ + standalone = 2, + /** + * 0x10: Generic certification of a User ID and Public-Key packet. + * The issuer of this certification does not make any particular + * assertion as to how well the certifier has checked that the owner + * of the key is in fact the person described by the User ID. + */ + cert_generic = 16, + /** + * 0x11: Persona certification of a User ID and Public-Key packet. + * The issuer of this certification has not done any verification of + * the claim that the owner of this key is the User ID specified. + */ + cert_persona = 17, + /** + * 0x12: Casual certification of a User ID and Public-Key packet. + * The issuer of this certification has done some casual + * verification of the claim of identity. + */ + cert_casual = 18, + /** + * 0x13: Positive certification of a User ID and Public-Key packet. + * The issuer of this certification has done substantial + * verification of the claim of identity. + * Most OpenPGP implementations make their "key signatures" as 0x10 + * certifications. Some implementations can issue 0x11-0x13 + * certifications, but few differentiate between the types. + */ + cert_positive = 19, + /** + * 0x30: Certification revocation signature + * This signature revokes an earlier User ID certification signature + * (signature class 0x10 through 0x13) or direct-key signature + * (0x1F). It should be issued by the same key that issued the + * revoked signature or an authorized revocation key. The signature + * is computed over the same data as the certificate that it + * revokes, and should have a later creation date than that + * certificate. + */ + cert_revocation = 48, + /** + * 0x18: Subkey Binding Signature + * This signature is a statement by the top-level signing key that + * indicates that it owns the subkey. This signature is calculated + * directly on the primary key and subkey, and not on any User ID or + * other packets. A signature that binds a signing subkey MUST have + * an Embedded Signature subpacket in this binding signature that + * contains a 0x19 signature made by the signing subkey on the + * primary key and subkey. + */ + subkey_binding = 24, + /** + * 0x19: Primary Key Binding Signature + * This signature is a statement by a signing subkey, indicating + * that it is owned by the primary key and subkey. This signature + * is calculated the same way as a 0x18 signature: directly on the + * primary key and subkey, and not on any User ID or other packets. + * When a signature is made over a key, the hash data starts with the + * octet 0x99, followed by a two-octet length of the key, and then body + * of the key packet. (Note that this is an old-style packet header for + * a key packet with two-octet length.) A subkey binding signature + * (type 0x18) or primary key binding signature (type 0x19) then hashes + * the subkey using the same format as the main key (also using 0x99 as + * the first octet). + */ + key_binding = 25, + /** + * 0x1F: Signature directly on a key + * This signature is calculated directly on a key. It binds the + * information in the Signature subpackets to the key, and is + * appropriate to be used for subpackets that provide information + * about the key, such as the Revocation Key subpacket. It is also + * appropriate for statements that non-self certifiers want to make + * about the key itself, rather than the binding between a key and a + * name. + */ + key = 31, + /** + * 0x20: Key revocation signature + * The signature is calculated directly on the key being revoked. A + * revoked key is not to be used. Only revocation signatures by the + * key being revoked, or by an authorized revocation key, should be + * considered valid revocation signatures.a + */ + key_revocation = 32, + /** + * 0x28: Subkey revocation signature + * The signature is calculated directly on the subkey being revoked. + * A revoked subkey is not to be used. Only revocation signatures + * by the top-level signature key that is bound to this subkey, or + * by an authorized revocation key, should be considered valid + * revocation signatures. + * Key revocation signatures (types 0x20 and 0x28) + * hash only the key being revoked. + */ + subkey_revocation = 40, + /** + * 0x40: Timestamp signature. + * This signature is only meaningful for the timestamp contained in + * it. + */ + timestamp = 64, + /** + * 0x50: Third-Party Confirmation signature. + * This signature is a signature over some other OpenPGP Signature + * packet(s). It is analogous to a notary seal on the signed data. + * A third-party signature SHOULD include Signature Target + * subpacket(s) to give easy identification. Note that we really do + * mean SHOULD. There are plausible uses for this (such as a blind + * party that only sees the signature, not the key or source + * document) that cannot include a target subpacket. + */ + third_party = 80, + } + + /** + * Signature subpacket type + */ + enum signatureSubpacket { + signature_creation_time = 2, + signature_expiration_time = 3, + exportable_certification = 4, + trust_signature = 5, + regular_expression = 6, + revocable = 7, + key_expiration_time = 9, + placeholder_backwards_compatibility = 10, + preferred_symmetric_algorithms = 11, + revocation_key = 12, + issuer = 16, + notation_data = 20, + preferred_hash_algorithms = 21, + preferred_compression_algorithms = 22, + key_server_preferences = 23, + preferred_key_server = 24, + primary_user_id = 25, + policy_uri = 26, + key_flags = 27, + signers_user_id = 28, + reason_for_revocation = 29, + features = 30, + signature_target = 31, + embedded_signature = 32, + issuer_fingerprint = 33, + preferred_aead_algorithms = 34, + } + + /** + * Key flags + */ + enum keyFlags { + /** + * 0x01 - This key may be used to certify other keys. + */ + certify_keys = 1, + /** + * 0x02 - This key may be used to sign data. + */ + sign_data = 2, + /** + * 0x04 - This key may be used to encrypt communications. + */ + encrypt_communication = 4, + /** + * 0x08 - This key may be used to encrypt storage. + */ + encrypt_storage = 8, + /** + * 0x10 - The private component of this key may have been split + * by a secret-sharing mechanism. + */ + split_private_key = 16, + /** + * 0x20 - This key may be used for authentication. + */ + authentication = 32, + /** + * 0x80 - The private component of this key may be in the + * possession of more than one person. + */ + shared_private_key = 128, + } + + /** + * Key status + */ + enum keyStatus { + invalid = 0, + expired = 1, + revoked = 2, + valid = 3, + no_self_cert = 4, + } + + /** + * Armor type + */ + enum armor { + multipart_section = 0, + multipart_last = 1, + signed = 2, + message = 3, + public_key = 4, + private_key = 5, + signature = 6, + } + + /** + * {@link https://tools.ietf.org/html/rfc4880#section-5.2.3.23|RFC4880, section 5.2.3.23} + */ + enum reasonForRevocation { + /** + * No reason specified (key revocations or cert revocations) + */ + no_reason = 0, + /** + * Key is superseded (key revocations) + */ + key_superseded = 1, + /** + * Key material has been comPromised (key revocations) + */ + key_comPromised = 2, + /** + * Key is retired and no longer used (key revocations) + */ + key_retired = 3, + /** + * User ID information is no longer valid (cert revocations) + */ + userid_invalid = 32, + } + + /** + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.2.3.25|RFC4880bis-04, section 5.2.3.25} + */ + enum features { + /** + * 0x01 - Modification Detection (packets 18 and 19) + */ + modification_detection = 1, + /** + * 0x02 - AEAD Encrypted Data Packet (packet 20) and version 5 + * Symmetric-Key Encrypted Session Key Packets (packet 3) + */ + aead = 2, + /** + * 0x04 - Version 5 Public-Key Packet format and corresponding new + * fingerprint format + */ + v5_keys = 4, + } + + /** + * Asserts validity and converts from string/integer to integer. + */ + function write(): void; + + /** + * Converts from an integer to string. + */ + function read(): void; +} + +export namespace hkp { class HKP { /** * Initialize the HKP client and configure it with the key server url and fetch function. @@ -1624,557 +1595,301 @@ export namespace openpgp { */ upload(publicKeyArmored: string): Promise; } +} - namespace key { +export class HKP { + /** + * Initialize the HKP client and configure it with the key server url and fetch function. + * @param keyServerBaseUrl (optional) The HKP key server base url including + * the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to + * openpgp.config.keyserver (https://keyserver.ubuntu.com) + */ + constructor(keyServerBaseUrl: string); + + /** + * Search for a public key on the key server either by key ID or part of the user ID. + * @param options.keyID The long public key ID. + * @param options.query This can be any part of the key user ID such as name + * or email address. + * @returns The ascii armored public key. + */ + lookup(): Promise; + + /** + * Upload a public key to the server. + * @param publicKeyArmored An ascii armored public key to be uploaded. + * @returns + */ + upload(publicKeyArmored: string): Promise; +} + +export namespace key { + /** + * Class that represents an OpenPGP key. Must contain a primary key. + * Can contain additional subkeys, signatures, user ids, user attributes. + */ + class Key { /** - * Class that represents an OpenPGP key. Must contain a primary key. - * Can contain additional subkeys, signatures, user ids, user attributes. + * @param packetlist The packets that form this key */ - class Key { - /** - * @param packetlist The packets that form this key - */ - constructor(packetlist: packet.List); - - /** - * Transforms packetlist to structured key data - * @param packetlist The packets that form a key - */ - packetlist2structure(packetlist: packet.List): void; - - /** - * Transforms structured key data to packetlist - * @returns The packets that form a key - */ - toPacketlist(): packet.List; - - /** - * Returns an array containing all public or private subkeys matching keyId; - * If keyId is not present, returns all subkeys. - * @param keyId - * @returns - */ - getSubkeys(keyId: type.keyid.Keyid): any[]; - - /** - * Returns an array containing all public or private keys matching keyId. - * If keyId is not present, returns all keys starting with the primary key. - * @param keyId - * @returns - */ - getKeys(keyId: type.keyid.Keyid): any[]; - - /** - * Returns key IDs of all keys - * @returns - */ - getKeyIds(): any[]; - - /** - * Returns userids - * @returns array of userids - */ - getUserIds(): any[]; - - /** - * Returns true if this is a public key - * @returns - */ - isPublic(): boolean; - - /** - * Returns true if this is a private key - * @returns - */ - isPrivate(): boolean; - - /** - * Returns key as public key (shallow copy) - * @returns new public Key - */ - toPublic(): Key; - - /** - * Returns ASCII armored text of key - * @returns ASCII armor - */ - armor(): ReadableStream; - - /** - * Returns last created key or key by given keyId that is available for signing and verification - * @param keyId, optional - * @param date (optional) use the given date for verification instead of the current time - * @param userId, optional user ID - * @returns key or null if no signing key has been found - */ - getSigningKey(keyId: type.keyid.Keyid, date?: Date, userId?: object): Promise; - - /** - * Returns last created key or key by given keyId that is available for encryption or decryption - * @param keyId, optional - * @param date, optional - * @param userId, optional - * @returns key or null if no encryption key has been found - */ - getEncryptionKey(keyId?: type.keyid.Keyid, date?: Date, userId?: string): Promise; - - /** - * Encrypts all secret key and subkey packets matching keyId - * @param passphrases - if multiple passphrases, then should be in same order as packets each should encrypt - * @param keyId - * @returns - */ - encrypt(passphrases: string | any[], keyId?: type.keyid.Keyid): Promise>; - - /** - * Decrypts all secret key and subkey packets matching keyId - * @param passphrases - * @param keyId - * @returns true if all matching key and subkey packets decrypted successfully - */ - decrypt(passphrases: string | string[], keyId?: type.keyid.Keyid): Promise; - - /** - * Checks if a signature on a key is revoked - * @param - * @param signature The signature to verify - * @param key, optional The key to verify the signature - * @param date Use the given date instead of the current time - * @returns True if the certificate is revoked - */ - isRevoked(signature: packet.Signature, key?: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date?: Date): Promise; - - /** - * Verify primary key. Checks for revocation signatures, expiration time - * and valid self signature - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID - * @returns The status of the primary key - */ - verifyPrimaryKey(date?: Date, userId?: object): Promise; - - /** - * Returns the latest date when the key can be used for encrypting, signing, or both, depending on the `capabilities` paramater. - * When `capabilities` is null, defaults to returning the expiry date of the primary key. - * Returns null if `capabilities` is passed and the key does not have the specified capabilities or is revoked or invalid. - * Returns Infinity if the key doesn't expire. - * @param {encrypt | sign | encrypt_sign} capabilities, optional - * @param keyId, optional - * @param userId, optional user ID - * @returns - */ - getExpirationTime(capabilities: any, keyId: type.keyid.Keyid, userId: object): Promise; - - /** - * Returns primary user and most significant (latest valid) self signature - * - if multiple primary users exist, returns the one with the latest self signature - * - otherwise, returns the user with the latest self signature - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID to get instead of the primary user, if it exists - * @returns The primary user and the self signature - */ - getPrimaryUser(date: Date, userId: object): Promise<{ user: User, selfCertification: packet.Signature }>; - - /** - * Update key with new components from specified key with same key ID: - * users, subkeys, certificates are merged into the destination key, - * duplicates and expired signatures are ignored. - * If the specified key is a private key and the destination key is public, - * the destination key is transformed to a private key. - * @param key Source key to merge - * @returns - */ - update(key: Key): Promise; - - /** - * Revokes the key - * @param reasonForRevocation optional, object indicating the reason for revocation - * @param reasonForRevocation.flag optional, flag indicating the reason for revocation - * @param reasonForRevocation.string optional, string explaining the reason for revocation - * @param date optional, override the creationtime of the revocation signature - * @returns new key with revocation signature - */ - revoke(reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; - - /** - * Get revocation certificate from a revoked key. - * (To get a revocation certificate for an unrevoked key, call revoke() first.) - * @returns armored revocation certificate - */ - getRevocationCertificate(): Promise; - - /** - * Applies a revocation certificate to a key - * This adds the first signature packet in the armored text to the key, - * if it is a valid revocation signature. - * @param revocationCertificate armored revocation certificate - * @returns new revoked key - */ - applyRevocationCertificate(revocationCertificate: string): Promise; - - /** - * Signs primary user of key - * @param privateKey decrypted private keys for signing - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID to get instead of the primary user, if it exists - * @returns new public key with new certificate signature - */ - signPrimaryUser(privateKey: any[], date: Date, userId: object): Promise; - - /** - * Signs all users of key - * @param privateKeys decrypted private keys for signing - * @returns new public key with new certificate signature - */ - signAllUsers(privateKeys: any[]): Promise; - - /** - * Verifies primary user of key - * - if no arguments are given, verifies the self certificates; - * - otherwise, verifies all certificates signed with given keys. - * @param keys array of keys to verify certificate signatures - * @param date (optional) use the given date for verification instead of the current time - * @param userId (optional) user ID to get instead of the primary user, if it exists - * @returns List of signer's keyid and validity of signature - */ - verifyPrimaryUser(keys: any[], date: Date, userId: object): Promise>; - - /** - * Verifies all users of key - * - if no arguments are given, verifies the self certificates; - * - otherwise, verifies all certificates signed with given keys. - * @param keys array of keys to verify certificate signatures - * @returns list of userid, signer's keyid and validity of signature - */ - verifyAllUsers(keys: any[]): Promise>; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - } + constructor(packetlist: packet.List); /** - * Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future. - * @param signatures List of signatures - * @param date Use the given date instead of the current time - * @returns The latest valid signature + * Transforms packetlist to structured key data + * @param packetlist The packets that form a key */ - function getLatestValidSignature(signatures: any[], date: Date): Promise; + packetlist2structure(packetlist: packet.List): void; /** - * Class that represents an user ID or attribute packet and the relevant signatures. + * Transforms structured key data to packetlist + * @returns The packets that form a key */ - class User { - constructor(); - - /** - * Transforms structured user data to packetlist - * @returns - */ - toPacketlist(): packet.List; - - /** - * Signs user - * @param primaryKey The primary key packet - * @param privateKeys Decrypted private keys for signing - * @returns New user with new certificate signatures - */ - sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; - - /** - * Checks if a given certificate of the user is revoked - * @param primaryKey The primary key packet - * @param certificate The certificate to verify - * @param key, optional The key to verify the signature - * @param date Use the given date instead of the current time - * @returns True if the certificate is revoked - */ - isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; - - /** - * Verifies the user certificate - * @param primaryKey The primary key packet - * @param certificate A certificate of this user - * @param keys Array of keys to verify certificate signatures - * @param date Use the given date instead of the current time - * @returns status of the certificate - */ - verifyCertificate(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, keys: any[], date: Date): Promise; - - /** - * Verifies all user certificates - * @param primaryKey The primary key packet - * @param keys Array of keys to verify certificate signatures - * @param date Use the given date instead of the current time - * @returns List of signer's keyid and validity of signature - */ - verifyAllCertifications(primaryKey: packet.SecretKey | packet.PublicKey, keys: any[], date: Date): Promise>; - - /** - * Verify User. Checks for existence of self signatures, revocation signatures - * and validity of self signature - * @param primaryKey The primary key packet - * @param date Use the given date instead of the current time - * @returns Status of user - */ - verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; - - /** - * Update user with new components from specified user - * @param user Source user to merge - * @param primaryKey primary key used for validation - * @returns - */ - update(user: User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; - } + toPacketlist(): packet.List; /** - * Create signature packet - * @param dataToSign Contains packets to be signed - * @param signingKeyPacket secret key packet for signing - * @param signatureProperties (optional) properties to write on the signature packet before signing - * @param date (optional) override the creationtime of the signature - * @param userId (optional) user ID - * @returns signature packet - */ - function createSignaturePacket(dataToSign: object, signingKeyPacket: packet.SecretKey | packet.SecretSubkey, signatureProperties: object, date: Date, userId: object): packet.Signature; - - /** - * Class that represents a subkey packet and the relevant signatures. - */ - class SubKey { - constructor(); - - /** - * Transforms structured subkey data to packetlist - * @returns - */ - toPacketlist(): packet.List; - - /** - * Checks if a binding signature of a subkey is revoked - * @param primaryKey The primary key packet - * @param signature The binding signature to verify - * @param key, optional The key to verify the signature - * @param date Use the given date instead of the current time - * @returns True if the binding signature is revoked - */ - isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; - - /** - * Verify subkey. Checks for revocation signatures, expiration time - * and valid binding signature - * @param primaryKey The primary key packet - * @param date Use the given date instead of the current time - * @returns The status of the subkey - */ - verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; - - /** - * Returns the expiration time of the subkey or Infinity if key does not expire - * Returns null if the subkey is invalid. - * @param primaryKey The primary key packet - * @param date Use the given date instead of the current time - * @returns - */ - getExpirationTime(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; - - /** - * Update subkey with new components from specified subkey - * @param subKey Source subkey to merge - * @param primaryKey primary key used for validation - * @returns - */ - update(subKey: SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; - - /** - * Revokes the subkey - * @param primaryKey decrypted private primary key for revocation - * @param reasonForRevocation optional, object indicating the reason for revocation - * @param reasonForRevocation.flag optional, flag indicating the reason for revocation - * @param reasonForRevocation.string optional, string explaining the reason for revocation - * @param date optional, override the creationtime of the revocation signature - * @returns new subkey with revocation signature - */ - revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - } - - /** - * Reads an unarmored OpenPGP key list and returns one or multiple key objects - * @param data to be parsed - * @returns result object with key and error arrays - */ - function read(data: Uint8Array): Promise<{ keys: Array, err: Array | null }>; - - interface KeyResult { keys: Array, err: Array | null } - - /** - * Reads an OpenPGP armored text and returns one or multiple key objects - * @param armoredText text to be parsed - * @returns result object with key and error arrays - */ - function readArmored(armoredText: string | ReadableStream): Promise; - - /** - * Generates a new OpenPGP key. Supports RSA and ECC keys. - * Primary and subkey will be of same type. - * @param options.keyType To indicate what type of key to make. - * RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1} - * @param options.numBits number of bits for the key creation. - * @param options.userIds Assumes already in form of "User Name " - * If array is used, the first userId is set as primary user Id - * @param options.passphrase The passphrase used to encrypt the resulting private key - * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires - * @param curve (optional) elliptic curve for ECC keys - * @param date Override the creation date of the key and the key signatures - * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] - * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt + * Returns an array containing all public or private subkeys matching keyId; + * If keyId is not present, returns all subkeys. + * @param keyId * @returns */ - function generate(options: KeyOptions): Promise; + getSubkeys(keyId: type.keyid.Keyid): any[]; /** - * Reformats and signs an OpenPGP key with a given User ID. Currently only supports RSA keys. - * @param options.privateKey The private key to reformat - * @param options.keyType - * @param options.userIds Assumes already in form of "User Name " - * If array is used, the first userId is set as primary user Id - * @param options.passphrase The passphrase used to encrypt the resulting private key - * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires - * @param date Override the creation date of the key and the key signatures - * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * Returns an array containing all public or private keys matching keyId. + * If keyId is not present, returns all keys starting with the primary key. + * @param keyId * @returns */ - function reformat(date: Date, subkeys: any[]): Promise; + getKeys(keyId: type.keyid.Keyid): any[]; /** - * Checks if a given certificate or binding signature is revoked - * @param primaryKey The primary key packet - * @param dataToVerify The data to check - * @param revocations The revocation signatures to check - * @param signature The certificate or signature to check - * @param key, optional The key packet to check the signature + * Returns key IDs of all keys + * @returns + */ + getKeyIds(): any[]; + + /** + * Returns userids + * @returns array of userids + */ + getUserIds(): any[]; + + /** + * Returns true if this is a public key + * @returns + */ + isPublic(): boolean; + + /** + * Returns true if this is a private key + * @returns + */ + isPrivate(): boolean; + + /** + * Returns key as public key (shallow copy) + * @returns new public Key + */ + toPublic(): Key; + + /** + * Returns ASCII armored text of key + * @returns ASCII armor + */ + armor(): ReadableStream; + + /** + * Returns last created key or key by given keyId that is available for signing and verification + * @param keyId, optional + * @param date (optional) use the given date for verification instead of the current time + * @param userId, optional user ID + * @returns key or null if no signing key has been found + */ + getSigningKey(keyId: type.keyid.Keyid, date?: Date, userId?: object): Promise; + + /** + * Returns last created key or key by given keyId that is available for encryption or decryption + * @param keyId, optional + * @param date, optional + * @param userId, optional + * @returns key or null if no encryption key has been found + */ + getEncryptionKey(keyId?: type.keyid.Keyid, date?: Date, userId?: string): Promise; + + /** + * Encrypts all secret key and subkey packets matching keyId + * @param passphrases - if multiple passphrases, then should be in same order as packets each should encrypt + * @param keyId + * @returns + */ + encrypt(passphrases: string | any[], keyId?: type.keyid.Keyid): Promise>; + + /** + * Decrypts all secret key and subkey packets matching keyId + * @param passphrases + * @param keyId + * @returns true if all matching key and subkey packets decrypted successfully + */ + decrypt(passphrases: string | string[], keyId?: type.keyid.Keyid): Promise; + + /** + * Checks if a signature on a key is revoked + * @param + * @param signature The signature to verify + * @param key, optional The key to verify the signature * @param date Use the given date instead of the current time - * @returns True if the signature revokes the data + * @returns True if the certificate is revoked */ - function isDataRevoked(primaryKey: packet.SecretKey | packet.PublicKey, dataToVerify: object, revocations: any[], signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + isRevoked(signature: packet.Signature, key?: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date?: Date): Promise; /** - * Check if signature has revocation key sub packet (not supported by OpenPGP.js) - * and throw error if found - * @param signature The certificate or signature to check - * @param keyId Check only certificates or signatures from a certain issuer key ID - */ - function checkRevocationKey(signature: packet.Signature, keyId: type.keyid.Keyid): void; - - /** - * Returns the preferred signature hash algorithm of a key - * @param key (optional) the key to get preferences from - * @param keyPacket key packet used for signing + * Verify primary key. Checks for revocation signatures, expiration time + * and valid self signature * @param date (optional) use the given date for verification instead of the current time * @param userId (optional) user ID + * @returns The status of the primary key + */ + verifyPrimaryKey(date?: Date, userId?: object): Promise; + + /** + * Returns the latest date when the key can be used for encrypting, signing, or both, depending on the `capabilities` paramater. + * When `capabilities` is null, defaults to returning the expiry date of the primary key. + * Returns null if `capabilities` is passed and the key does not have the specified capabilities or is revoked or invalid. + * Returns Infinity if the key doesn't expire. + * @param {encrypt | sign | encrypt_sign} capabilities, optional + * @param keyId, optional + * @param userId, optional user ID * @returns */ - function getPreferredHashAlgo(key: Key, keyPacket: packet.SecretKey | packet.SecretSubkey, date: Date, userId: object): Promise; + getExpirationTime(capabilities: any, keyId: type.keyid.Keyid, userId: object): Promise; /** - * Returns the preferred symmetric/aead algorithm for a set of keys - * @param {symmetric | aead} type Type of preference to return - * @param keys Set of keys + * Returns primary user and most significant (latest valid) self signature + * - if multiple primary users exist, returns the one with the latest self signature + * - otherwise, returns the user with the latest self signature * @param date (optional) use the given date for verification instead of the current time - * @param userIds (optional) user IDs - * @returns Preferred symmetric algorithm + * @param userId (optional) user ID to get instead of the primary user, if it exists + * @returns The primary user and the self signature */ - function getPreferredAlgo(type: any, keys: any[], date: Date, userIds: any[]): Promise; + getPrimaryUser(date: Date, userId: object): Promise<{ user: User, selfCertification: packet.Signature }>; /** - * Returns whether aead is supported by all keys in the set - * @param keys Set of keys - * @param date (optional) use the given date for verification instead of the current time - * @param userIds (optional) user IDs + * Update key with new components from specified key with same key ID: + * users, subkeys, certificates are merged into the destination key, + * duplicates and expired signatures are ignored. + * If the specified key is a private key and the destination key is public, + * the destination key is transformed to a private key. + * @param key Source key to merge * @returns */ - function isAeadSupported(keys: any[], date: Date, userIds: any[]): Promise; + update(key: Key): Promise; + + /** + * Revokes the key + * @param reasonForRevocation optional, object indicating the reason for revocation + * @param reasonForRevocation.flag optional, flag indicating the reason for revocation + * @param reasonForRevocation.string optional, string explaining the reason for revocation + * @param date optional, override the creationtime of the revocation signature + * @returns new key with revocation signature + */ + revoke(reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; + + /** + * Get revocation certificate from a revoked key. + * (To get a revocation certificate for an unrevoked key, call revoke() first.) + * @returns armored revocation certificate + */ + getRevocationCertificate(): Promise; + + /** + * Applies a revocation certificate to a key + * This adds the first signature packet in the armored text to the key, + * if it is a valid revocation signature. + * @param revocationCertificate armored revocation certificate + * @returns new revoked key + */ + applyRevocationCertificate(revocationCertificate: string): Promise; + + /** + * Signs primary user of key + * @param privateKey decrypted private keys for signing + * @param date (optional) use the given date for verification instead of the current time + * @param userId (optional) user ID to get instead of the primary user, if it exists + * @returns new public key with new certificate signature + */ + signPrimaryUser(privateKey: any[], date: Date, userId: object): Promise; + + /** + * Signs all users of key + * @param privateKeys decrypted private keys for signing + * @returns new public key with new certificate signature + */ + signAllUsers(privateKeys: any[]): Promise; + + /** + * Verifies primary user of key + * - if no arguments are given, verifies the self certificates; + * - otherwise, verifies all certificates signed with given keys. + * @param keys array of keys to verify certificate signatures + * @param date (optional) use the given date for verification instead of the current time + * @param userId (optional) user ID to get instead of the primary user, if it exists + * @returns List of signer's keyid and validity of signature + */ + verifyPrimaryUser(keys: any[], date: Date, userId: object): Promise>; + + /** + * Verifies all users of key + * - if no arguments are given, verifies the self certificates; + * - otherwise, verifies all certificates signed with given keys. + * @param keys array of keys to verify certificate signatures + * @returns list of userid, signer's keyid and validity of signature + */ + verifyAllUsers(keys: any[]): Promise>; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; } - interface revoke_reasonForRevocation { - /** - * optional, flag indicating the reason for revocation - */ - flag: enums.reasonForRevocation; - /** - * optional, string explaining the reason for revocation - */ - string: string; - } + /** + * Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future. + * @param signatures List of signatures + * @param date Use the given date instead of the current time + * @returns The latest valid signature + */ + function getLatestValidSignature(signatures: any[], date: Date): Promise; /** * Class that represents an user ID or attribute packet and the relevant signatures. @@ -2194,7 +1909,7 @@ export namespace openpgp { * @param privateKeys Decrypted private keys for signing * @returns New user with new certificate signatures */ - sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; + sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; /** * Checks if a given certificate of the user is revoked @@ -2240,9 +1955,20 @@ export namespace openpgp { * @param primaryKey primary key used for validation * @returns */ - update(user: key.User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; + update(user: User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; } + /** + * Create signature packet + * @param dataToSign Contains packets to be signed + * @param signingKeyPacket secret key packet for signing + * @param signatureProperties (optional) properties to write on the signature packet before signing + * @param date (optional) override the creationtime of the signature + * @param userId (optional) user ID + * @returns signature packet + */ + function createSignaturePacket(dataToSign: object, signingKeyPacket: packet.SecretKey | packet.SecretSubkey, signatureProperties: object, date: Date, userId: object): packet.Signature; + /** * Class that represents a subkey packet and the relevant signatures. */ @@ -2289,7 +2015,7 @@ export namespace openpgp { * @param primaryKey primary key used for validation * @returns */ - update(subKey: key.SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; + update(subKey: SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; /** * Revokes the subkey @@ -2300,7 +2026,7 @@ export namespace openpgp { * @param date optional, override the creationtime of the revocation signature * @returns new subkey with revocation signature */ - revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; + revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; /** * Calculates the key id of the key @@ -2340,2895 +2066,3168 @@ export namespace openpgp { } /** - * @see module:keyring/keyring - * @see module:keyring/localstore + * Reads an unarmored OpenPGP key list and returns one or multiple key objects + * @param data to be parsed + * @returns result object with key and error arrays */ + function read(data: Uint8Array): Promise<{ keys: Array, err: Array | null }>; + + interface KeyResult { keys: Array, err: Array | null } + + /** + * Reads an OpenPGP armored text and returns one or multiple key objects + * @param armoredText text to be parsed + * @returns result object with key and error arrays + */ + function readArmored(armoredText: string | ReadableStream): Promise; + + /** + * Generates a new OpenPGP key. Supports RSA and ECC keys. + * Primary and subkey will be of same type. + * @param options.keyType To indicate what type of key to make. + * RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1} + * @param options.numBits number of bits for the key creation. + * @param options.userIds Assumes already in form of "User Name " + * If array is used, the first userId is set as primary user Id + * @param options.passphrase The passphrase used to encrypt the resulting private key + * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires + * @param curve (optional) elliptic curve for ECC keys + * @param date Override the creation date of the key and the key signatures + * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt + * @returns + */ + function generate(options: KeyOptions): Promise; + + /** + * Reformats and signs an OpenPGP key with a given User ID. Currently only supports RSA keys. + * @param options.privateKey The private key to reformat + * @param options.keyType + * @param options.userIds Assumes already in form of "User Name " + * If array is used, the first userId is set as primary user Id + * @param options.passphrase The passphrase used to encrypt the resulting private key + * @param options.keyExpirationTime The number of seconds after the key creation time that the key expires + * @param date Override the creation date of the key and the key signatures + * @param subkeys (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * @returns + */ + function reformat(date: Date, subkeys: any[]): Promise; + + /** + * Checks if a given certificate or binding signature is revoked + * @param primaryKey The primary key packet + * @param dataToVerify The data to check + * @param revocations The revocation signatures to check + * @param signature The certificate or signature to check + * @param key, optional The key packet to check the signature + * @param date Use the given date instead of the current time + * @returns True if the signature revokes the data + */ + function isDataRevoked(primaryKey: packet.SecretKey | packet.PublicKey, dataToVerify: object, revocations: any[], signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + + /** + * Check if signature has revocation key sub packet (not supported by OpenPGP.js) + * and throw error if found + * @param signature The certificate or signature to check + * @param keyId Check only certificates or signatures from a certain issuer key ID + */ + function checkRevocationKey(signature: packet.Signature, keyId: type.keyid.Keyid): void; + + /** + * Returns the preferred signature hash algorithm of a key + * @param key (optional) the key to get preferences from + * @param keyPacket key packet used for signing + * @param date (optional) use the given date for verification instead of the current time + * @param userId (optional) user ID + * @returns + */ + function getPreferredHashAlgo(key: Key, keyPacket: packet.SecretKey | packet.SecretSubkey, date: Date, userId: object): Promise; + + /** + * Returns the preferred symmetric/aead algorithm for a set of keys + * @param {symmetric | aead} type Type of preference to return + * @param keys Set of keys + * @param date (optional) use the given date for verification instead of the current time + * @param userIds (optional) user IDs + * @returns Preferred symmetric algorithm + */ + function getPreferredAlgo(type: any, keys: any[], date: Date, userIds: any[]): Promise; + + /** + * Returns whether aead is supported by all keys in the set + * @param keys Set of keys + * @param date (optional) use the given date for verification instead of the current time + * @param userIds (optional) user IDs + * @returns + */ + function isAeadSupported(keys: any[], date: Date, userIds: any[]): Promise; +} + +export interface revoke_reasonForRevocation { + /** + * optional, flag indicating the reason for revocation + */ + flag: enums.reasonForRevocation; + /** + * optional, string explaining the reason for revocation + */ + string: string; +} + +/** + * Class that represents an user ID or attribute packet and the relevant signatures. + */ +export class User { + constructor(); + + /** + * Transforms structured user data to packetlist + * @returns + */ + toPacketlist(): packet.List; + + /** + * Signs user + * @param primaryKey The primary key packet + * @param privateKeys Decrypted private keys for signing + * @returns New user with new certificate signatures + */ + sign(primaryKey: packet.SecretKey | packet.PublicKey, privateKeys: any[]): Promise; + + /** + * Checks if a given certificate of the user is revoked + * @param primaryKey The primary key packet + * @param certificate The certificate to verify + * @param key, optional The key to verify the signature + * @param date Use the given date instead of the current time + * @returns True if the certificate is revoked + */ + isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + + /** + * Verifies the user certificate + * @param primaryKey The primary key packet + * @param certificate A certificate of this user + * @param keys Array of keys to verify certificate signatures + * @param date Use the given date instead of the current time + * @returns status of the certificate + */ + verifyCertificate(primaryKey: packet.SecretKey | packet.PublicKey, certificate: packet.Signature, keys: any[], date: Date): Promise; + + /** + * Verifies all user certificates + * @param primaryKey The primary key packet + * @param keys Array of keys to verify certificate signatures + * @param date Use the given date instead of the current time + * @returns List of signer's keyid and validity of signature + */ + verifyAllCertifications(primaryKey: packet.SecretKey | packet.PublicKey, keys: any[], date: Date): Promise>; + + /** + * Verify User. Checks for existence of self signatures, revocation signatures + * and validity of self signature + * @param primaryKey The primary key packet + * @param date Use the given date instead of the current time + * @returns Status of user + */ + verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; + + /** + * Update user with new components from specified user + * @param user Source user to merge + * @param primaryKey primary key used for validation + * @returns + */ + update(user: key.User, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; +} + +/** + * Class that represents a subkey packet and the relevant signatures. + */ +export class SubKey { + constructor(); + + /** + * Transforms structured subkey data to packetlist + * @returns + */ + toPacketlist(): packet.List; + + /** + * Checks if a binding signature of a subkey is revoked + * @param primaryKey The primary key packet + * @param signature The binding signature to verify + * @param key, optional The key to verify the signature + * @param date Use the given date instead of the current time + * @returns True if the binding signature is revoked + */ + isRevoked(primaryKey: packet.SecretKey | packet.PublicKey, signature: packet.Signature, key: packet.PublicSubkey | packet.SecretSubkey | packet.PublicKey | packet.SecretKey, date: Date): Promise; + + /** + * Verify subkey. Checks for revocation signatures, expiration time + * and valid binding signature + * @param primaryKey The primary key packet + * @param date Use the given date instead of the current time + * @returns The status of the subkey + */ + verify(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; + + /** + * Returns the expiration time of the subkey or Infinity if key does not expire + * Returns null if the subkey is invalid. + * @param primaryKey The primary key packet + * @param date Use the given date instead of the current time + * @returns + */ + getExpirationTime(primaryKey: packet.SecretKey | packet.PublicKey, date: Date): Promise; + + /** + * Update subkey with new components from specified subkey + * @param subKey Source subkey to merge + * @param primaryKey primary key used for validation + * @returns + */ + update(subKey: key.SubKey, primaryKey: packet.SecretKey | packet.SecretSubkey): Promise; + + /** + * Revokes the subkey + * @param primaryKey decrypted private primary key for revocation + * @param reasonForRevocation optional, object indicating the reason for revocation + * @param reasonForRevocation.flag optional, flag indicating the reason for revocation + * @param reasonForRevocation.string optional, string explaining the reason for revocation + * @param date optional, override the creationtime of the revocation signature + * @returns new subkey with revocation signature + */ + revoke(primaryKey: packet.SecretKey, reasonForRevocation: revoke_reasonForRevocation, date: Date): Promise; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; +} + +/** + * @see module:keyring/keyring + * @see module:keyring/localstore + */ +export namespace keyring { namespace keyring { - namespace keyring { - class Keyring { - /** - * Initialization routine for the keyring. - * @param storeHandler class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods - */ - constructor(storeHandler?: localstore.LocalStore); - - /** - * Calls the storeHandler to load the keys - */ - load(): void; - - /** - * Calls the storeHandler to save the keys - */ - store(): void; - - /** - * Clear the keyring - erase all the keys - */ - clear(): void; - - /** - * Searches the keyring for keys having the specified key id - * @param keyId provided as string of lowercase hex number - * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @param deep if true search also in subkeys - * @returns keys found or null - */ - getKeysForId(keyId: string, deep: boolean): any[] | null; - - /** - * Removes keys having the specified key id from the keyring - * @param keyId provided as string of lowercase hex number - * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @returns keys found or null - */ - removeKeysForId(keyId: string): any[] | null; - - /** - * Get all public and private keys - * @returns all keys - */ - getAllKeys(): any[]; - } + class Keyring { + /** + * Initialization routine for the keyring. + * @param storeHandler class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods + */ + constructor(storeHandler?: localstore.LocalStore); /** - * Array of keys - * @param keys The keys to store in this array + * Calls the storeHandler to load the keys */ - function KeyArray(keys: any[]): void; + load(): void; + + /** + * Calls the storeHandler to save the keys + */ + store(): void; + + /** + * Clear the keyring - erase all the keys + */ + clear(): void; + + /** + * Searches the keyring for keys having the specified key id + * @param keyId provided as string of lowercase hex number + * withouth 0x prefix (can be 16-character key ID or fingerprint) + * @param deep if true search also in subkeys + * @returns keys found or null + */ + getKeysForId(keyId: string, deep: boolean): any[] | null; + + /** + * Removes keys having the specified key id from the keyring + * @param keyId provided as string of lowercase hex number + * withouth 0x prefix (can be 16-character key ID or fingerprint) + * @returns keys found or null + */ + removeKeysForId(keyId: string): any[] | null; + + /** + * Get all public and private keys + * @returns all keys + */ + getAllKeys(): any[]; } - namespace localstore { - class LocalStore { - /** - * The class that deals with storage of the keyring. - * Currently the only option is to use HTML5 local storage. - * @param prefix prefix for itemnames in localstore - */ - constructor(prefix: string); - - /** - * Load the public keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPublic(): any[]; - - /** - * Load the private keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPrivate(): any[]; - - /** - * Saves the current state of the public keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePublic(keys: any[]): void; - - /** - * Saves the current state of the private keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePrivate(keys: any[]): void; - } - } + /** + * Array of keys + * @param keys The keys to store in this array + */ + function KeyArray(keys: any[]): void; } - class LocalStore { - /** - * The class that deals with storage of the keyring. - * Currently the only option is to use HTML5 local storage. - * @param prefix prefix for itemnames in localstore - */ - constructor(prefix: string); - - /** - * Load the public keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPublic(): any[]; - - /** - * Load the private keys from HTML5 local storage. - * @returns array of keys retrieved from localstore - */ - loadPrivate(): any[]; - - /** - * Saves the current state of the public keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePublic(keys: any[]): void; - - /** - * Saves the current state of the private keys to HTML5 local storage. - * The key array gets stringified using JSON - * @param keys array of keys to save in localstore - */ - storePrivate(keys: any[]): void; - } - - namespace message { - /** - * Class that represents an OpenPGP message. - * Can be an encrypted message, signed message, compressed message or literal message - */ - class Message { - packets: packet.List; + namespace localstore { + class LocalStore { + /** + * The class that deals with storage of the keyring. + * Currently the only option is to use HTML5 local storage. + * @param prefix prefix for itemnames in localstore + */ + constructor(prefix: string); /** - * @param packetlist The packets that form this message - * See {@link https://tools.ietf.org/html/rfc4880#section-11.3} + * Load the public keys from HTML5 local storage. + * @returns array of keys retrieved from localstore */ - constructor(packetlist: packet.List); + loadPublic(): any[]; /** - * Returns the key IDs of the keys to which the session key is encrypted - * @returns array of keyid objects + * Load the private keys from HTML5 local storage. + * @returns array of keys retrieved from localstore */ - getEncryptionKeyIds(): any[]; + loadPrivate(): any[]; /** - * Returns the key IDs of the keys that signed the message - * @returns array of keyid objects + * Saves the current state of the public keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore */ - getSigningKeyIds(): any[]; + storePublic(keys: any[]): void; /** - * Decrypt the message. Either a private key, a session key, or a password must be specified. - * @param privateKeys (optional) private keys with decrypted secret data - * @param passwords (optional) passwords used to decrypt - * @param sessionKeys (optional) session keys in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } - * @param streaming (optional) whether to process data as a stream - * @returns new message with decrypted content + * Saves the current state of the private keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore */ - decrypt(privateKeys?: any[], passwords?: any[], sessionKeys?: any[], streaming?: boolean): Promise; - - /** - * Decrypt encrypted session keys either with private keys or passwords. - * @param privateKeys (optional) private keys with decrypted secret data - * @param passwords (optional) passwords used to decrypt - * @returns array of object with potential sessionKey, algorithm pairs - */ - decryptSessionKeys(privateKeys?: any[], passwords?: any[]): Promise>; - - /** - * Get literal data that is the body of the message - * @returns literal body of the message as Uint8Array - */ - getLiteralData(): Uint8Array | null; - - /** - * Get filename from literal data packet - * @returns filename of literal data packet as string - */ - getFilename(): string | null; - - /** - * Get literal data as text - * @returns literal body of the message interpreted as text - */ - getText(): string | null; - - /** - * Encrypt the message either with public keys, passwords, or both at once. - * @param keys (optional) public key(s) for message encryption - * @param passwords (optional) password(s) for message encryption - * @param sessionKey (optional) session key in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } - * @param wildcard (optional) use a key ID of 0 instead of the public key IDs - * @param date (optional) override the creation date of the literal package - * @param userIds (optional) user IDs to encrypt for, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] - * @param streaming (optional) whether to process data as a stream - * @returns new message with encrypted content - */ - encrypt(keys?: any[], passwords?: any[], sessionKey?: object, wildcard?: boolean, date?: Date, userIds?: any[], streaming?: boolean): Promise; - - /** - * Sign the message (the literal data packet of the message) - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature to add to the message - * @param date (optional) override the creation time of the signature - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new message with signed content - */ - sign(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; - - /** - * Compresses the message (the literal and -if signed- signature data packets of the message) - * @param compression compression algorithm to be used - * @returns new message with compressed content - */ - compress(compression: enums.compression): Message; - - /** - * Create a detached signature for the message (the literal data packet of the message) - * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature - * @param date (optional) override the creation time of the signature - * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns new detached signature of message content - */ - signDetached(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; - - /** - * Verify message signatures - * @param keys array of keys to verify signatures - * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @param streaming (optional) whether to process data as a stream - * @returns list of signer's keyid and validity of signature - */ - verify(keys: any[], date?: Date, streaming?: boolean): Promise>; - - /** - * Verify detached message signature - * @param keys array of keys to verify signatures - * @param signature - * @param date Verify the signature against the given date, i.e. check signature creation time < date < expiration time - * @returns list of signer's keyid and validity of signature - */ - verifyDetached(keys: any[], signature: signature.Signature, date?: Date): Promise>; - - /** - * Unwrap compressed message - * @returns message Content of compressed message - */ - unwrapCompressed(): Message; - - /** - * Append signature to unencrypted message object - * @param detachedSignature The detached ASCII-armored or Uint8Array PGP signature - */ - appendSignature(detachedSignature: string | Uint8Array): void; - - /** - * Returns ASCII armored text of message - * @returns ASCII armor - */ - armor(): ReadableStream; + storePrivate(keys: any[]): void; } + } +} + +export class LocalStore { + /** + * The class that deals with storage of the keyring. + * Currently the only option is to use HTML5 local storage. + * @param prefix prefix for itemnames in localstore + */ + constructor(prefix: string); + + /** + * Load the public keys from HTML5 local storage. + * @returns array of keys retrieved from localstore + */ + loadPublic(): any[]; + + /** + * Load the private keys from HTML5 local storage. + * @returns array of keys retrieved from localstore + */ + loadPrivate(): any[]; + + /** + * Saves the current state of the public keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore + */ + storePublic(keys: any[]): void; + + /** + * Saves the current state of the private keys to HTML5 local storage. + * The key array gets stringified using JSON + * @param keys array of keys to save in localstore + */ + storePrivate(keys: any[]): void; +} + +export namespace message { + /** + * Class that represents an OpenPGP message. + * Can be an encrypted message, signed message, compressed message or literal message + */ + class Message { + packets: packet.List; /** - * Encrypt a session key either with public keys, passwords, or both at once. - * @param sessionKey session key for encryption - * @param symAlgo session key algorithm - * @param aeadAlgo (optional) aead algorithm, e.g. 'eax' or 'ocb' - * @param publicKeys (optional) public key(s) for message encryption - * @param passwords (optional) for message encryption + * @param packetlist The packets that form this message + * See {@link https://tools.ietf.org/html/rfc4880#section-11.3} + */ + constructor(packetlist: packet.List); + + /** + * Returns the key IDs of the keys to which the session key is encrypted + * @returns array of keyid objects + */ + getEncryptionKeyIds(): any[]; + + /** + * Returns the key IDs of the keys that signed the message + * @returns array of keyid objects + */ + getSigningKeyIds(): any[]; + + /** + * Decrypt the message. Either a private key, a session key, or a password must be specified. + * @param privateKeys (optional) private keys with decrypted secret data + * @param passwords (optional) passwords used to decrypt + * @param sessionKeys (optional) session keys in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } + * @param streaming (optional) whether to process data as a stream + * @returns new message with decrypted content + */ + decrypt(privateKeys?: any[], passwords?: any[], sessionKeys?: any[], streaming?: boolean): Promise; + + /** + * Decrypt encrypted session keys either with private keys or passwords. + * @param privateKeys (optional) private keys with decrypted secret data + * @param passwords (optional) passwords used to decrypt + * @returns array of object with potential sessionKey, algorithm pairs + */ + decryptSessionKeys(privateKeys?: any[], passwords?: any[]): Promise>; + + /** + * Get literal data that is the body of the message + * @returns literal body of the message as Uint8Array + */ + getLiteralData(): Uint8Array | null; + + /** + * Get filename from literal data packet + * @returns filename of literal data packet as string + */ + getFilename(): string | null; + + /** + * Get literal data as text + * @returns literal body of the message interpreted as text + */ + getText(): string | null; + + /** + * Encrypt the message either with public keys, passwords, or both at once. + * @param keys (optional) public key(s) for message encryption + * @param passwords (optional) password(s) for message encryption + * @param sessionKey (optional) session key in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] } * @param wildcard (optional) use a key ID of 0 instead of the public key IDs - * @param date (optional) override the date + * @param date (optional) override the creation date of the literal package * @param userIds (optional) user IDs to encrypt for, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] + * @param streaming (optional) whether to process data as a stream * @returns new message with encrypted content */ - function encryptSessionKey(sessionKey: Uint8Array, symAlgo: string, aeadAlgo: string, publicKeys: any[], passwords: any[], wildcard: boolean, date: Date, userIds: any[]): Promise; + encrypt(keys?: any[], passwords?: any[], sessionKey?: object, wildcard?: boolean, date?: Date, userIds?: any[], streaming?: boolean): Promise; /** - * Create signature packets for the message - * @param literalDataPacket the literal data packet to sign + * Sign the message (the literal data packet of the message) * @param privateKeys private keys with decrypted secret key data for signing - * @param signature (optional) any existing detached signature to append - * @param date (optional) override the creationtime of the signature + * @param signature (optional) any existing detached signature to add to the message + * @param date (optional) override the creation time of the signature * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - * @returns list of signature packets + * @returns new message with signed content */ - function createSignaturePackets(literalDataPacket: packet.Literal, privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + sign(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; /** - * Create object containing signer's keyid and validity of signature - * @param signature signature packets - * @param literalDataList array of literal data packets + * Compresses the message (the literal and -if signed- signature data packets of the message) + * @param compression compression algorithm to be used + * @returns new message with compressed content + */ + compress(compression: enums.compression): Message; + + /** + * Create a detached signature for the message (the literal data packet of the message) + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature + * @param date (optional) override the creation time of the signature + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns new detached signature of message content + */ + signDetached(privateKeys: any[], signature?: signature.Signature, date?: Date, userIds?: any[]): Promise; + + /** + * Verify message signatures * @param keys array of keys to verify signatures - * @param date Verify the signature against the given date, - * i.e. check signature creation time < date < expiration time + * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time + * @param streaming (optional) whether to process data as a stream * @returns list of signer's keyid and validity of signature */ - function createVerificationObject(signature: packet.Signature, literalDataList: any[], keys: any[], date: Date): Promise>; + verify(keys: any[], date?: Date, streaming?: boolean): Promise>; /** - * Create list of objects containing signer's keyid and validity of signature - * @param signatureList array of signature packets - * @param literalDataList array of literal data packets + * Verify detached message signature * @param keys array of keys to verify signatures - * @param date Verify the signature against the given date, - * i.e. check signature creation time < date < expiration time + * @param signature + * @param date Verify the signature against the given date, i.e. check signature creation time < date < expiration time * @returns list of signer's keyid and validity of signature */ - function createVerificationObjects(signatureList: any[], literalDataList: any[], keys: any[], date: Date): Promise>; + verifyDetached(keys: any[], signature: signature.Signature, date?: Date): Promise>; /** - * reads an OpenPGP armored message and returns a message object - * @param armoredText text to be parsed - * @returns new message object + * Unwrap compressed message + * @returns message Content of compressed message */ - function readArmored(armoredText: string | ReadableStream): Promise; + unwrapCompressed(): Message; /** - * reads an OpenPGP message as byte array and returns a message object - * @param input binary message - * @param fromStream whether the message was created from a Stream - * @returns new message object + * Append signature to unencrypted message object + * @param detachedSignature The detached ASCII-armored or Uint8Array PGP signature */ - function read(input: Uint8Array | ReadableStream, fromStream?: boolean): Promise; + appendSignature(detachedSignature: string | Uint8Array): void; /** - * creates new message object from text - * @param text - * @param filename (optional) - * @param date (optional) - * @param {utf8 | binary | text | mime} type (optional) data packet type - * @returns new message object + * Returns ASCII armored text of message + * @returns ASCII armor */ - function fromText(text: string | ReadableStream, filename?: string, date?: Date, type?: any): Message; - - /** - * creates new message object from binary data - * @param bytes - * @param filename (optional) - * @param date (optional) - * @param {utf8 | binary | text | mime} type (optional) data packet type - * @returns new message object - */ - function fromBinary(bytes: Uint8Array | ReadableStream, filename?: string, date?: Date, type?: any): Message; - } - - interface revokeKey_reasonForRevocation { - /** - * (optional) flag indicating the reason for revocation - */ - flag: enums.reasonForRevocation; - /** - * (optional) string explaining the reason for revocation - */ - string: string; + armor(): ReadableStream; } /** - * @see module:packet/all_packets - * @see module:packet/clone - * @see module:packet.List + * Encrypt a session key either with public keys, passwords, or both at once. + * @param sessionKey session key for encryption + * @param symAlgo session key algorithm + * @param aeadAlgo (optional) aead algorithm, e.g. 'eax' or 'ocb' + * @param publicKeys (optional) public key(s) for message encryption + * @param passwords (optional) for message encryption + * @param wildcard (optional) use a key ID of 0 instead of the public key IDs + * @param date (optional) override the date + * @param userIds (optional) user IDs to encrypt for, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] + * @returns new message with encrypted content */ + function encryptSessionKey(sessionKey: Uint8Array, symAlgo: string, aeadAlgo: string, publicKeys: any[], passwords: any[], wildcard: boolean, date: Date, userIds: any[]): Promise; + + /** + * Create signature packets for the message + * @param literalDataPacket the literal data packet to sign + * @param privateKeys private keys with decrypted secret key data for signing + * @param signature (optional) any existing detached signature to append + * @param date (optional) override the creationtime of the signature + * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + * @returns list of signature packets + */ + function createSignaturePackets(literalDataPacket: packet.Literal, privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise; + + /** + * Create object containing signer's keyid and validity of signature + * @param signature signature packets + * @param literalDataList array of literal data packets + * @param keys array of keys to verify signatures + * @param date Verify the signature against the given date, + * i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + function createVerificationObject(signature: packet.Signature, literalDataList: any[], keys: any[], date: Date): Promise>; + + /** + * Create list of objects containing signer's keyid and validity of signature + * @param signatureList array of signature packets + * @param literalDataList array of literal data packets + * @param keys array of keys to verify signatures + * @param date Verify the signature against the given date, + * i.e. check signature creation time < date < expiration time + * @returns list of signer's keyid and validity of signature + */ + function createVerificationObjects(signatureList: any[], literalDataList: any[], keys: any[], date: Date): Promise>; + + /** + * reads an OpenPGP armored message and returns a message object + * @param armoredText text to be parsed + * @returns new message object + */ + function readArmored(armoredText: string | ReadableStream): Promise; + + /** + * reads an OpenPGP message as byte array and returns a message object + * @param input binary message + * @param fromStream whether the message was created from a Stream + * @returns new message object + */ + function read(input: Uint8Array | ReadableStream, fromStream?: boolean): Promise; + + /** + * creates new message object from text + * @param text + * @param filename (optional) + * @param date (optional) + * @param {utf8 | binary | text | mime} type (optional) data packet type + * @returns new message object + */ + function fromText(text: string | ReadableStream, filename?: string, date?: Date, type?: any): Message; + + /** + * creates new message object from binary data + * @param bytes + * @param filename (optional) + * @param date (optional) + * @param {utf8 | binary | text | mime} type (optional) data packet type + * @returns new message object + */ + function fromBinary(bytes: Uint8Array | ReadableStream, filename?: string, date?: Date, type?: any): Message; +} + +export interface revokeKey_reasonForRevocation { + /** + * (optional) flag indicating the reason for revocation + */ + flag: enums.reasonForRevocation; + /** + * (optional) string explaining the reason for revocation + */ + string: string; +} + +/** + * @see module:packet/all_packets + * @see module:packet/clone + * @see module:packet.List + */ +export namespace packet { + /** + * Allocate a new packet + * @param tag property name from {@link module:enums.packet} + * @returns new packet object with type based on tag + */ + function newPacketFromTag(tag: string): object; + + /** + * Allocate a new packet from structured packet clone + * @see + * @param packetClone packet clone + * @returns new packet object with data from packet clone + */ + function fromStructuredClone(packetClone: object): object; + + class Compressed { + /** + * Implementation of the Compressed Data Packet (Tag 8) + * {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: + * The Compressed Data packet contains compressed data. Typically, + * this packet is found as the contents of an encrypted packet, or following + * a Signature or One-Pass Signature packet, and contains a literal data packet. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * List of packets + */ + packets: List; + + /** + * Compression algorithm + * @type {compression} + */ + algorithm: any; + + /** + * Compressed packet data + */ + compressed: Uint8Array | ReadableStream; + + /** + * Parsing function for the packet. + * @param bytes Payload of a tag 8 packet + */ + read(bytes: Uint8Array | ReadableStream): void; + + /** + * Return the compressed packet. + * @returns binary compressed packet + */ + write(): Uint8Array | ReadableStream; + + /** + * Decompression method for decompressing the compressed data + * read by read_packet + */ + decompress(): void; + + /** + * Compress the packet data (member decompressedData) + */ + compress(): void; + } + + class Literal { + /** + * Implementation of the Literal Data Packet (Tag 11) + * {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: + * A Literal Data packet contains the body of a message; data that is not to be + * further interpreted. + * @param date the creation date of the literal package + */ + constructor(date: Date); + + /** + * Set the packet data to a javascript native string, end of line + * will be normalized to \r\n and by default text is converted to UTF8 + * @param text Any native javascript string + * @param {utf8 | binary | text | mime} format (optional) The format of the string of bytes + */ + setText(text: string | ReadableStream, format: any): void; + + /** + * Returns literal data packets as native JavaScript string + * with normalized end of line to \n + * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again + * @returns literal data as text + */ + getText(clone: boolean): string | ReadableStream; + + /** + * Set the packet data to value represented by the provided string of bytes. + * @param bytes The string of bytes + * @param {utf8 | binary | text | mime} format The format of the string of bytes + */ + setBytes(bytes: Uint8Array | ReadableStream, format: any): void; + + /** + * Get the byte sequence representing the literal packet data + * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again + * @returns A sequence of bytes + */ + getBytes(clone: boolean): Uint8Array | ReadableStream; + + /** + * Sets the filename of the literal packet data + * @param filename Any native javascript string + */ + setFilename(filename: string): void; + + /** + * Get the filename of the literal packet data + * @returns filename + */ + getFilename(): string; + + /** + * Parsing function for a literal data packet (tag 11). + * @param input Payload of a tag 11 packet + * @returns object representation + */ + read(input: Uint8Array | ReadableStream): Literal; + + /** + * Creates a string representation of the packet + * @returns Uint8Array representation of the packet + */ + write(): Uint8Array | ReadableStream; + } + + class Marker { + /** + * Implementation of the strange "Marker packet" (Tag 10) + * {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: + * An experimental version of PGP used this packet as the Literal + * packet, but no released version of PGP generated Literal packets with this + * tag. With PGP 5.x, this packet has been reassigned and is reserved for use as + * the Marker packet. + * Such a packet MUST be ignored when received. + */ + constructor(); + + /** + * Parsing function for a literal data packet (tag 10). + * @param input Payload of a tag 10 packet + * @param position Position to start reading from the input string + * @param len Length of the packet or the remaining length of + * input at position + * @returns Object representation + */ + read(input: string, position: Integer, len: Integer): Marker; + } + + class OnePassSignature { + /** + * Implementation of the One-Pass Signature Packets (Tag 4) + * {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: + * The One-Pass Signature packet precedes the signed data and contains + * enough information to allow the receiver to begin calculating any + * hashes needed to verify the signature. It allows the Signature + * packet to be placed at the end of the message, so that the signer + * can compute the entire signed message in one pass. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * A one-octet version number. The current version is 3. + */ + version: any; + + /** + * A one-octet signature type. + * Signature types are described in + * {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}. + */ + signatureType: any; + + /** + * A one-octet number describing the hash algorithm used. + * @see + */ + hashAlgorithm: any; + + /** + * A one-octet number describing the public-key algorithm used. + * @see + */ + publicKeyAlgorithm: any; + + /** + * An eight-octet number holding the Key ID of the signing key. + */ + issuerKeyId: any; + + /** + * A one-octet number holding a flag showing whether the signature is nested. + * A zero value indicates that the next packet is another One-Pass Signature packet + * that describes another signature to be applied to the same message data. + */ + flags: any; + + /** + * parsing function for a one-pass signature packet (tag 4). + * @param bytes payload of a tag 4 packet + * @returns object representation + */ + read(bytes: Uint8Array): OnePassSignature; + + /** + * creates a string representation of a one-pass signature packet + * @returns a Uint8Array representation of a one-pass signature packet + */ + write(): Uint8Array; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class List { + /** + * This class represents a list of openpgp packets. + * Take care when iterating over it - the packets themselves + * are stored as numerical indices. + */ + constructor(); + + /** + * The number of packets contained within the list. + */ + readonly length: Integer; + + /** + * Reads a stream of binary data and interprents it as a list of packets. + * @param A Uint8Array of bytes. + */ + read(A: Uint8Array | ReadableStream): void; + + /** + * Creates a binary representation of openpgp objects contained within the + * class instance. + * @returns A Uint8Array containing valid openpgp packets. + */ + write(): Uint8Array; + + /** + * Adds a packet to the list. This is the only supported method of doing so; + * writing to packetlist[i] directly will result in an error. + * @param packet Packet to push + */ + push(packet: object): void; + + /** + * Creates a new PacketList with all packets from the given types + */ + filterByTag(): void; + + /** + * Traverses packet tree and returns first matching packet + * @param type The packet type + * @returns + */ + findPacket(type: enums.packet): List | undefined; + + /** + * Returns array of found indices by tag + */ + indexOfTag(): void; + + /** + * Concatenates packetlist or array of packets + */ + concat(): void; + + /** + * Allocate a new packetlist from structured packetlist clone + * See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data} + * @param packetClone packetlist clone + * @returns new packetlist object with data from packetlist clone + */ + static fromStructuredClone(packetClone: object): object; + } + + class PublicKey { + /** + * Implementation of the Key Material Packet (Tag 5,6,7,14) + * {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}: + * A key material packet contains all the information about a public or + * private key. There are four variants of this packet type, and two + * major versions. + * A Public-Key packet starts a series of packets that forms an OpenPGP + * key (sometimes called an OpenPGP certificate). + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} + * called by read_tag<num> + * @param bytes Input array to read the packet from + * @returns This object with attributes set by the parser + */ + read(bytes: Uint8Array): object; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Same as write_private_key, but has less information because of + * public key. + * @returns OpenPGP packet body contents, + */ + write(): Uint8Array; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class PublicKeyEncryptedSessionKey { + /** + * Public-Key Encrypted Session Key Packets (Tag 1) + * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: + * A Public-Key Encrypted Session Key packet holds the session key + * used to encrypt a message. Zero or more Public-Key Encrypted Session Key + * packets and/or Symmetric-Key Encrypted Session Key packets may precede a + * Symmetrically Encrypted Data Packet, which holds an encrypted message. The + * message is encrypted with the session key, and the session key is itself + * encrypted and stored in the Encrypted Session Key packet(s). The + * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted + * Session Key packet for each OpenPGP key to which the message is encrypted. + * The recipient of the message finds a session key that is encrypted to their + * public key, decrypts the session key, and then uses the session key to + * decrypt the message. + */ + constructor(); + + encrypted: any[]; + + /** + * Parsing function for a publickey encrypted session key packet (tag 1). + * @param input Payload of a tag 1 packet + * @param position Position to start reading from the input string + * @param len Length of the packet or the remaining length of + * input at position + * @returns Object representation + */ + read(input: Uint8Array, position: Integer, len: Integer): PublicKeyEncryptedSessionKey + + /** + * Create a string representation of a tag 1 packet + * @returns The Uint8Array representation + */ + write(): Uint8Array; + + /** + * Encrypt session key packet + * @param key Public key + * @returns + */ + encrypt(key: PublicKey): Promise; + + /** + * Decrypts the session key (only for public key encrypted session key + * packets (tag 1) + * @param key Private key with secret params unlocked + * @returns + */ + decrypt(key: SecretKey): Promise; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class PublicSubkey { + /** + * A Public-Subkey packet (tag 14) has exactly the same format as a + * Public-Key packet, but denotes a subkey. One or more subkeys may be + * associated with a top-level key. By convention, the top-level key + * provides signature services, and the subkeys provide encryption + * services. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} + * called by read_tag<num> + * @param bytes Input array to read the packet from + * @returns This object with attributes set by the parser + */ + read(bytes: Uint8Array): object; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Same as write_private_key, but has less information because of + * public key. + * @returns OpenPGP packet body contents, + */ + write(): Uint8Array; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class SecretKey { + /** + * A Secret-Key packet contains all the information that is found in a + * Public-Key packet, including the public-key material, but also + * includes the secret-key material after all the public-key fields. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Encrypted secret-key data + */ + encrypted: any; + + /** + * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. + */ + isEncrypted: any; + + /** + * Internal parser for private keys as specified in + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} + * @param bytes Input string to read the packet from + */ + read(bytes: string): void; + + /** + * Creates an OpenPGP key packet for the given key. + * @returns A string of bytes containing the secret key OpenPGP packet + */ + write(): string; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Encrypt the payload. By default, we use aes256 and iterated, salted string + * to key specifier. If the key is in a decrypted state (isEncrypted === false) + * and the passphrase is empty or undefined, the key will be set as not encrypted. + * This can be used to remove passphrase protection after calling decrypt(). + * @param passphrase + * @returns + */ + encrypt(passphrase: string): Promise; + + /** + * Decrypts the private key params which are needed to use the key. + * {@link module:packet.SecretKey.isDecrypted} should be false, as + * otherwise calls to this function will throw an error. + * @param passphrase The passphrase for this private key as string + * @returns + */ + decrypt(passphrase: string): Promise; + + /** + * Clear private params, return to initial state + */ + clearPrivateParams(): void; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + } + + class SecretSubkey { + /** + * A Secret-Subkey packet (tag 7) is the subkey analog of the Secret + * Key packet and has exactly the same format. + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Encrypted secret-key data + */ + encrypted: any; + + /** + * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. + */ + isEncrypted: any; + + /** + * Internal parser for private keys as specified in + * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} + * @param bytes Input string to read the packet from + */ + read(bytes: string): void; + + /** + * Creates an OpenPGP key packet for the given key. + * @returns A string of bytes containing the secret key OpenPGP packet + */ + write(): string; + + /** + * Check whether secret-key data is available in decrypted form. Returns null for public keys. + * @returns + */ + isDecrypted(): boolean | null; + + /** + * Encrypt the payload. By default, we use aes256 and iterated, salted string + * to key specifier. If the key is in a decrypted state (isEncrypted === false) + * and the passphrase is empty or undefined, the key will be set as not encrypted. + * This can be used to remove passphrase protection after calling decrypt(). + * @param passphrase + * @returns + */ + encrypt(passphrase: string): Promise; + + /** + * Decrypts the private key params which are needed to use the key. + * {@link module:packet.SecretKey.isDecrypted} should be false, as + * otherwise calls to this function will throw an error. + * @param passphrase The passphrase for this private key as string + * @returns + */ + decrypt(passphrase: string): Promise; + + /** + * Clear private params, return to initial state + */ + clearPrivateParams(): void; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + + /** + * Packet version + */ + version: Integer; + + /** + * Key creation date. + */ + created: Date; + + /** + * Public key algorithm. + */ + algorithm: string; + + /** + * Algorithm specific params + */ + params: object[]; + + /** + * Time until expiration in days (V3 only) + */ + expirationTimeV3: Integer; + + /** + * Fingerprint in lowercase hex + */ + fingerprint: string; + + /** + * Keyid + */ + keyid: type.keyid.Keyid; + + /** + * Alias of read() + * @see module:packet.PublicKey#read + */ + readPublicKey: any; + + /** + * Alias of write() + * @see module:packet.PublicKey#write + */ + writePublicKey: any; + + /** + * Write an old version packet - it's used by some of the internal routines. + */ + writeOld(): void; + + /** + * Returns the creation time of the key + * @returns + */ + getCreationTime(): Date; + + /** + * Calculates the key id of the key + * @returns A 8 byte key id + */ + getKeyId(): string; + + /** + * Calculates the fingerprint of the key + * @returns A Uint8Array containing the fingerprint + */ + getFingerprintBytes(): Uint8Array; + + /** + * Calculates the fingerprint of the key + * @returns A string containing the fingerprint in lowercase hex + */ + getFingerprint(): string; + + /** + * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint + * @returns Whether the two keys have the same version and public key data + */ + hasSameFingerprintAs(): boolean; + + /** + * Returns algorithm information + * @returns An object of the form {algorithm: string, bits:int, curve:String} + */ + getAlgorithmInfo(): object; + } + + class Signature { + /** + * Implementation of the Signature Packet (Tag 2) + * {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}: + * A Signature packet describes a binding between some public key and + * some data. The most common signatures are a signature of a file or a + * block of text, and a signature that is a certification of a User ID. + * @param date the creation date of the signature + */ + constructor(date: Date); + + /** + * parsing function for a signature packet (tag 2). + * @param bytes payload of a tag 2 packet + * @param position position to start reading from the bytes string + * @param len length of the packet or the remaining length of bytes at position + * @returns object representation + */ + read(bytes: string, position: Integer, len: Integer): Signature; + + /** + * Signs provided data. This needs to be done prior to serialization. + * @param key private key used to sign the message. + * @param data Contains packets to be signed. + * @returns + */ + sign(key: SecretKey, data: object): Promise; + + /** + * Creates Uint8Array of bytes of all subpacket data except Issuer and Embedded Signature subpackets + * @returns subpacket data + */ + write_hashed_sub_packets(): Uint8Array; + + /** + * Creates Uint8Array of bytes of Issuer and Embedded Signature subpackets + * @returns subpacket data + */ + write_unhashed_sub_packets(): Uint8Array; + + /** + * verifys the signature packet. Note: not signature types are implemented + * @param key the public key to verify the signature + * @param signatureType expected signature type + * @param data data which on the signature applies + * @returns True if message is verified, else false. + */ + verify(key: PublicSubkey | PublicKey | SecretSubkey | SecretKey, signatureType: enums.signature, data: string | object): Promise; + + /** + * Verifies signature expiration date + * @param date (optional) use the given date for verification instead of the current time + * @returns true if expired + */ + isExpired(date: Date): boolean; + + /** + * Returns the expiration time of the signature or Infinity if signature does not expire + * @returns expiration time + */ + getExpirationTime(): Date; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class SymEncryptedAEADProtected { + /** + * Implementation of the Symmetrically Encrypted Authenticated Encryption with + * Additional Data (AEAD) Protected Data Packet + * {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1}: + * AEAD Protected Data Packet + */ + constructor(); + + /** + * Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification) + * @param bytes + */ + read(bytes: Uint8Array | ReadableStream): void; + + /** + * Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification) + * @returns The encrypted payload + */ + write(): Uint8Array | ReadableStream; + + /** + * Decrypt the encrypted payload. + * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' + * @param key The session key used to encrypt the payload + * @param streaming Whether the top-level function will return a stream + * @returns + */ + decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): boolean; + + /** + * Encrypt the packet list payload. + * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' + * @param key The session key used to encrypt the payload + * @param streaming Whether the top-level function will return a stream + */ + encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): void; + + /** + * En/decrypt the payload. + * @param {encrypt | decrypt} fn Whether to encrypt or decrypt + * @param key The session key used to en/decrypt the payload + * @param data The data to en/decrypt + * @param streaming Whether the top-level function will return a stream + * @returns + */ + crypt(fn: any, key: Uint8Array, data: Uint8Array | ReadableStream, streaming: boolean): Uint8Array | ReadableStream; + } + + class SymEncryptedIntegrityProtected { + /** + * Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) + * {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}: + * The Symmetrically Encrypted Integrity Protected Data packet is + * a variant of the Symmetrically Encrypted Data packet. It is a new feature + * created for OpenPGP that addresses the problem of detecting a modification to + * encrypted data. It is used in combination with a Modification Detection Code + * packet. + */ + constructor(); + + /** + * The encrypted payload. + */ + encrypted: any; + + /** + * If after decrypting the packet this is set to true, + * a modification has been detected and thus the contents + * should be discarded. + */ + modification: boolean; + + /** + * Encrypt the payload in the packet. + * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' + * @param key The key of cipher blocksize length to be used + * @param streaming Whether to set this.encrypted to a stream + * @returns + */ + encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; + + /** + * Decrypts the encrypted data contained in the packet. + * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' + * @param key The key of cipher blocksize length to be used + * @param streaming Whether to read this.encrypted as a stream + * @returns + */ + decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; + } + + class SymEncryptedSessionKey { + /** + * Public-Key Encrypted Session Key Packets (Tag 1) + * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: + * A Public-Key Encrypted Session Key packet holds the session key + * used to encrypt a message. Zero or more Public-Key Encrypted Session Key + * packets and/or Symmetric-Key Encrypted Session Key packets may precede a + * Symmetrically Encrypted Data Packet, which holds an encrypted message. The + * message is encrypted with the session key, and the session key is itself + * encrypted and stored in the Encrypted Session Key packet(s). The + * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted + * Session Key packet for each OpenPGP key to which the message is encrypted. + * The recipient of the message finds a session key that is encrypted to their + * public key, decrypts the session key, and then uses the session key to + * decrypt the message. + */ + constructor(); + + /** + * Parsing function for a symmetric encrypted session key packet (tag 3). + * @param input Payload of a tag 1 packet + * @param position Position to start reading from the input string + * @param len Length of the packet or the remaining length of + * input at position + * @returns Object representation + */ + read(input: Uint8Array, position: Integer, len: Integer): SymEncryptedSessionKey; + + /** + * Decrypts the session key + * @param passphrase The passphrase in string form + * @returns + */ + decrypt(passphrase: string): Promise; + + /** + * Encrypts the session key + * @param passphrase The passphrase in string form + * @returns + */ + encrypt(passphrase: string): Promise; + + /** + * Fix custom types after cloning + */ + postCloneTypeFix(): void; + } + + class SymmetricallyEncrypted { + /** + * Implementation of the Symmetrically Encrypted Data Packet (Tag 9) + * {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: + * The Symmetrically Encrypted Data packet contains data encrypted with a + * symmetric-key algorithm. When it has been decrypted, it contains other + * packets (usually a literal data packet or compressed data packet, but in + * theory other Symmetrically Encrypted Data packets or sequences of packets + * that form whole OpenPGP messages). + */ + constructor(); + + /** + * Packet type + */ + tag: enums.packet; + + /** + * Encrypted secret-key data + */ + encrypted: any; + + /** + * Decrypted packets contained within. + */ + packets: List; + + /** + * When true, decrypt fails if message is not integrity protected + * @see module:config.ignore_mdc_error + */ + ignore_mdc_error: any; + + /** + * Decrypt the symmetrically-encrypted packet data + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param sessionKeyAlgorithm Symmetric key algorithm to use + * @param key The key of cipher blocksize length to be used + * @returns + */ + decrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; + + /** + * Encrypt the symmetrically-encrypted packet data + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param sessionKeyAlgorithm Symmetric key algorithm to use + * @param key The key of cipher blocksize length to be used + * @returns + */ + encrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; + } + + class Trust { + /** + * Implementation of the Trust Packet (Tag 12) + * {@link https://tools.ietf.org/html/rfc4880#section-5.10|RFC4880 5.10}: + * The Trust packet is used only within keyrings and is not normally + * exported. Trust packets contain data that record the user's + * specifications of which key holders are trustworthy introducers, + * along with other information that implementing software uses for + * trust information. The format of Trust packets is defined by a given + * implementation. + * Trust packets SHOULD NOT be emitted to output streams that are + * transferred to other users, and they SHOULD be ignored on any input + * other than local keyring files. + */ + constructor(); + + /** + * Parsing function for a trust packet (tag 12). + * Currently not implemented as we ignore trust packets + * @param byptes payload of a tag 12 packet + */ + read(byptes: string): void; + } + + class UserAttribute { + /** + * Implementation of the User Attribute Packet (Tag 17) + * The User Attribute packet is a variation of the User ID packet. It + * is capable of storing more types of data than the User ID packet, + * which is limited to text. Like the User ID packet, a User Attribute + * packet may be certified by the key owner ("self-signed") or any other + * key owner who cares to certify it. Except as noted, a User Attribute + * packet may be used anywhere that a User ID packet may be used. + * While User Attribute packets are not a required part of the OpenPGP + * standard, implementations SHOULD provide at least enough + * compatibility to properly handle a certification signature on the + * User Attribute packet. A simple way to do this is by treating the + * User Attribute packet as a User ID packet with opaque contents, but + * an implementation may use any method desired. + */ + constructor(); + + /** + * parsing function for a user attribute packet (tag 17). + * @param input payload of a tag 17 packet + */ + read(input: Uint8Array): void; + + /** + * Creates a binary representation of the user attribute packet + * @returns string representation + */ + write(): Uint8Array; + + /** + * Compare for equality + * @param usrAttr + * @returns true if equal + */ + equals(usrAttr: UserAttribute): boolean; + } + + class Userid { + /** + * Implementation of the User ID Packet (Tag 13) + * A User ID packet consists of UTF-8 text that is intended to represent + * the name and email address of the key holder. By convention, it + * includes an RFC 2822 [RFC2822] mail name-addr, but there are no + * restrictions on its content. The packet length in the header + * specifies the length of the User ID. + */ + constructor(); + + /** + * A string containing the user id. Usually in the form + * John Doe + */ + userid: string; + + /** + * Parsing function for a user id packet (tag 13). + * @param input payload of a tag 13 packet + */ + read(input: Uint8Array): void; + + /** + * Parse userid string, e.g. 'John Doe ' + */ + parse(): void; + + /** + * Creates a binary representation of the user id packet + * @returns binary representation + */ + write(): Uint8Array; + + /** + * Set userid string from object, e.g. { name:'Phil Zimmermann', email:'phil@openpgp.org' } + */ + format(): void; + } + + namespace all_packets { + /** + * @see module:packet.Compressed + */ + var Compressed: any; + + /** + * @see module:packet.SymEncryptedIntegrityProtected + */ + var SymEncryptedIntegrityProtected: any; + + /** + * @see module:packet.SymEncryptedAEADProtected + */ + var SymEncryptedAEADProtected: any; + + /** + * @see module:packet.PublicKeyEncryptedSessionKey + */ + var PublicKeyEncryptedSessionKey: any; + + /** + * @see module:packet.SymEncryptedSessionKey + */ + var SymEncryptedSessionKey: any; + + /** + * @see module:packet.Literal + */ + var Literal: any; + + /** + * @see module:packet.PublicKey + */ + var PublicKey: any; + + /** + * @see module:packet.SymmetricallyEncrypted + */ + var SymmetricallyEncrypted: any; + + /** + * @see module:packet.Marker + */ + var Marker: any; + + /** + * @see module:packet.PublicSubkey + */ + var PublicSubkey: any; + + /** + * @see module:packet.UserAttribute + */ + var UserAttribute: any; + + /** + * @see module:packet.OnePassSignature + */ + var OnePassSignature: any; + + /** + * @see module:packet.SecretKey + */ + var SecretKey: any; + + /** + * @see module:packet.Userid + */ + var Userid: any; + + /** + * @see module:packet.SecretSubkey + */ + var SecretSubkey: any; + + /** + * @see module:packet.Signature + */ + var Signature: any; + + /** + * @see module:packet.Trust + */ + var Trust: any; + } + + namespace clone { + /** + * Create a packetlist from the correspoding object types. + * @param options the object passed to and from the web worker + * @returns a mutated version of the options optject + */ + function clonePackets(options: object): object; + + /** + * Creates an object with the correct prototype from a corresponding packetlist. + * @param options the object passed to and from the web worker + * @param method the public api function name to be delegated to the worker + * @returns a mutated version of the options optject + */ + function parseClonedPackets(options: object, method: string): object; + } + namespace packet { /** - * Allocate a new packet - * @param tag property name from {@link module:enums.packet} - * @returns new packet object with type based on tag + * Encodes a given integer of length to the openpgp length specifier to a + * string + * @param length The length to encode + * @returns String with openpgp length representation */ - function newPacketFromTag(tag: string): object; + function writeSimpleLength(length: Integer): Uint8Array; /** - * Allocate a new packet from structured packet clone - * @see - * @param packetClone packet clone - * @returns new packet object with data from packet clone + * Writes a packet header version 4 with the given tag_type and length to a + * string + * @param tag_type Tag type + * @param length Length of the payload + * @returns String of the header */ - function fromStructuredClone(packetClone: object): object; - - class Compressed { - /** - * Implementation of the Compressed Data Packet (Tag 8) - * {@link https://tools.ietf.org/html/rfc4880#section-5.6|RFC4880 5.6}: - * The Compressed Data packet contains compressed data. Typically, - * this packet is found as the contents of an encrypted packet, or following - * a Signature or One-Pass Signature packet, and contains a literal data packet. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * List of packets - */ - packets: List; - - /** - * Compression algorithm - * @type {compression} - */ - algorithm: any; - - /** - * Compressed packet data - */ - compressed: Uint8Array | ReadableStream; - - /** - * Parsing function for the packet. - * @param bytes Payload of a tag 8 packet - */ - read(bytes: Uint8Array | ReadableStream): void; - - /** - * Return the compressed packet. - * @returns binary compressed packet - */ - write(): Uint8Array | ReadableStream; - - /** - * Decompression method for decompressing the compressed data - * read by read_packet - */ - decompress(): void; - - /** - * Compress the packet data (member decompressedData) - */ - compress(): void; - } - - class Literal { - /** - * Implementation of the Literal Data Packet (Tag 11) - * {@link https://tools.ietf.org/html/rfc4880#section-5.9|RFC4880 5.9}: - * A Literal Data packet contains the body of a message; data that is not to be - * further interpreted. - * @param date the creation date of the literal package - */ - constructor(date: Date); - - /** - * Set the packet data to a javascript native string, end of line - * will be normalized to \r\n and by default text is converted to UTF8 - * @param text Any native javascript string - * @param {utf8 | binary | text | mime} format (optional) The format of the string of bytes - */ - setText(text: string | ReadableStream, format: any): void; - - /** - * Returns literal data packets as native JavaScript string - * with normalized end of line to \n - * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again - * @returns literal data as text - */ - getText(clone: boolean): string | ReadableStream; - - /** - * Set the packet data to value represented by the provided string of bytes. - * @param bytes The string of bytes - * @param {utf8 | binary | text | mime} format The format of the string of bytes - */ - setBytes(bytes: Uint8Array | ReadableStream, format: any): void; - - /** - * Get the byte sequence representing the literal packet data - * @param clone (optional) Whether to return a clone so that getBytes/getText can be called again - * @returns A sequence of bytes - */ - getBytes(clone: boolean): Uint8Array | ReadableStream; - - /** - * Sets the filename of the literal packet data - * @param filename Any native javascript string - */ - setFilename(filename: string): void; - - /** - * Get the filename of the literal packet data - * @returns filename - */ - getFilename(): string; - - /** - * Parsing function for a literal data packet (tag 11). - * @param input Payload of a tag 11 packet - * @returns object representation - */ - read(input: Uint8Array | ReadableStream): Literal; - - /** - * Creates a string representation of the packet - * @returns Uint8Array representation of the packet - */ - write(): Uint8Array | ReadableStream; - } - - class Marker { - /** - * Implementation of the strange "Marker packet" (Tag 10) - * {@link https://tools.ietf.org/html/rfc4880#section-5.8|RFC4880 5.8}: - * An experimental version of PGP used this packet as the Literal - * packet, but no released version of PGP generated Literal packets with this - * tag. With PGP 5.x, this packet has been reassigned and is reserved for use as - * the Marker packet. - * Such a packet MUST be ignored when received. - */ - constructor(); - - /** - * Parsing function for a literal data packet (tag 10). - * @param input Payload of a tag 10 packet - * @param position Position to start reading from the input string - * @param len Length of the packet or the remaining length of - * input at position - * @returns Object representation - */ - read(input: string, position: Integer, len: Integer): Marker; - } - - class OnePassSignature { - /** - * Implementation of the One-Pass Signature Packets (Tag 4) - * {@link https://tools.ietf.org/html/rfc4880#section-5.4|RFC4880 5.4}: - * The One-Pass Signature packet precedes the signed data and contains - * enough information to allow the receiver to begin calculating any - * hashes needed to verify the signature. It allows the Signature - * packet to be placed at the end of the message, so that the signer - * can compute the entire signed message in one pass. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * A one-octet version number. The current version is 3. - */ - version: any; - - /** - * A one-octet signature type. - * Signature types are described in - * {@link https://tools.ietf.org/html/rfc4880#section-5.2.1|RFC4880 Section 5.2.1}. - */ - signatureType: any; - - /** - * A one-octet number describing the hash algorithm used. - * @see - */ - hashAlgorithm: any; - - /** - * A one-octet number describing the public-key algorithm used. - * @see - */ - publicKeyAlgorithm: any; - - /** - * An eight-octet number holding the Key ID of the signing key. - */ - issuerKeyId: any; - - /** - * A one-octet number holding a flag showing whether the signature is nested. - * A zero value indicates that the next packet is another One-Pass Signature packet - * that describes another signature to be applied to the same message data. - */ - flags: any; - - /** - * parsing function for a one-pass signature packet (tag 4). - * @param bytes payload of a tag 4 packet - * @returns object representation - */ - read(bytes: Uint8Array): OnePassSignature; - - /** - * creates a string representation of a one-pass signature packet - * @returns a Uint8Array representation of a one-pass signature packet - */ - write(): Uint8Array; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class List { - /** - * This class represents a list of openpgp packets. - * Take care when iterating over it - the packets themselves - * are stored as numerical indices. - */ - constructor(); - - /** - * The number of packets contained within the list. - */ - readonly length: Integer; - - /** - * Reads a stream of binary data and interprents it as a list of packets. - * @param A Uint8Array of bytes. - */ - read(A: Uint8Array | ReadableStream): void; - - /** - * Creates a binary representation of openpgp objects contained within the - * class instance. - * @returns A Uint8Array containing valid openpgp packets. - */ - write(): Uint8Array; - - /** - * Adds a packet to the list. This is the only supported method of doing so; - * writing to packetlist[i] directly will result in an error. - * @param packet Packet to push - */ - push(packet: object): void; - - /** - * Creates a new PacketList with all packets from the given types - */ - filterByTag(): void; - - /** - * Traverses packet tree and returns first matching packet - * @param type The packet type - * @returns - */ - findPacket(type: enums.packet): List | undefined; - - /** - * Returns array of found indices by tag - */ - indexOfTag(): void; - - /** - * Concatenates packetlist or array of packets - */ - concat(): void; - - /** - * Allocate a new packetlist from structured packetlist clone - * See {@link https://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data} - * @param packetClone packetlist clone - * @returns new packetlist object with data from packetlist clone - */ - static fromStructuredClone(packetClone: object): object; - } - - class PublicKey { - /** - * Implementation of the Key Material Packet (Tag 5,6,7,14) - * {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}: - * A key material packet contains all the information about a public or - * private key. There are four variants of this packet type, and two - * major versions. - * A Public-Key packet starts a series of packets that forms an OpenPGP - * key (sometimes called an OpenPGP certificate). - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} - * called by read_tag<num> - * @param bytes Input array to read the packet from - * @returns This object with attributes set by the parser - */ - read(bytes: Uint8Array): object; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Same as write_private_key, but has less information because of - * public key. - * @returns OpenPGP packet body contents, - */ - write(): Uint8Array; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class PublicKeyEncryptedSessionKey { - /** - * Public-Key Encrypted Session Key Packets (Tag 1) - * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: - * A Public-Key Encrypted Session Key packet holds the session key - * used to encrypt a message. Zero or more Public-Key Encrypted Session Key - * packets and/or Symmetric-Key Encrypted Session Key packets may precede a - * Symmetrically Encrypted Data Packet, which holds an encrypted message. The - * message is encrypted with the session key, and the session key is itself - * encrypted and stored in the Encrypted Session Key packet(s). The - * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted - * Session Key packet for each OpenPGP key to which the message is encrypted. - * The recipient of the message finds a session key that is encrypted to their - * public key, decrypts the session key, and then uses the session key to - * decrypt the message. - */ - constructor(); - - encrypted: any[]; - - /** - * Parsing function for a publickey encrypted session key packet (tag 1). - * @param input Payload of a tag 1 packet - * @param position Position to start reading from the input string - * @param len Length of the packet or the remaining length of - * input at position - * @returns Object representation - */ - read(input: Uint8Array, position: Integer, len: Integer): PublicKeyEncryptedSessionKey - - /** - * Create a string representation of a tag 1 packet - * @returns The Uint8Array representation - */ - write(): Uint8Array; - - /** - * Encrypt session key packet - * @param key Public key - * @returns - */ - encrypt(key: PublicKey): Promise; - - /** - * Decrypts the session key (only for public key encrypted session key - * packets (tag 1) - * @param key Private key with secret params unlocked - * @returns - */ - decrypt(key: SecretKey): Promise; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class PublicSubkey { - /** - * A Public-Subkey packet (tag 14) has exactly the same format as a - * Public-Key packet, but denotes a subkey. One or more subkeys may be - * associated with a top-level key. By convention, the top-level key - * provides signature services, and the subkeys provide encryption - * services. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Internal Parser for public keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.2|RFC 4880 section 5.5.2 Public-Key Packet Formats} - * called by read_tag<num> - * @param bytes Input array to read the packet from - * @returns This object with attributes set by the parser - */ - read(bytes: Uint8Array): object; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Same as write_private_key, but has less information because of - * public key. - * @returns OpenPGP packet body contents, - */ - write(): Uint8Array; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class SecretKey { - /** - * A Secret-Key packet contains all the information that is found in a - * Public-Key packet, including the public-key material, but also - * includes the secret-key material after all the public-key fields. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Encrypted secret-key data - */ - encrypted: any; - - /** - * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. - */ - isEncrypted: any; - - /** - * Internal parser for private keys as specified in - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} - * @param bytes Input string to read the packet from - */ - read(bytes: string): void; - - /** - * Creates an OpenPGP key packet for the given key. - * @returns A string of bytes containing the secret key OpenPGP packet - */ - write(): string; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Encrypt the payload. By default, we use aes256 and iterated, salted string - * to key specifier. If the key is in a decrypted state (isEncrypted === false) - * and the passphrase is empty or undefined, the key will be set as not encrypted. - * This can be used to remove passphrase protection after calling decrypt(). - * @param passphrase - * @returns - */ - encrypt(passphrase: string): Promise; - - /** - * Decrypts the private key params which are needed to use the key. - * {@link module:packet.SecretKey.isDecrypted} should be false, as - * otherwise calls to this function will throw an error. - * @param passphrase The passphrase for this private key as string - * @returns - */ - decrypt(passphrase: string): Promise; - - /** - * Clear private params, return to initial state - */ - clearPrivateParams(): void; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - } - - class SecretSubkey { - /** - * A Secret-Subkey packet (tag 7) is the subkey analog of the Secret - * Key packet and has exactly the same format. - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Encrypted secret-key data - */ - encrypted: any; - - /** - * Indicator if secret-key data is encrypted. `this.isEncrypted === false` means data is available in decrypted form. - */ - isEncrypted: any; - - /** - * Internal parser for private keys as specified in - * {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04#section-5.5.3|RFC4880bis-04 section 5.5.3} - * @param bytes Input string to read the packet from - */ - read(bytes: string): void; - - /** - * Creates an OpenPGP key packet for the given key. - * @returns A string of bytes containing the secret key OpenPGP packet - */ - write(): string; - - /** - * Check whether secret-key data is available in decrypted form. Returns null for public keys. - * @returns - */ - isDecrypted(): boolean | null; - - /** - * Encrypt the payload. By default, we use aes256 and iterated, salted string - * to key specifier. If the key is in a decrypted state (isEncrypted === false) - * and the passphrase is empty or undefined, the key will be set as not encrypted. - * This can be used to remove passphrase protection after calling decrypt(). - * @param passphrase - * @returns - */ - encrypt(passphrase: string): Promise; - - /** - * Decrypts the private key params which are needed to use the key. - * {@link module:packet.SecretKey.isDecrypted} should be false, as - * otherwise calls to this function will throw an error. - * @param passphrase The passphrase for this private key as string - * @returns - */ - decrypt(passphrase: string): Promise; - - /** - * Clear private params, return to initial state - */ - clearPrivateParams(): void; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - - /** - * Packet version - */ - version: Integer; - - /** - * Key creation date. - */ - created: Date; - - /** - * Public key algorithm. - */ - algorithm: string; - - /** - * Algorithm specific params - */ - params: object[]; - - /** - * Time until expiration in days (V3 only) - */ - expirationTimeV3: Integer; - - /** - * Fingerprint in lowercase hex - */ - fingerprint: string; - - /** - * Keyid - */ - keyid: type.keyid.Keyid; - - /** - * Alias of read() - * @see module:packet.PublicKey#read - */ - readPublicKey: any; - - /** - * Alias of write() - * @see module:packet.PublicKey#write - */ - writePublicKey: any; - - /** - * Write an old version packet - it's used by some of the internal routines. - */ - writeOld(): void; - - /** - * Returns the creation time of the key - * @returns - */ - getCreationTime(): Date; - - /** - * Calculates the key id of the key - * @returns A 8 byte key id - */ - getKeyId(): string; - - /** - * Calculates the fingerprint of the key - * @returns A Uint8Array containing the fingerprint - */ - getFingerprintBytes(): Uint8Array; - - /** - * Calculates the fingerprint of the key - * @returns A string containing the fingerprint in lowercase hex - */ - getFingerprint(): string; - - /** - * Calculates whether two keys have the same fingerprint without actually calculating the fingerprint - * @returns Whether the two keys have the same version and public key data - */ - hasSameFingerprintAs(): boolean; - - /** - * Returns algorithm information - * @returns An object of the form {algorithm: string, bits:int, curve:String} - */ - getAlgorithmInfo(): object; - } - - class Signature { - /** - * Implementation of the Signature Packet (Tag 2) - * {@link https://tools.ietf.org/html/rfc4880#section-5.2|RFC4480 5.2}: - * A Signature packet describes a binding between some public key and - * some data. The most common signatures are a signature of a file or a - * block of text, and a signature that is a certification of a User ID. - * @param date the creation date of the signature - */ - constructor(date: Date); - - /** - * parsing function for a signature packet (tag 2). - * @param bytes payload of a tag 2 packet - * @param position position to start reading from the bytes string - * @param len length of the packet or the remaining length of bytes at position - * @returns object representation - */ - read(bytes: string, position: Integer, len: Integer): Signature; - - /** - * Signs provided data. This needs to be done prior to serialization. - * @param key private key used to sign the message. - * @param data Contains packets to be signed. - * @returns - */ - sign(key: SecretKey, data: object): Promise; - - /** - * Creates Uint8Array of bytes of all subpacket data except Issuer and Embedded Signature subpackets - * @returns subpacket data - */ - write_hashed_sub_packets(): Uint8Array; - - /** - * Creates Uint8Array of bytes of Issuer and Embedded Signature subpackets - * @returns subpacket data - */ - write_unhashed_sub_packets(): Uint8Array; - - /** - * verifys the signature packet. Note: not signature types are implemented - * @param key the public key to verify the signature - * @param signatureType expected signature type - * @param data data which on the signature applies - * @returns True if message is verified, else false. - */ - verify(key: PublicSubkey | PublicKey | SecretSubkey | SecretKey, signatureType: enums.signature, data: string | object): Promise; - - /** - * Verifies signature expiration date - * @param date (optional) use the given date for verification instead of the current time - * @returns true if expired - */ - isExpired(date: Date): boolean; - - /** - * Returns the expiration time of the signature or Infinity if signature does not expire - * @returns expiration time - */ - getExpirationTime(): Date; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class SymEncryptedAEADProtected { - /** - * Implementation of the Symmetrically Encrypted Authenticated Encryption with - * Additional Data (AEAD) Protected Data Packet - * {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1}: - * AEAD Protected Data Packet - */ - constructor(); - - /** - * Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification) - * @param bytes - */ - read(bytes: Uint8Array | ReadableStream): void; - - /** - * Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification) - * @returns The encrypted payload - */ - write(): Uint8Array | ReadableStream; - - /** - * Decrypt the encrypted payload. - * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' - * @param key The session key used to encrypt the payload - * @param streaming Whether the top-level function will return a stream - * @returns - */ - decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): boolean; - - /** - * Encrypt the packet list payload. - * @param sessionKeyAlgorithm The session key's cipher algorithm e.g. 'aes128' - * @param key The session key used to encrypt the payload - * @param streaming Whether the top-level function will return a stream - */ - encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): void; - - /** - * En/decrypt the payload. - * @param {encrypt | decrypt} fn Whether to encrypt or decrypt - * @param key The session key used to en/decrypt the payload - * @param data The data to en/decrypt - * @param streaming Whether the top-level function will return a stream - * @returns - */ - crypt(fn: any, key: Uint8Array, data: Uint8Array | ReadableStream, streaming: boolean): Uint8Array | ReadableStream; - } - - class SymEncryptedIntegrityProtected { - /** - * Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) - * {@link https://tools.ietf.org/html/rfc4880#section-5.13|RFC4880 5.13}: - * The Symmetrically Encrypted Integrity Protected Data packet is - * a variant of the Symmetrically Encrypted Data packet. It is a new feature - * created for OpenPGP that addresses the problem of detecting a modification to - * encrypted data. It is used in combination with a Modification Detection Code - * packet. - */ - constructor(); - - /** - * The encrypted payload. - */ - encrypted: any; - - /** - * If after decrypting the packet this is set to true, - * a modification has been detected and thus the contents - * should be discarded. - */ - modification: boolean; - - /** - * Encrypt the payload in the packet. - * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' - * @param key The key of cipher blocksize length to be used - * @param streaming Whether to set this.encrypted to a stream - * @returns - */ - encrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; - - /** - * Decrypts the encrypted data contained in the packet. - * @param sessionKeyAlgorithm The selected symmetric encryption algorithm to be used e.g. 'aes128' - * @param key The key of cipher blocksize length to be used - * @param streaming Whether to read this.encrypted as a stream - * @returns - */ - decrypt(sessionKeyAlgorithm: string, key: Uint8Array, streaming: boolean): Promise; - } - - class SymEncryptedSessionKey { - /** - * Public-Key Encrypted Session Key Packets (Tag 1) - * {@link https://tools.ietf.org/html/rfc4880#section-5.1|RFC4880 5.1}: - * A Public-Key Encrypted Session Key packet holds the session key - * used to encrypt a message. Zero or more Public-Key Encrypted Session Key - * packets and/or Symmetric-Key Encrypted Session Key packets may precede a - * Symmetrically Encrypted Data Packet, which holds an encrypted message. The - * message is encrypted with the session key, and the session key is itself - * encrypted and stored in the Encrypted Session Key packet(s). The - * Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted - * Session Key packet for each OpenPGP key to which the message is encrypted. - * The recipient of the message finds a session key that is encrypted to their - * public key, decrypts the session key, and then uses the session key to - * decrypt the message. - */ - constructor(); - - /** - * Parsing function for a symmetric encrypted session key packet (tag 3). - * @param input Payload of a tag 1 packet - * @param position Position to start reading from the input string - * @param len Length of the packet or the remaining length of - * input at position - * @returns Object representation - */ - read(input: Uint8Array, position: Integer, len: Integer): SymEncryptedSessionKey; - - /** - * Decrypts the session key - * @param passphrase The passphrase in string form - * @returns - */ - decrypt(passphrase: string): Promise; - - /** - * Encrypts the session key - * @param passphrase The passphrase in string form - * @returns - */ - encrypt(passphrase: string): Promise; - - /** - * Fix custom types after cloning - */ - postCloneTypeFix(): void; - } - - class SymmetricallyEncrypted { - /** - * Implementation of the Symmetrically Encrypted Data Packet (Tag 9) - * {@link https://tools.ietf.org/html/rfc4880#section-5.7|RFC4880 5.7}: - * The Symmetrically Encrypted Data packet contains data encrypted with a - * symmetric-key algorithm. When it has been decrypted, it contains other - * packets (usually a literal data packet or compressed data packet, but in - * theory other Symmetrically Encrypted Data packets or sequences of packets - * that form whole OpenPGP messages). - */ - constructor(); - - /** - * Packet type - */ - tag: enums.packet; - - /** - * Encrypted secret-key data - */ - encrypted: any; - - /** - * Decrypted packets contained within. - */ - packets: List; - - /** - * When true, decrypt fails if message is not integrity protected - * @see module:config.ignore_mdc_error - */ - ignore_mdc_error: any; - - /** - * Decrypt the symmetrically-encrypted packet data - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param sessionKeyAlgorithm Symmetric key algorithm to use - * @param key The key of cipher blocksize length to be used - * @returns - */ - decrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; - - /** - * Encrypt the symmetrically-encrypted packet data - * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. - * @param sessionKeyAlgorithm Symmetric key algorithm to use - * @param key The key of cipher blocksize length to be used - * @returns - */ - encrypt(sessionKeyAlgorithm: enums.symmetric, key: Uint8Array): Promise; - } - - class Trust { - /** - * Implementation of the Trust Packet (Tag 12) - * {@link https://tools.ietf.org/html/rfc4880#section-5.10|RFC4880 5.10}: - * The Trust packet is used only within keyrings and is not normally - * exported. Trust packets contain data that record the user's - * specifications of which key holders are trustworthy introducers, - * along with other information that implementing software uses for - * trust information. The format of Trust packets is defined by a given - * implementation. - * Trust packets SHOULD NOT be emitted to output streams that are - * transferred to other users, and they SHOULD be ignored on any input - * other than local keyring files. - */ - constructor(); - - /** - * Parsing function for a trust packet (tag 12). - * Currently not implemented as we ignore trust packets - * @param byptes payload of a tag 12 packet - */ - read(byptes: string): void; - } - - class UserAttribute { - /** - * Implementation of the User Attribute Packet (Tag 17) - * The User Attribute packet is a variation of the User ID packet. It - * is capable of storing more types of data than the User ID packet, - * which is limited to text. Like the User ID packet, a User Attribute - * packet may be certified by the key owner ("self-signed") or any other - * key owner who cares to certify it. Except as noted, a User Attribute - * packet may be used anywhere that a User ID packet may be used. - * While User Attribute packets are not a required part of the OpenPGP - * standard, implementations SHOULD provide at least enough - * compatibility to properly handle a certification signature on the - * User Attribute packet. A simple way to do this is by treating the - * User Attribute packet as a User ID packet with opaque contents, but - * an implementation may use any method desired. - */ - constructor(); - - /** - * parsing function for a user attribute packet (tag 17). - * @param input payload of a tag 17 packet - */ - read(input: Uint8Array): void; - - /** - * Creates a binary representation of the user attribute packet - * @returns string representation - */ - write(): Uint8Array; - - /** - * Compare for equality - * @param usrAttr - * @returns true if equal - */ - equals(usrAttr: UserAttribute): boolean; - } - - class Userid { - /** - * Implementation of the User ID Packet (Tag 13) - * A User ID packet consists of UTF-8 text that is intended to represent - * the name and email address of the key holder. By convention, it - * includes an RFC 2822 [RFC2822] mail name-addr, but there are no - * restrictions on its content. The packet length in the header - * specifies the length of the User ID. - */ - constructor(); - - /** - * A string containing the user id. Usually in the form - * John Doe - */ - userid: string; - - /** - * Parsing function for a user id packet (tag 13). - * @param input payload of a tag 13 packet - */ - read(input: Uint8Array): void; - - /** - * Parse userid string, e.g. 'John Doe ' - */ - parse(): void; - - /** - * Creates a binary representation of the user id packet - * @returns binary representation - */ - write(): Uint8Array; - - /** - * Set userid string from object, e.g. { name:'Phil Zimmermann', email:'phil@openpgp.org' } - */ - format(): void; - } - - namespace all_packets { - /** - * @see module:packet.Compressed - */ - var Compressed: any; - - /** - * @see module:packet.SymEncryptedIntegrityProtected - */ - var SymEncryptedIntegrityProtected: any; - - /** - * @see module:packet.SymEncryptedAEADProtected - */ - var SymEncryptedAEADProtected: any; - - /** - * @see module:packet.PublicKeyEncryptedSessionKey - */ - var PublicKeyEncryptedSessionKey: any; - - /** - * @see module:packet.SymEncryptedSessionKey - */ - var SymEncryptedSessionKey: any; - - /** - * @see module:packet.Literal - */ - var Literal: any; - - /** - * @see module:packet.PublicKey - */ - var PublicKey: any; - - /** - * @see module:packet.SymmetricallyEncrypted - */ - var SymmetricallyEncrypted: any; - - /** - * @see module:packet.Marker - */ - var Marker: any; - - /** - * @see module:packet.PublicSubkey - */ - var PublicSubkey: any; - - /** - * @see module:packet.UserAttribute - */ - var UserAttribute: any; - - /** - * @see module:packet.OnePassSignature - */ - var OnePassSignature: any; - - /** - * @see module:packet.SecretKey - */ - var SecretKey: any; - - /** - * @see module:packet.Userid - */ - var Userid: any; - - /** - * @see module:packet.SecretSubkey - */ - var SecretSubkey: any; - - /** - * @see module:packet.Signature - */ - var Signature: any; - - /** - * @see module:packet.Trust - */ - var Trust: any; - } - - namespace clone { - /** - * Create a packetlist from the correspoding object types. - * @param options the object passed to and from the web worker - * @returns a mutated version of the options optject - */ - function clonePackets(options: object): object; - - /** - * Creates an object with the correct prototype from a corresponding packetlist. - * @param options the object passed to and from the web worker - * @param method the public api function name to be delegated to the worker - * @returns a mutated version of the options optject - */ - function parseClonedPackets(options: object, method: string): object; - } - - namespace packet { - /** - * Encodes a given integer of length to the openpgp length specifier to a - * string - * @param length The length to encode - * @returns String with openpgp length representation - */ - function writeSimpleLength(length: Integer): Uint8Array; - - /** - * Writes a packet header version 4 with the given tag_type and length to a - * string - * @param tag_type Tag type - * @param length Length of the payload - * @returns String of the header - */ - function writeHeader(tag_type: Integer, length: Integer): string; - - /** - * Writes a packet header Version 3 with the given tag_type and length to a - * string - * @param tag_type Tag type - * @param length Length of the payload - * @returns String of the header - */ - function writeOldHeader(tag_type: Integer, length: Integer): string; - - /** - * Whether the packet type supports partial lengths per RFC4880 - * @param tag_type Tag type - * @returns String of the header - */ - function supportsStreaming(tag_type: Integer): boolean; - - /** - * Generic static Packet Parser function - * @param input Input stream as string - * @param callback Function to call with the parsed packet - * @returns Returns false if the stream was empty and parsing is done, and true otherwise. - */ - function read(input: Uint8Array | ReadableStream, callback: Function): boolean; - } + function writeHeader(tag_type: Integer, length: Integer): string; + + /** + * Writes a packet header Version 3 with the given tag_type and length to a + * string + * @param tag_type Tag type + * @param length Length of the payload + * @returns String of the header + */ + function writeOldHeader(tag_type: Integer, length: Integer): string; + + /** + * Whether the packet type supports partial lengths per RFC4880 + * @param tag_type Tag type + * @returns String of the header + */ + function supportsStreaming(tag_type: Integer): boolean; + + /** + * Generic static Packet Parser function + * @param input Input stream as string + * @param callback Function to call with the parsed packet + * @returns Returns false if the stream was empty and parsing is done, and true otherwise. + */ + function read(input: Uint8Array | ReadableStream, callback: Function): boolean; } +} - namespace polyfills { - } +export namespace polyfills { +} - namespace signature { - /** - * Class that represents an OpenPGP signature. - */ - class Signature { - /** - * @param packetlist The signature packets - */ - constructor(packetlist: packet.List); - - /** - * Returns ASCII armored text of signature - * @returns ASCII armor - */ - armor(): ReadableStream; - } - - /** - * reads an OpenPGP armored signature and returns a signature object - * @param armoredText text to be parsed - * @returns new signature object - */ - function readArmored(armoredText: string | ReadableStream): Signature; - - /** - * reads an OpenPGP signature as byte array and returns a signature object - * @param input binary signature - * @returns new signature object - */ - function read(input: Uint8Array | ReadableStream): Signature; - } - - namespace type { - /** - * Encoded symmetric key for ECDH - */ - namespace ecdh_symkey { - class ECDHSymmetricKey { - constructor(); - - /** - * Read an ECDHSymmetricKey from an Uint8Array - * @param input Where to read the encoded symmetric key from - * @returns Number of read bytes - */ - read(input: Uint8Array): number; - - /** - * Write an ECDHSymmetricKey as an Uint8Array - * @returns An array containing the value - */ - write(): Uint8Array; - } - } - - /** - * Implementation of type KDF parameters - * {@link https://tools.ietf.org/html/rfc6637#section-7|RFC 6637 7}: - * A key derivation function (KDF) is necessary to implement the EC - * encryption. The Concatenation Key Derivation Function (Approved - * Alternative 1) [NIST-SP800-56A] with the KDF hash function that is - * SHA2-256 [FIPS-180-3] or stronger is REQUIRED. - */ - namespace kdf_params { - class KDFParams { - /** - * @param hash Hash algorithm - * @param cipher Symmetric algorithm - */ - constructor(hash: enums.hash, cipher: enums.symmetric); - - /** - * Read KDFParams from an Uint8Array - * @param input Where to read the KDFParams from - * @returns Number of read bytes - */ - read(input: Uint8Array): number; - - /** - * Write KDFParams to an Uint8Array - * @returns Array with the KDFParams value - */ - write(): Uint8Array; - } - } - - /** - * Implementation of type key id - * {@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3}: - * A Key ID is an eight-octet scalar that identifies a key. - * Implementations SHOULD NOT assume that Key IDs are unique. The - * section "Enhanced Key Formats" below describes how Key IDs are - * formed. - */ - namespace keyid { - class Keyid { - constructor(); - - /** - * Parsing method for a key id - * @param input Input to read the key id from - */ - read(input: Uint8Array): void; - - /** - * Checks equality of Key ID's - * @param keyid - * @param matchWildcard Indicates whether to check if either keyid is a wildcard - */ - equals(keyid: Keyid, matchWildcard: boolean): void; - } - } - - /** - * Implementation of type MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}) - * Multiprecision integers (also called MPIs) are unsigned integers used - * to hold large integers such as the ones used in cryptographic - * calculations. - * An MPI consists of two pieces: a two-octet scalar that is the length - * of the MPI in bits followed by a string of octets that contain the - * actual integer. - */ - namespace mpi { - class MPI { - constructor(); - - /** - * Parsing function for a MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC 4880 3.2}). - * @param input Payload of MPI data - * @param endian Endianness of the data; 'be' for big-endian or 'le' for little-endian - * @returns Length of data read - */ - read(input: Uint8Array, endian: string): Integer; - - /** - * Converts the mpi object to a bytes as specified in - * {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2} - * @param endian Endianness of the payload; 'be' for big-endian or 'le' for little-endian - * @param length Length of the data part of the MPI - * @returns mpi Byte representation - */ - write(endian: string, length: Integer): Uint8Array; - } - } - - /** - * Wrapper to an OID value - * {@link https://tools.ietf.org/html/rfc6637#section-11|RFC6637, section 11}: - * The sequence of octets in the third column is the result of applying - * the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier - * with subsequent truncation. The truncation removes the two fields of - * encoded Object Identifier. The first omitted field is one octet - * representing the Object Identifier tag, and the second omitted field - * is the length of the Object Identifier body. For example, the - * complete ASN.1 DER encoding for the NIST P-256 curve OID is "06 08 2A - * 86 48 CE 3D 03 01 07", from which the first entry in the table above - * is constructed by omitting the first two octets. Only the truncated - * sequence of octets is the valid representation of a curve OID. - */ - namespace oid { - class OID { - constructor(); - - /** - * Method to read an OID object - * @param input Where to read the OID from - * @returns Number of read bytes - */ - read(input: Uint8Array): number; - - /** - * Serialize an OID object - * @returns Array with the serialized value the OID - */ - write(): Uint8Array; - - /** - * Serialize an OID object as a hex string - * @returns String with the hex value of the OID - */ - toHex(): string; - - /** - * If a known curve object identifier, return the canonical name of the curve - * @returns String with the canonical name of the curve - */ - getName(): string; - } - } - - /** - * Implementation of the String-to-key specifier - * {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7}: - * String-to-key (S2K) specifiers are used to convert passphrase strings - * into symmetric-key encryption/decryption keys. They are used in two - * places, currently: to encrypt the secret part of private keys in the - * private keyring, and to convert passphrases to encryption keys for - * symmetrically encrypted messages. +export namespace signature { + /** + * Class that represents an OpenPGP signature. */ - namespace s2k { - class S2K { - constructor(); + class Signature { + /** + * @param packetlist The signature packets + */ + constructor(packetlist: packet.List); - algorithm: enums.hash; + /** + * Returns ASCII armored text of signature + * @returns ASCII armor + */ + armor(): ReadableStream; - type: enums.s2k; + packets: packet.List; + } - c: Integer; + /** + * reads an OpenPGP armored signature and returns a signature object + * @param armoredText text to be parsed + * @returns new signature object + */ + function readArmored(armoredText: string | ReadableStream): Signature; - /** - * Eight bytes of salt in a binary string. - */ - salt: string; + /** + * reads an OpenPGP signature as byte array and returns a signature object + * @param input binary signature + * @returns new signature object + */ + function read(input: Uint8Array | ReadableStream): Signature; +} - /** - * Parsing function for a string-to-key specifier ( {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}). - * @param input Payload of string-to-key specifier - * @returns Actual length of the object - */ - read(input: string): Integer; +export namespace type { + /** + * Encoded symmetric key for ECDH + */ + namespace ecdh_symkey { + class ECDHSymmetricKey { + constructor(); - /** - * Serializes s2k information - * @returns binary representation of s2k - */ - write(): Uint8Array; + /** + * Read an ECDHSymmetricKey from an Uint8Array + * @param input Where to read the encoded symmetric key from + * @returns Number of read bytes + */ + read(input: Uint8Array): number; - /** - * Produces a key using the specified passphrase and the defined - * hashAlgorithm - * @param passphrase Passphrase containing user input - * @returns Produced key with a length corresponding to - * hashAlgorithm hash length - */ - produce_key(passphrase: string): Uint8Array; - } + /** + * Write an ECDHSymmetricKey as an Uint8Array + * @returns An array containing the value + */ + write(): Uint8Array; } } /** - * This object contains utility functions + * Implementation of type KDF parameters + * {@link https://tools.ietf.org/html/rfc6637#section-7|RFC 6637 7}: + * A key derivation function (KDF) is necessary to implement the EC + * encryption. The Concatenation Key Derivation Function (Approved + * Alternative 1) [NIST-SP800-56A] with the KDF hash function that is + * SHA2-256 [FIPS-180-3] or stronger is REQUIRED. */ - namespace util { - /** - * Get transferable objects to pass buffers with zero copy (similar to "pass by reference" in C++) - * See: https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage - * Also, convert ReadableStreams to MessagePorts - * @param obj the options object to be passed to the web worker - * @returns an array of binary data to be passed - */ - function getTransferables(obj: object): any[]; + namespace kdf_params { + class KDFParams { + /** + * @param hash Hash algorithm + * @param cipher Symmetric algorithm + */ + constructor(hash: enums.hash, cipher: enums.symmetric); - /** - * Convert MessagePorts back to ReadableStreams - * @param obj - * @returns - */ - function restoreStreams(obj: object): object; + /** + * Read KDFParams from an Uint8Array + * @param input Where to read the KDFParams from + * @returns Number of read bytes + */ + read(input: Uint8Array): number; - /** - * Create hex string from a binary - * @param str String to convert - * @returns String containing the hexadecimal values - */ - function str_to_hex(str: string): string; - - /** - * Create binary string from a hex encoded string - * @param str Hex string to convert - * @returns - */ - function hex_to_str(str: string): string; - - /** - * Convert a Uint8Array to an MPI-formatted Uint8Array. - * Note: the output is **not** an MPI object. - * @see - * @see - * @param bin An array of 8-bit integers to convert - * @returns MPI-formatted Uint8Array - */ - function Uint8Array_to_MPI(bin: Uint8Array): Uint8Array; - - /** - * Convert a Base-64 encoded string an array of 8-bit integer - * Note: accepts both Radix-64 and URL-safe strings - * @param base64 Base-64 encoded string to convert - * @returns An array of 8-bit integers - */ - function b64_to_Uint8Array(base64: string): Uint8Array; - - /** - * Convert an array of 8-bit integer to a Base-64 encoded string - * @param bytes An array of 8-bit integers to convert - * @param url If true, output is URL-safe - * @returns Base-64 encoded string - */ - function Uint8Array_to_b64(bytes: Uint8Array, url: boolean): string; - - /** - * Convert a hex string to an array of 8-bit integers - * @param hex A hex string to convert - * @returns An array of 8-bit integers - */ - function hex_to_Uint8Array(hex: string): Uint8Array; - - /** - * Convert an array of 8-bit integers to a hex string - * @param bytes Array of 8-bit integers to convert - * @returns Hexadecimal representation of the array - */ - function Uint8Array_to_hex(bytes: Uint8Array): string; - - /** - * Convert a string to an array of 8-bit integers - * @param str String to convert - * @returns An array of 8-bit integers - */ - function str_to_Uint8Array(str: string): Uint8Array; - - /** - * Convert an array of 8-bit integers to a string - * @param bytes An array of 8-bit integers to convert - * @returns String representation of the array - */ - function Uint8Array_to_str(bytes: Uint8Array): string; - - /** - * Convert a native javascript string to a Uint8Array of utf8 bytes - * @param str The string to convert - * @returns A valid squence of utf8 bytes - */ - function encode_utf8(str: string | ReadableStream): Uint8Array | ReadableStream; - - /** - * Convert a Uint8Array of utf8 bytes to a native javascript string - * @param utf8 A valid squence of utf8 bytes - * @returns A native javascript string - */ - function decode_utf8(utf8: Uint8Array | ReadableStream): string | ReadableStream; - - /** - * Concat a list of Uint8Arrays, Strings or Streams - * The caller must not mix Uint8Arrays with Strings, but may mix Streams with non-Streams. - * @param Array of Uint8Arrays/Strings/Streams to concatenate - * @returns Concatenated array - */ - var concat: any; - - /** - * Concat Uint8Arrays - * @param Array of Uint8Arrays to concatenate - * @returns Concatenated array - */ - var concatUint8Array: any; - - /** - * Check Uint8Array equality - * @param first array - * @param second array - * @returns equality - */ - function equalsUint8Array(first: Uint8Array, second: Uint8Array): boolean; - - /** - * Calculates a 16bit sum of a Uint8Array by adding each character - * codes modulus 65535 - * @param Uint8Array to create a sum of - * @returns 2 bytes containing the sum of all charcodes % 65535 - */ - function write_checksum(Uint8Array: Uint8Array): Uint8Array; - - /** - * Helper function to print a debug message. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug(str: string): void; - - /** - * Helper function to print a debug message. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug_hexarray_dump(str: string): void; - - /** - * Helper function to print a debug message. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug_hexstr_dump(str: string): void; - - /** - * Helper function to print a debug error. Debug - * messages are only printed if - * @param str String of the debug message - */ - function print_debug_error(str: string): void; - - /** - * Read a stream to the end and print it to the console when it's closed. - * @param str String of the debug message - * @param input Stream to print - * @param concat Function to concatenate chunks of the stream (defaults to util.concat). - */ - function print_entire_stream(str: string, input: ReadableStream | Uint8Array | string, concat: Function): void; - - /** - * If S[1] == 0, then double(S) == (S[2..128] || 0); - * otherwise, double(S) == (S[2..128] || 0) xor - * (zeros(120) || 10000111). - * Both OCB and EAX (through CMAC) require this function to be constant-time. - * @param data - */ - /* Illegal function name 'double' can't be used here - function double(data: Uint8Array): void; - */ - - /** - * Shift a Uint8Array to the right by n bits - * @param array The array to shift - * @param bits Amount of bits to shift (MUST be smaller - * than 8) - * @returns Resulting array. - */ - function shiftRight(array: Uint8Array, bits: Integer): string; - - /** - * Get native Web Cryptography api, only the current version of the spec. - * The default configuration is to use the api when available. But it can - * be deactivated with config.use_native - * @returns The SubtleCrypto api or 'undefined' - */ - function getWebCrypto(): object; - - /** - * Get native Web Cryptography api for all browsers, including legacy - * implementations of the spec e.g IE11 and Safari 8/9. The default - * configuration is to use the api when available. But it can be deactivated - * with config.use_native - * @returns The SubtleCrypto api or 'undefined' - */ - function getWebCryptoAll(): object; - - /** - * Detect Node.js runtime. - */ - function detectNode(): void; - - /** - * Get native Node.js module - * @param The module to require - * @returns The required module or 'undefined' - */ - function nodeRequire(The: string): object; - - /** - * Get native Node.js crypto api. The default configuration is to use - * the api when available. But it can also be deactivated with config.use_native - * @returns The crypto module or 'undefined' - */ - function getNodeCrypto(): object; - - /** - * Get native Node.js Buffer constructor. This should be used since - * Buffer is not available under browserify. - * @returns The Buffer constructor or 'undefined' - */ - function getNodeBuffer(): Function; - - /** - * Format user id for internal use. - */ - function formatUserId(): void; - - /** - * Parse user id. - */ - function parseUserId(): void; - - /** - * Normalize line endings to \r\n - */ - function canonicalizeEOL(): void; - - /** - * Convert line endings from canonicalized \r\n to native \n - */ - function nativeEOL(): void; - - /** - * Remove trailing spaces and tabs from each line - */ - function removeTrailingSpaces(): void; - - /** - * Encode input buffer using Z-Base32 encoding. - * See: https://tools.ietf.org/html/rfc6189#section-5.1.6 - * @param data The binary data to encode - * @returns Binary data encoded using Z-Base32 - */ - function encodeZBase32(data: Uint8Array): string; + /** + * Write KDFParams to an Uint8Array + * @returns Array with the KDFParams value + */ + write(): Uint8Array; + } } - namespace wkd { - class WKD { - /** - * Initialize the WKD client - */ + /** + * Implementation of type key id + * {@link https://tools.ietf.org/html/rfc4880#section-3.3|RFC4880 3.3}: + * A Key ID is an eight-octet scalar that identifies a key. + * Implementations SHOULD NOT assume that Key IDs are unique. The + * section "Enhanced Key Formats" below describes how Key IDs are + * formed. + */ + namespace keyid { + class Keyid { constructor(); /** - * Search for a public key using Web Key Directory protocol. - * @param options.email User's email. - * @param options.rawBytes Returns Uint8Array instead of parsed key. - * @returns The public key. + * Parsing method for a key id + * @param input Input to read the key id from */ - lookup(): Promise, err: Array | null }>; + read(input: Uint8Array): void; + + /** + * Checks equality of Key ID's + * @param keyid + * @param matchWildcard Indicates whether to check if either keyid is a wildcard + */ + equals(keyid: Keyid, matchWildcard: boolean): void; } } - namespace worker { - /** - * @see module:openpgp.initWorker - * @see module:openpgp.getWorker - * @see module:openpgp.destroyWorker - * @see module:worker/worker + /** + * Implementation of type MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2}) + * Multiprecision integers (also called MPIs) are unsigned integers used + * to hold large integers such as the ones used in cryptographic + * calculations. + * An MPI consists of two pieces: a two-octet scalar that is the length + * of the MPI in bits followed by a string of octets that contain the + * actual integer. */ - namespace async_proxy { - class AsyncProxy { - /** - * Initializes a new proxy and loads the web worker - * @param path The path to the worker or 'openpgp.worker.js' by default - * @param n number of workers to initialize if path given - * @param config config The worker configuration - * @param worker alternative to path parameter: web worker initialized with 'openpgp.worker.js' - */ - constructor(path: string, n: number, config: object, worker: any[]); + namespace mpi { + class MPI { + constructor(); - /** - * Message handling - */ - handleMessage(): void; + /** + * Parsing function for a MPI ( {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC 4880 3.2}). + * @param input Payload of MPI data + * @param endian Endianness of the data; 'be' for big-endian or 'le' for little-endian + * @returns Length of data read + */ + read(input: Uint8Array, endian: string): Integer; - /** - * Get new request ID - * @returns New unique request ID - */ - getID(): Integer; - - /** - * Send message to worker with random data - * @param size Number of bytes to send - */ - seedRandom(size: Integer): void; - - /** - * Terminates the workers - */ - terminate(): void; - - /** - * Generic proxy function that handles all commands from the public api. - * @param method the public api function to be delegated to the worker thread - * @param options the api function's options - * @returns see the corresponding public api functions for their return types - */ - delegate(method: string, options: object): Promise; - } + /** + * Converts the mpi object to a bytes as specified in + * {@link https://tools.ietf.org/html/rfc4880#section-3.2|RFC4880 3.2} + * @param endian Endianness of the payload; 'be' for big-endian or 'le' for little-endian + * @param length Length of the data part of the MPI + * @returns mpi Byte representation + */ + write(endian: string, length: Integer): Uint8Array; } + } + + /** + * Wrapper to an OID value + * {@link https://tools.ietf.org/html/rfc6637#section-11|RFC6637, section 11}: + * The sequence of octets in the third column is the result of applying + * the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier + * with subsequent truncation. The truncation removes the two fields of + * encoded Object Identifier. The first omitted field is one octet + * representing the Object Identifier tag, and the second omitted field + * is the length of the Object Identifier body. For example, the + * complete ASN.1 DER encoding for the NIST P-256 curve OID is "06 08 2A + * 86 48 CE 3D 03 01 07", from which the first entry in the table above + * is constructed by omitting the first two octets. Only the truncated + * sequence of octets is the valid representation of a curve OID. + */ + namespace oid { + class OID { + constructor(); + + /** + * Method to read an OID object + * @param input Where to read the OID from + * @returns Number of read bytes + */ + read(input: Uint8Array): number; + + /** + * Serialize an OID object + * @returns Array with the serialized value the OID + */ + write(): Uint8Array; + + /** + * Serialize an OID object as a hex string + * @returns String with the hex value of the OID + */ + toHex(): string; + + /** + * If a known curve object identifier, return the canonical name of the curve + * @returns String with the canonical name of the curve + */ + getName(): string; + } + } + + /** + * Implementation of the String-to-key specifier + * {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC4880 3.7}: + * String-to-key (S2K) specifiers are used to convert passphrase strings + * into symmetric-key encryption/decryption keys. They are used in two + * places, currently: to encrypt the secret part of private keys in the + * private keyring, and to convert passphrases to encryption keys for + * symmetrically encrypted messages. + */ + namespace s2k { + class S2K { + constructor(); + + algorithm: enums.hash; + + type: enums.s2k; + + c: Integer; + + /** + * Eight bytes of salt in a binary string. + */ + salt: string; + + /** + * Parsing function for a string-to-key specifier ( {@link https://tools.ietf.org/html/rfc4880#section-3.7|RFC 4880 3.7}). + * @param input Payload of string-to-key specifier + * @returns Actual length of the object + */ + read(input: string): Integer; + + /** + * Serializes s2k information + * @returns binary representation of s2k + */ + write(): Uint8Array; + + /** + * Produces a key using the specified passphrase and the defined + * hashAlgorithm + * @param passphrase Passphrase containing user input + * @returns Produced key with a length corresponding to + * hashAlgorithm hash length + */ + produce_key(passphrase: string): Uint8Array; + } + } +} + +/** + * This object contains utility functions + */ +export namespace util { + /** + * Get transferable objects to pass buffers with zero copy (similar to "pass by reference" in C++) + * See: https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage + * Also, convert ReadableStreams to MessagePorts + * @param obj the options object to be passed to the web worker + * @returns an array of binary data to be passed + */ + function getTransferables(obj: object): any[]; + + /** + * Convert MessagePorts back to ReadableStreams + * @param obj + * @returns + */ + function restoreStreams(obj: object): object; + + /** + * Create hex string from a binary + * @param str String to convert + * @returns String containing the hexadecimal values + */ + function str_to_hex(str: string): string; + + /** + * Create binary string from a hex encoded string + * @param str Hex string to convert + * @returns + */ + function hex_to_str(str: string): string; + + /** + * Convert a Uint8Array to an MPI-formatted Uint8Array. + * Note: the output is **not** an MPI object. + * @see + * @see + * @param bin An array of 8-bit integers to convert + * @returns MPI-formatted Uint8Array + */ + function Uint8Array_to_MPI(bin: Uint8Array): Uint8Array; + + /** + * Convert a Base-64 encoded string an array of 8-bit integer + * Note: accepts both Radix-64 and URL-safe strings + * @param base64 Base-64 encoded string to convert + * @returns An array of 8-bit integers + */ + function b64_to_Uint8Array(base64: string): Uint8Array; + + /** + * Convert an array of 8-bit integer to a Base-64 encoded string + * @param bytes An array of 8-bit integers to convert + * @param url If true, output is URL-safe + * @returns Base-64 encoded string + */ + function Uint8Array_to_b64(bytes: Uint8Array, url: boolean): string; + + /** + * Convert a hex string to an array of 8-bit integers + * @param hex A hex string to convert + * @returns An array of 8-bit integers + */ + function hex_to_Uint8Array(hex: string): Uint8Array; + + /** + * Convert an array of 8-bit integers to a hex string + * @param bytes Array of 8-bit integers to convert + * @returns Hexadecimal representation of the array + */ + function Uint8Array_to_hex(bytes: Uint8Array): string; + + /** + * Convert a string to an array of 8-bit integers + * @param str String to convert + * @returns An array of 8-bit integers + */ + function str_to_Uint8Array(str: string): Uint8Array; + + /** + * Convert an array of 8-bit integers to a string + * @param bytes An array of 8-bit integers to convert + * @returns String representation of the array + */ + function Uint8Array_to_str(bytes: Uint8Array): string; + + /** + * Convert a native javascript string to a Uint8Array of utf8 bytes + * @param str The string to convert + * @returns A valid squence of utf8 bytes + */ + function encode_utf8(str: string | ReadableStream): Uint8Array | ReadableStream; + + /** + * Convert a Uint8Array of utf8 bytes to a native javascript string + * @param utf8 A valid squence of utf8 bytes + * @returns A native javascript string + */ + function decode_utf8(utf8: Uint8Array | ReadableStream): string | ReadableStream; + + /** + * Concat a list of Uint8Arrays, Strings or Streams + * The caller must not mix Uint8Arrays with Strings, but may mix Streams with non-Streams. + * @param Array of Uint8Arrays/Strings/Streams to concatenate + * @returns Concatenated array + */ + var concat: any; + + /** + * Concat Uint8Arrays + * @param Array of Uint8Arrays to concatenate + * @returns Concatenated array + */ + var concatUint8Array: any; + + /** + * Check Uint8Array equality + * @param first array + * @param second array + * @returns equality + */ + function equalsUint8Array(first: Uint8Array, second: Uint8Array): boolean; + + /** + * Calculates a 16bit sum of a Uint8Array by adding each character + * codes modulus 65535 + * @param Uint8Array to create a sum of + * @returns 2 bytes containing the sum of all charcodes % 65535 + */ + function write_checksum(Uint8Array: Uint8Array): Uint8Array; + + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug(str: string): void; + + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug_hexarray_dump(str: string): void; + + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug_hexstr_dump(str: string): void; + + /** + * Helper function to print a debug error. Debug + * messages are only printed if + * @param str String of the debug message + */ + function print_debug_error(str: string): void; + + /** + * Read a stream to the end and print it to the console when it's closed. + * @param str String of the debug message + * @param input Stream to print + * @param concat Function to concatenate chunks of the stream (defaults to util.concat). + */ + function print_entire_stream(str: string, input: ReadableStream | Uint8Array | string, concat: Function): void; + + /** + * If S[1] == 0, then double(S) == (S[2..128] || 0); + * otherwise, double(S) == (S[2..128] || 0) xor + * (zeros(120) || 10000111). + * Both OCB and EAX (through CMAC) require this function to be constant-time. + * @param data + */ + /* Illegal function name 'double' can't be used here + function double(data: Uint8Array): void; + */ + + /** + * Shift a Uint8Array to the right by n bits + * @param array The array to shift + * @param bits Amount of bits to shift (MUST be smaller + * than 8) + * @returns Resulting array. + */ + function shiftRight(array: Uint8Array, bits: Integer): string; + + /** + * Get native Web Cryptography api, only the current version of the spec. + * The default configuration is to use the api when available. But it can + * be deactivated with config.use_native + * @returns The SubtleCrypto api or 'undefined' + */ + function getWebCrypto(): object; + + /** + * Get native Web Cryptography api for all browsers, including legacy + * implementations of the spec e.g IE11 and Safari 8/9. The default + * configuration is to use the api when available. But it can be deactivated + * with config.use_native + * @returns The SubtleCrypto api or 'undefined' + */ + function getWebCryptoAll(): object; + + /** + * Detect Node.js runtime. + */ + function detectNode(): void; + + /** + * Get native Node.js module + * @param The module to require + * @returns The required module or 'undefined' + */ + function nodeRequire(The: string): object; + + /** + * Get native Node.js crypto api. The default configuration is to use + * the api when available. But it can also be deactivated with config.use_native + * @returns The crypto module or 'undefined' + */ + function getNodeCrypto(): object; + + /** + * Get native Node.js Buffer constructor. This should be used since + * Buffer is not available under browserify. + * @returns The Buffer constructor or 'undefined' + */ + function getNodeBuffer(): Function; + + /** + * Format user id for internal use. + */ + function formatUserId(): void; + + /** + * Parse user id. + */ + function parseUserId(): void; + + /** + * Normalize line endings to \r\n + */ + function canonicalizeEOL(): void; + + /** + * Convert line endings from canonicalized \r\n to native \n + */ + function nativeEOL(): void; + + /** + * Remove trailing spaces and tabs from each line + */ + function removeTrailingSpaces(): void; + + /** + * Encode input buffer using Z-Base32 encoding. + * See: https://tools.ietf.org/html/rfc6189#section-5.1.6 + * @param data The binary data to encode + * @returns Binary data encoded using Z-Base32 + */ + function encodeZBase32(data: Uint8Array): string; +} + +export namespace wkd { + class WKD { + /** + * Initialize the WKD client + */ + constructor(); /** - * @see module:openpgp.initWorker - * @see module:openpgp.getWorker - * @see module:openpgp.destroyWorker - * @see module:worker/async_proxy - */ - namespace worker { + * Search for a public key using Web Key Directory protocol. + * @param options.email User's email. + * @param options.rawBytes Returns Uint8Array instead of parsed key. + * @returns The public key. + */ + lookup(): Promise, err: Array | null }>; + } +} + +export namespace worker { + /** + * @see module:openpgp.initWorker + * @see module:openpgp.getWorker + * @see module:openpgp.destroyWorker + * @see module:worker/worker + */ + namespace async_proxy { + class AsyncProxy { /** - * Handle random buffer exhaustion by requesting more random bytes from the main window - * @returns Empty Promise whose resolution indicates that the buffer has been refilled + * Initializes a new proxy and loads the web worker + * @param path The path to the worker or 'openpgp.worker.js' by default + * @param n number of workers to initialize if path given + * @param config config The worker configuration + * @param worker alternative to path parameter: web worker initialized with 'openpgp.worker.js' */ - function randomCallback(): Promise; + constructor(path: string, n: number, config: object, worker: any[]); /** - * Set config from main context to worker context. - * @param config The openpgp configuration + * Message handling */ - function configure(config: object): void; + handleMessage(): void; /** - * Seed the library with entropy gathered window.crypto.getRandomValues - * as this api is only avalible in the main window. - * @param buffer Some random bytes + * Get new request ID + * @returns New unique request ID */ - function seedRandom(buffer: any[]): void; + getID(): Integer; + + /** + * Send message to worker with random data + * @param size Number of bytes to send + */ + seedRandom(size: Integer): void; + + /** + * Terminates the workers + */ + terminate(): void; /** * Generic proxy function that handles all commands from the public api. - * @param method The public api function to be delegated to the worker thread - * @param options The api function's options + * @param method the public api function to be delegated to the worker thread + * @param options the api function's options + * @returns see the corresponding public api functions for their return types */ - function delegate(method: string, options: object): void; - - /** - * Respond to the main window. - * @param event Contains event type and data - */ - function response(event: object): void; + delegate(method: string, options: object): Promise; } } - /** - * Set the path for the web worker script and create an instance of the async proxy - * @param path relative path to the worker scripts, default: 'openpgp.worker.js' - * @param n number of workers to initialize - * @param workers alternative to path parameter: web workers initialized with 'openpgp.worker.js' - */ - function initWorker(path: string, n?: number, workers?: any[]): void; + * @see module:openpgp.initWorker + * @see module:openpgp.getWorker + * @see module:openpgp.destroyWorker + * @see module:worker/async_proxy + */ + namespace worker { + /** + * Handle random buffer exhaustion by requesting more random bytes from the main window + * @returns Empty Promise whose resolution indicates that the buffer has been refilled + */ + function randomCallback(): Promise; - /** - * Returns a reference to the async proxy if the worker was initialized with openpgp.initWorker() - * @returns the async proxy or null if not initialized - */ - function getWorker(): worker.async_proxy.AsyncProxy | null; + /** + * Set config from main context to worker context. + * @param config The openpgp configuration + */ + function configure(config: object): void; - /** - * Cleanup the current instance of the web worker. - */ - function destroyWorker(): void; + /** + * Seed the library with entropy gathered window.crypto.getRandomValues + * as this api is only avalible in the main window. + * @param buffer Some random bytes + */ + function seedRandom(buffer: any[]): void; - interface UserID { - name: string; - email: string; + /** + * Generic proxy function that handles all commands from the public api. + * @param method The public api function to be delegated to the worker thread + * @param options The api function's options + */ + function delegate(method: string, options: object): void; + + /** + * Respond to the main window. + * @param event Contains event type and data + */ + function response(event: object): void; } - - interface KeyOptions { - /** - * array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] - */ - userIds: UserID[]; - /** - * (optional) The passphrase used to encrypt the resulting private key - */ - passphrase?: string; - /** - * (optional) number of bits for RSA keys: 2048 or 4096. - */ - numBits?: number; - /** - * (optional) The number of seconds after the key creation time that the key expires - */ - keyExpirationTime?: number; - /** - * (optional) elliptic curve for ECC keys: elliptic curve for ECC keys: - * curve25519, p256, p384, p521, secp256k1, - * brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1. - */ - curve?: string; - /** - * (optional) override the creation date of the key and the key signatures - */ - date?: Date; - /** - * (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] - * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt - */ - subkeys?: { sign: true, passphrase: "string" }[]; - } - - /** - * Generates a new OpenPGP key pair. Supports RSA and ECC keys. Primary and subkey will be of same type. - * @param options - * @returns The generated key object in the form: - * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } - */ - function generateKey(option: KeyOptions): Promise<{ key: key.Key, privateKeyArmored: string, publicKeyArmored: string, revocationCertificate: string }>; - - /** - * Reformats signature packets for a key and rewraps key object. - * @param privateKey private key to reformat - * @param userIds array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] - * @param passphrase (optional) The passphrase used to encrypt the resulting private key - * @param keyExpirationTime (optional) The number of seconds after the key creation time that the key expires - * @param revocationCertificate (optional) Whether the returned object should include a revocation certificate to revoke the public key - * @returns The generated key object in the form: - * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } - */ - function reformatKey(privateKey: key.Key, userIds: any[], passphrase?: string, keyExpirationTime?: number, revocationCertificate?: boolean): Promise; - - /** - * Revokes a key. Requires either a private key or a revocation certificate. - * If a revocation certificate is passed, the reasonForRevocation parameters will be ignored. - * @param key (optional) public or private key to revoke - * @param revocationCertificate (optional) revocation certificate to revoke the key with - * @param reasonForRevocation (optional) object indicating the reason for revocation - * @param reasonForRevocation.flag (optional) flag indicating the reason for revocation - * @param reasonForRevocation.string (optional) string explaining the reason for revocation - * @returns The revoked key object in the form: - * { privateKey:Key, privateKeyArmored:String, publicKey:Key, publicKeyArmored:String } - * (if private key is passed) or { publicKey:Key, publicKeyArmored:String } (otherwise) - */ - function revokeKey(key?: key.Key, revocationCertificate?: string, reasonForRevocation?: revokeKey_reasonForRevocation): Promise<{ - privateKey: key.Key, - privateKeyArmored: string, - publicKey: key.Key, - publicKeyArmored: string - } | { - publicKey: key.Key, - publicKeyArmored: string - }>; - - /** - * Unlock a private key with your passphrase. - * @param privateKey the private key that is to be decrypted - * @param passphrase the user's passphrase(s) chosen during key generation - * @returns the unlocked key object in the form: { key:Key } - */ - function decryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; - - /** - * Lock a private key with your passphrase. - * @param privateKey the private key that is to be decrypted - * @param passphrase the user's passphrase(s) chosen during key generation - * @returns the locked key object in the form: { key:Key } - */ - function encryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; - - interface EncryptOptions { - /** - * message to be encrypted as created by openpgp.message.fromText or openpgp.message.fromBinary - */ - message: message.Message; - /** - * (optional) array of keys or single key, used to encrypt the message - */ - publicKeys?: key.Key | any[]; - /** - * (optional) private keys for signing. If omitted message will not be signed - */ - privateKeys?: key.Key | any[]; - /** - * (optional) array of passwords or a single password to encrypt the message - */ - passwords?: string | any[]; - /** - * (optional) session key in the form: { data:Uint8Array, algorithm:String } - */ - sessionKey?: { data: Uint8Array, algorithm: string }; - /** - * (optional) which compression algorithm to compress the message with, defaults to what is specified in config - */ - compression?: enums.compression; - /** - * (optional) if the return values should be ascii armored or the message/signature objects - */ - armor?: boolean; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) if the signature should be detached (if true, signature will be added to returned object) - */ - detached?: boolean; - /** - * (optional) a detached signature to add to the encrypted message - */ - signature?: signature.Signature; - /** - * (optional) if the unencrypted session key should be added to returned object - */ - returnSessionKey?: boolean; - /** - * (optional) use a key ID of 0 instead of the public key IDs - */ - wildcard?: boolean; - /** - * (optional) override the creation date of the message signature - */ - date?: Date; - /** - * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - */ - fromUserIds?: UserID[]; - /** - * (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] - */ - toUserIds?: UserID[] - } - - interface EncryptResult { - data: string | ReadableStream; - message: message.Message; - signature: string | ReadableStream | signature.Signature; - sessionKey: { data: Uint8Array, algorithm: string, aeadAlgorithm: string }; - } - - /** - * Encrypts message text/data with public keys, passwords or both at once. At least either public keys or passwords - * must be specified. If private keys are specified, those will be used to sign the message. - * @param options - * @returns Object containing encrypted (and optionally signed) message in the form: - * { - * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) - * message: Message, (if `armor` was false) - * signature: string|ReadableStream|NodeStream, (if `detached` was true and `armor` was true) - * signature: Signature (if `detached` was true and `armor` was false) - * sessionKey: { data, algorithm, aeadAlgorithm } (if `returnSessionKey` was true) - * } - */ - function encrypt(options: EncryptOptions): Promise; - - interface DecryptOptions { - /** - * the message object with the encrypted data - */ - message: message.Message; - /** - * (optional) private keys with decrypted secret key data or session key - */ - privateKeys?: key.Key | key.Key[]; - /** - * (optional) passwords to decrypt the message - */ - passwords?: string | string[]; - /** - * (optional) session keys in the form: { data:Uint8Array, algorithm:String } - */ - sessionKeys?: { data: Uint8Array, algorithm: string } | { data: Uint8Array, algorithm: string }[]; - /** - * (optional) array of public keys or single key, to verify signatures - */ - publicKeys?: key.Key | key.Key[]; - /** - * (optional) whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines. - */ - format?: 'utf8' | 'binary'; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) detached signature for verification - */ - signature?: signature.Signature; - /** - * (optional) use the given date for verification instead of the current time - */ - date?: Date - } - - interface DecryptResult { - data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream, - filename: string, - signatures: { - keyid: type.keyid.Keyid, - verified: Promise, - valid: boolean - }[] - } - - /** - * Decrypts a message with the user's private key, a session key or a password. Either a private key, - * a session key or a password must be specified. - * @param options - * @returns Object containing decrypted and verified message in the form: - * { - * data: string|ReadableStream|NodeStream, (if format was 'utf8', the default) - * data: Uint8Array|ReadableStream|NodeStream, (if format was 'binary') - * filename: string, - * signatures: [ - * { - * keyid: module:type/keyid, - * verified: Promise, - * valid: boolean (if streaming was false) - * }, ... - * ] - * } - */ - function decrypt(options: DecryptOptions): Promise; - - interface SignOptions { - /** - * (cleartext) message to be signed - */ - message: cleartext.CleartextMessage | message.Message; - /** - * array of keys or single key with decrypted secret key data to sign cleartext - */ - privateKeys: key.Key | any[]; - /** - * (optional) if the return value should be ascii armored or the message object - */ - armor?: boolean; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) if the return value should contain a detached signature - */ - detached?: boolean; - /** - * (optional) override the creation date of the signature - */ - date?: Date; - /** - * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] - */ - fromUserIds?: UserID[] - } - - interface SignResult { - data: string | ReadableStream | NodeStream, - message: message.Message, - signature: string | ReadableStream | NodeStream | signature.Signature - } - - /** - * Signs a cleartext message. - * @param options - * @returns Object containing signed message in the form: - * { - * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) - * message: Message (if `armor` was false) - * } - * Or, if `detached` was true: - * { - * signature: string|ReadableStream|NodeStream, (if `armor` was true, the default) - * signature: Signature (if `armor` was false) - * } - */ - function sign(options: SignOptions): Promise; - - interface VerifyOptions { - /** - * array of publicKeys or single key, to verify signatures - */ - publicKeys: key.Key | any[]; - /** - * (cleartext) message object with signatures - */ - message: cleartext.CleartextMessage | message.Message; - /** - * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. - */ - streaming?: 'web' | 'node' | false; - /** - * (optional) detached signature for verification - */ - signature?: signature.Signature; - /** - * (optional) use the given date for verification instead of the current time - */ - date?: Date - } - - interface VerifyResult { - data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream | NodeStream, - signatures: { - keyid: type.keyid.Keyid, - verified: Promise, - valid: boolean - }[] - } - - /** - * Verifies signatures of cleartext signed message - * @param options - * @returns Object containing verified message in the form: - * { - * data: string|ReadableStream|NodeStream, (if `message` was a CleartextMessage) - * data: Uint8Array|ReadableStream|NodeStream, (if `message` was a Message) - * signatures: [ - * { - * keyid: module:type/keyid, - * verified: Promise, - * valid: boolean (if `streaming` was false) - * }, ... - * ] - * } - */ - function verify(options: VerifyOptions): Promise; - - /** - * Encrypt a symmetric session key with public keys, passwords, or both at once. At least either public keys - * or passwords must be specified. - * @param data the session key to be encrypted e.g. 16 random bytes (for aes128) - * @param algorithm algorithm of the symmetric session key e.g. 'aes128' or 'aes256' - * @param aeadAlgorithm (optional) aead algorithm, e.g. 'eax' or 'ocb' - * @param publicKeys (optional) array of public keys or single key, used to encrypt the key - * @param passwords (optional) passwords for the message - * @param wildcard (optional) use a key ID of 0 instead of the public key IDs - * @param date (optional) override the date - * @param toUserIds (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] - * @returns the encrypted session key packets contained in a message object - */ - function encryptSessionKey(data: Uint8Array, algorithm: string, aeadAlgorithm?: string, publicKeys?: key.Key | key.Key[], passwords?: string | string[], wildcard?: boolean, date?: Date, toUserIds?: any[]): Promise; - - /** - * Decrypt symmetric session keys with a private key or password. Either a private key or - * a password must be specified. - * @param message a message object containing the encrypted session key packets - * @param privateKeys (optional) private keys with decrypted secret key data - * @param passwords (optional) passwords to decrypt the session key - * @returns Array of decrypted session key, algorithm pairs in form: - * { data:Uint8Array, algorithm:String } - * or 'undefined' if no key packets found - */ - function decryptSessionKeys(message: message.Message, privateKeys?: key.Key | key.Key[], passwords?: string | string[]): Promise<{ data: Uint8Array, algorithm: string }[] | undefined>; - - /** - * Input validation - */ - function checkString(): void; - - /** - * Normalize parameter to an array if it is not undefined. - * @param param the parameter to be normalized - * @returns the resulting array or undefined - */ - function toArray(param: object): any[] | undefined; - - /** - * Convert data to or from Stream - * @param data the data to convert - * @param streaming (optional) whether to return a ReadableStream - * @returns the data in the respective format - */ - function convertStream(data: object, streaming?: 'web' | 'node' | false): object; - - /** - * Convert object properties from Stream - * @param obj the data to convert - * @param streaming (optional) whether to return ReadableStreams - * @param keys (optional) which keys to return as streams, if possible - * @returns the data in the respective format - */ - function convertStreams(obj: object, streaming: 'web' | 'node' | false, keys: any[]): object; - - /** - * Link result.data to the message stream for cancellation. - * Also, forward errors in the message to result.data. - * @param result the data to convert - * @param message message object - * @param erroringStream (optional) stream which either errors or gets closed without data - * @returns - */ - function linkStreams(result: object, message: message.Message, erroringStream: ReadableStream): object; - - /** - * Wait until signature objects have been verified - * @param signatures list of signatures - */ - function prepareSignatures(signatures: object): void; - - /** - * Global error handler that logs the stack trace and rethrows a high lvl error message. - * @param message A human readable high level error Message - * @param error The internal error that caused the failure - */ - function onError(message: string, error: Error): void; - - /** - * Check for native AEAD support and configuration by the user. Only - * browsers that implement the current WebCrypto specification support - * native GCM. Native EAX is built on CTR and CBC, which current - * browsers support. OCB and CFB are not natively supported. - * @returns If authenticated encryption should be used - */ - function nativeAEAD(): boolean; } + + +/** + * Set the path for the web worker script and create an instance of the async proxy + * @param path relative path to the worker scripts, default: 'openpgp.worker.js' + * @param n number of workers to initialize + * @param workers alternative to path parameter: web workers initialized with 'openpgp.worker.js' + */ +export function initWorker(path: string, n?: number, workers?: any[]): void; + +/** + * Returns a reference to the async proxy if the worker was initialized with openpgp.initWorker() + * @returns the async proxy or null if not initialized + */ +export function getWorker(): worker.async_proxy.AsyncProxy | null; + +/** + * Cleanup the current instance of the web worker. + */ +export function destroyWorker(): void; + +export interface UserID { + name: string; + email: string; +} + +export interface KeyOptions { + /** + * array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] + */ + userIds: UserID[]; + /** + * (optional) The passphrase used to encrypt the resulting private key + */ + passphrase?: string; + /** + * (optional) number of bits for RSA keys: 2048 or 4096. + */ + numBits?: number; + /** + * (optional) The number of seconds after the key creation time that the key expires + */ + keyExpirationTime?: number; + /** + * (optional) elliptic curve for ECC keys: elliptic curve for ECC keys: + * curve25519, p256, p384, p521, secp256k1, + * brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1. + */ + curve?: string; + /** + * (optional) override the creation date of the key and the key signatures + */ + date?: Date; + /** + * (optional) options for each subkey, default to main key options. e.g. [ {sign: true, passphrase: '123'}] + * sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt + */ + subkeys?: { sign: true, passphrase: "string" }[]; +} + +/** + * Generates a new OpenPGP key pair. Supports RSA and ECC keys. Primary and subkey will be of same type. + * @param options + * @returns The generated key object in the form: + * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } + */ +export function generateKey(option: KeyOptions): Promise<{ key: key.Key, privateKeyArmored: string, publicKeyArmored: string, revocationCertificate: string }>; + +/** + * Reformats signature packets for a key and rewraps key object. + * @param privateKey private key to reformat + * @param userIds array of user IDs e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] + * @param passphrase (optional) The passphrase used to encrypt the resulting private key + * @param keyExpirationTime (optional) The number of seconds after the key creation time that the key expires + * @param revocationCertificate (optional) Whether the returned object should include a revocation certificate to revoke the public key + * @returns The generated key object in the form: + * { key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String } + */ +export function reformatKey(privateKey: key.Key, userIds: any[], passphrase?: string, keyExpirationTime?: number, revocationCertificate?: boolean): Promise; + +/** + * Revokes a key. Requires either a private key or a revocation certificate. + * If a revocation certificate is passed, the reasonForRevocation parameters will be ignored. + * @param key (optional) public or private key to revoke + * @param revocationCertificate (optional) revocation certificate to revoke the key with + * @param reasonForRevocation (optional) object indicating the reason for revocation + * @param reasonForRevocation.flag (optional) flag indicating the reason for revocation + * @param reasonForRevocation.string (optional) string explaining the reason for revocation + * @returns The revoked key object in the form: + * { privateKey:Key, privateKeyArmored:String, publicKey:Key, publicKeyArmored:String } + * (if private key is passed) or { publicKey:Key, publicKeyArmored:String } (otherwise) + */ +export function revokeKey(key?: key.Key, revocationCertificate?: string, reasonForRevocation?: revokeKey_reasonForRevocation): Promise<{ + privateKey: key.Key, + privateKeyArmored: string, + publicKey: key.Key, + publicKeyArmored: string +} | { + publicKey: key.Key, + publicKeyArmored: string +}>; + +/** + * Unlock a private key with your passphrase. + * @param privateKey the private key that is to be decrypted + * @param passphrase the user's passphrase(s) chosen during key generation + * @returns the unlocked key object in the form: { key:Key } + */ +export function decryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; + +/** + * Lock a private key with your passphrase. + * @param privateKey the private key that is to be decrypted + * @param passphrase the user's passphrase(s) chosen during key generation + * @returns the locked key object in the form: { key:Key } + */ +export function encryptKey(privateKey: key.Key, passphrase: string | any[]): Promise<{ key: key.Key }>; + +export interface EncryptOptions { + /** + * message to be encrypted as created by openpgp.message.fromText or openpgp.message.fromBinary + */ + message: message.Message; + /** + * (optional) array of keys or single key, used to encrypt the message + */ + publicKeys?: key.Key | any[]; + /** + * (optional) private keys for signing. If omitted message will not be signed + */ + privateKeys?: key.Key | any[]; + /** + * (optional) array of passwords or a single password to encrypt the message + */ + passwords?: string | any[]; + /** + * (optional) session key in the form: { data:Uint8Array, algorithm:String } + */ + sessionKey?: { data: Uint8Array, algorithm: string }; + /** + * (optional) which compression algorithm to compress the message with, defaults to what is specified in config + */ + compression?: enums.compression; + /** + * (optional) if the return values should be ascii armored or the message/signature objects + */ + armor?: boolean; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) if the signature should be detached (if true, signature will be added to returned object) + */ + detached?: boolean; + /** + * (optional) a detached signature to add to the encrypted message + */ + signature?: signature.Signature; + /** + * (optional) if the unencrypted session key should be added to returned object + */ + returnSessionKey?: boolean; + /** + * (optional) use a key ID of 0 instead of the public key IDs + */ + wildcard?: boolean; + /** + * (optional) override the creation date of the message signature + */ + date?: Date; + /** + * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + */ + fromUserIds?: UserID[]; + /** + * (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Robert Receiver', email:'robert@openpgp.org' }] + */ + toUserIds?: UserID[] +} + +export interface EncryptResult { + data: string | ReadableStream; + message: message.Message; + signature: string | ReadableStream | signature.Signature; + sessionKey: { data: Uint8Array, algorithm: string, aeadAlgorithm: string }; +} + +/** + * Encrypts message text/data with public keys, passwords or both at once. At least either public keys or passwords + * must be specified. If private keys are specified, those will be used to sign the message. + * @param options + * @returns Object containing encrypted (and optionally signed) message in the form: + * { + * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) + * message: Message, (if `armor` was false) + * signature: string|ReadableStream|NodeStream, (if `detached` was true and `armor` was true) + * signature: Signature (if `detached` was true and `armor` was false) + * sessionKey: { data, algorithm, aeadAlgorithm } (if `returnSessionKey` was true) + * } + */ +export function encrypt(options: EncryptOptions): Promise; + +export interface DecryptOptions { + /** + * the message object with the encrypted data + */ + message: message.Message; + /** + * (optional) private keys with decrypted secret key data or session key + */ + privateKeys?: key.Key | key.Key[]; + /** + * (optional) passwords to decrypt the message + */ + passwords?: string | string[]; + /** + * (optional) session keys in the form: { data:Uint8Array, algorithm:String } + */ + sessionKeys?: { data: Uint8Array, algorithm: string } | { data: Uint8Array, algorithm: string }[]; + /** + * (optional) array of public keys or single key, to verify signatures + */ + publicKeys?: key.Key | key.Key[]; + /** + * (optional) whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines. + */ + format?: 'utf8' | 'binary'; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) detached signature for verification + */ + signature?: signature.Signature; + /** + * (optional) use the given date for verification instead of the current time + */ + date?: Date +} + +export interface DecryptResult { + data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream, + filename: string, + signatures: { + keyid: type.keyid.Keyid, + verified: Promise, + valid: boolean + }[] +} + +/** + * Decrypts a message with the user's private key, a session key or a password. Either a private key, + * a session key or a password must be specified. + * @param options + * @returns Object containing decrypted and verified message in the form: + * { + * data: string|ReadableStream|NodeStream, (if format was 'utf8', the default) + * data: Uint8Array|ReadableStream|NodeStream, (if format was 'binary') + * filename: string, + * signatures: [ + * { + * keyid: module:type/keyid, + * verified: Promise, + * valid: boolean (if streaming was false) + * }, ... + * ] + * } + */ +export function decrypt(options: DecryptOptions): Promise; + +export interface SignOptions { + /** + * (cleartext) message to be signed + */ + message: cleartext.CleartextMessage | message.Message; + /** + * array of keys or single key with decrypted secret key data to sign cleartext + */ + privateKeys: key.Key | any[]; + /** + * (optional) if the return value should be ascii armored or the message object + */ + armor?: boolean; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) if the return value should contain a detached signature + */ + detached?: boolean; + /** + * (optional) override the creation date of the signature + */ + date?: Date; + /** + * (optional) array of user IDs to sign with, one per key in `privateKeys`, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }] + */ + fromUserIds?: UserID[] +} + +export interface SignResult { + data: string | ReadableStream | NodeStream, + message: message.Message, + signature: string | ReadableStream | NodeStream | signature.Signature +} + +/** + * Signs a cleartext message. + * @param options + * @returns Object containing signed message in the form: + * { + * data: string|ReadableStream|NodeStream, (if `armor` was true, the default) + * message: Message (if `armor` was false) + * } + * Or, if `detached` was true: + * { + * signature: string|ReadableStream|NodeStream, (if `armor` was true, the default) + * signature: Signature (if `armor` was false) + * } + */ +export function sign(options: SignOptions): Promise; + +export interface VerifyOptions { + /** + * array of publicKeys or single key, to verify signatures + */ + publicKeys: key.Key | any[]; + /** + * (cleartext) message object with signatures + */ + message: cleartext.CleartextMessage | message.Message; + /** + * (optional) whether to return data as a stream. Defaults to the type of stream `message` was created from, if any. + */ + streaming?: 'web' | 'node' | false; + /** + * (optional) detached signature for verification + */ + signature?: signature.Signature; + /** + * (optional) use the given date for verification instead of the current time + */ + date?: Date +} + +export interface VerifyResult { + data: string | ReadableStream | NodeStream | Uint8Array | ReadableStream | NodeStream, + signatures: { + keyid: type.keyid.Keyid, + verified: Promise, + valid: boolean + }[] +} + +/** + * Verifies signatures of cleartext signed message + * @param options + * @returns Object containing verified message in the form: + * { + * data: string|ReadableStream|NodeStream, (if `message` was a CleartextMessage) + * data: Uint8Array|ReadableStream|NodeStream, (if `message` was a Message) + * signatures: [ + * { + * keyid: module:type/keyid, + * verified: Promise, + * valid: boolean (if `streaming` was false) + * }, ... + * ] + * } + */ +export function verify(options: VerifyOptions): Promise; + +/** + * Encrypt a symmetric session key with public keys, passwords, or both at once. At least either public keys + * or passwords must be specified. + * @param data the session key to be encrypted e.g. 16 random bytes (for aes128) + * @param algorithm algorithm of the symmetric session key e.g. 'aes128' or 'aes256' + * @param aeadAlgorithm (optional) aead algorithm, e.g. 'eax' or 'ocb' + * @param publicKeys (optional) array of public keys or single key, used to encrypt the key + * @param passwords (optional) passwords for the message + * @param wildcard (optional) use a key ID of 0 instead of the public key IDs + * @param date (optional) override the date + * @param toUserIds (optional) array of user IDs to encrypt for, one per key in `publicKeys`, e.g. [ { name:'Phil Zimmermann', email:'phil@openpgp.org' }] + * @returns the encrypted session key packets contained in a message object + */ +export function encryptSessionKey(data: Uint8Array, algorithm: string, aeadAlgorithm?: string, publicKeys?: key.Key | key.Key[], passwords?: string | string[], wildcard?: boolean, date?: Date, toUserIds?: any[]): Promise; + +/** + * Decrypt symmetric session keys with a private key or password. Either a private key or + * a password must be specified. + * @param message a message object containing the encrypted session key packets + * @param privateKeys (optional) private keys with decrypted secret key data + * @param passwords (optional) passwords to decrypt the session key + * @returns Array of decrypted session key, algorithm pairs in form: + * { data:Uint8Array, algorithm:String } + * or 'undefined' if no key packets found + */ +export function decryptSessionKeys(message: message.Message, privateKeys?: key.Key | key.Key[], passwords?: string | string[]): Promise<{ data: Uint8Array, algorithm: string }[] | undefined>; + +/** + * Input validation + */ +export function checkString(): void; + +/** + * Normalize parameter to an array if it is not undefined. + * @param param the parameter to be normalized + * @returns the resulting array or undefined + */ +export function toArray(param: object): any[] | undefined; + +/** + * Convert data to or from Stream + * @param data the data to convert + * @param streaming (optional) whether to return a ReadableStream + * @returns the data in the respective format + */ +export function convertStream(data: object, streaming?: 'web' | 'node' | false): object; + +/** + * Convert object properties from Stream + * @param obj the data to convert + * @param streaming (optional) whether to return ReadableStreams + * @param keys (optional) which keys to return as streams, if possible + * @returns the data in the respective format + */ +export function convertStreams(obj: object, streaming: 'web' | 'node' | false, keys: any[]): object; + +/** + * Link result.data to the message stream for cancellation. + * Also, forward errors in the message to result.data. + * @param result the data to convert + * @param message message object + * @param erroringStream (optional) stream which either errors or gets closed without data + * @returns + */ +export function linkStreams(result: object, message: message.Message, erroringStream: ReadableStream): object; + +/** + * Wait until signature objects have been verified + * @param signatures list of signatures + */ +export function prepareSignatures(signatures: object): void; + +/** + * Global error handler that logs the stack trace and rethrows a high lvl error message. + * @param message A human readable high level error Message + * @param error The internal error that caused the failure + */ +export function onError(message: string, error: Error): void; + +/** + * Check for native AEAD support and configuration by the user. Only + * browsers that implement the current WebCrypto specification support + * native GCM. Native EAX is built on CTR and CBC, which current + * browsers support. OCB and CFB are not natively supported. + * @returns If authenticated encryption should be used + */ +export function nativeAEAD(): boolean; diff --git a/types/openpgp/ts3.2/openpgp-tests.ts b/types/openpgp/ts3.2/openpgp-tests.ts index fc3efeeda0..62e580fd4b 100644 --- a/types/openpgp/ts3.2/openpgp-tests.ts +++ b/types/openpgp/ts3.2/openpgp-tests.ts @@ -1,4 +1,4 @@ -import { openpgp } from "openpgp"; +import openpgp from "openpgp"; // Open PGP Sample codes diff --git a/types/openpgp/tslint.json b/types/openpgp/tslint.json index 3db8366030..4e740106cc 100644 --- a/types/openpgp/tslint.json +++ b/types/openpgp/tslint.json @@ -5,6 +5,7 @@ "array-type": false, "ban-types": false, "dt-header": false, + "npm-naming": false, "jsdoc-format": false, "max-line-length": false, "no-consecutive-blank-lines": false, diff --git a/types/opentok/tslint.json b/types/opentok/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/opentok/tslint.json +++ b/types/opentok/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/openui5/tslint.json b/types/openui5/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/openui5/tslint.json +++ b/types/openui5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/optimist/tslint.json b/types/optimist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/optimist/tslint.json +++ b/types/optimist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/oracledb/tslint.json b/types/oracledb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/oracledb/tslint.json +++ b/types/oracledb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/orchestrator/tslint.json b/types/orchestrator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/orchestrator/tslint.json +++ b/types/orchestrator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/osmtogeojson/tslint.json b/types/osmtogeojson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/osmtogeojson/tslint.json +++ b/types/osmtogeojson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/owlcarousel/tslint.json b/types/owlcarousel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/owlcarousel/tslint.json +++ b/types/owlcarousel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/p2/tslint.json b/types/p2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/p2/tslint.json +++ b/types/p2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/packery/tslint.json b/types/packery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/packery/tslint.json +++ b/types/packery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/page-icon/tslint.json b/types/page-icon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/page-icon/tslint.json +++ b/types/page-icon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/page/tslint.json b/types/page/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/page/tslint.json +++ b/types/page/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/papaparse/tslint.json b/types/papaparse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/papaparse/tslint.json +++ b/types/papaparse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/paper/tslint.json b/types/paper/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/paper/tslint.json +++ b/types/paper/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/paralleljs/tslint.json b/types/paralleljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/paralleljs/tslint.json +++ b/types/paralleljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/parcel-env/tslint.json b/types/parcel-env/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/parcel-env/tslint.json +++ b/types/parcel-env/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/parse-glob/tslint.json b/types/parse-glob/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/parse-glob/tslint.json +++ b/types/parse-glob/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/parse-mockdb/tslint.json b/types/parse-mockdb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/parse-mockdb/tslint.json +++ b/types/parse-mockdb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 7dcefdbf3d..ba3d546ca5 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for parse 2.1.1 +// Type definitions for parse 2.2.1 // Project: https://parseplatform.org/ // Definitions by: Ullisen Media Group // David Poetzsch-Heffter @@ -8,6 +8,7 @@ // Otherwise SAS // Andrew Goldis // Alexandre Hétu Rivard +// Diamond Lewis // Jong Eun Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -23,6 +24,10 @@ declare namespace Parse { let liveQueryServerURL: string; let VERSION: string; + interface BatchSizeOption { + batchSize?: number; + } + interface SuccessOption { success?: Function; } @@ -31,6 +36,24 @@ declare namespace Parse { error?: Function; } + interface FullOptions { + success?: Function; + error?: Function; + useMasterKey?: boolean; + sessionToken?: string; + installationId?: string; + progress?: Function; + } + + interface RequestOptions { + useMasterKey?: boolean; + sessionToken?: string; + installationId?: string; + batchSize?: number; + include?: string | string[]; + progress?: Function; + } + interface SuccessFailureOptions extends SuccessOption, ErrorOption { } @@ -265,19 +288,26 @@ declare namespace Parse { constructor(className?: string, options?: any); constructor(attributes?: string[], options?: any); - static extend(className: string, protoProps?: any, classProps?: any): any; - static fromJSON(json: any, override: boolean): any; - + static createWithoutData(id: string): T; + static destroyAll(list: T[], options?: Object.DestroyAllOptions): Promise; + static extend(className: string | { className: string }, protoProps?: any, classProps?: any): any; static fetchAll(list: T[], options: Object.FetchAllOptions): Promise; static fetchAllIfNeeded(list: T[], options: Object.FetchAllOptions): Promise; - static destroyAll(list: T[], options?: Object.DestroyAllOptions): Promise; - static saveAll(list: T[], options?: Object.SaveAllOptions): Promise; + static fetchAllWithInclude(list: T[], keys: string | Array>, options: RequestOptions): Promise; + static fromJSON(json: any, override: boolean): any; + static pinAll(objects: Object[]): Promise; + static pinAllWithName(name: string, objects: Object[]): Promise; static registerSubclass(className: string, clazz: new (options?: any) => T): void; - static createWithoutData(id: string): T; + static saveAll(list: T[], options?: Object.SaveAllOptions): Promise; + static unPinAll(objects: Object[]): Promise; + static unPinAllObjects(): Promise; + static unPinAllObjectsWithName(name: string): Promise; + static unPinAllWithName(name: string, objects: Object[]): Promise; - initialize(): void; - add(attr: string, item: any): this; - addUnique(attr: string, item: any): any; + add(attr: string, item: any): this | boolean; + addAll(attr: string, items: any[]): this | boolean; + addAllUnique(attr: string, items: any[]): this | boolean; + addUnique(attr: string, item: any): this | boolean; change(options: any): this; changedAttributes(diff: any): boolean; clear(options: any): any; @@ -285,21 +315,29 @@ declare namespace Parse { destroy(options?: Object.DestroyOptions): Promise; dirty(attr?: string): boolean; dirtyKeys(): string[]; + equals(other: any): boolean; escape(attr: string): string; existed(): boolean; fetch(options?: Object.FetchOptions): Promise; + fetchFromLocalDatastore(): Promise | void; + fetchWithInclude(keys: string | Array>, options?: RequestOptions): Promise; get(attr: string): any | undefined; getACL(): ACL | undefined; has(attr: string): boolean; hasChanged(attr: string): boolean; increment(attr: string, amount?: number): any; + initialize(): void; isNew(): boolean; + isPinned(): Promise; isValid(): boolean; op(attr: string): any; + pin(): Promise; + pinWithName(name: string): Promise; previous(attr: string): any; previousAttributes(): any; relation(attr: string): Relation; - remove(attr: string, item: any): any; + remove(attr: string, item: any): this | boolean; + removeAll(attr: string, items: any): this | boolean; revert(): void; save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise; save(key: string, value: any, options?: Object.SaveOptions): Promise; @@ -308,6 +346,8 @@ declare namespace Parse { set(attrs: object, options?: Object.SetOptions): boolean; setACL(acl: ACL, options?: SuccessFailureOptions): boolean; toPointer(): Pointer; + unPin(): Promise; + unPinWithName(name: string): Promise; unset(attr: string, options?: any): any; validate(attrs: any, options?: SuccessFailureOptions): boolean; } @@ -315,7 +355,7 @@ declare namespace Parse { namespace Object { interface DestroyOptions extends SuccessFailureOptions, WaitOption, ScopeOptions { } - interface DestroyAllOptions extends SuccessFailureOptions, ScopeOptions { } + interface DestroyAllOptions extends BatchSizeOption, ScopeOptions { } interface FetchAllOptions extends SuccessFailureOptions, ScopeOptions { } @@ -323,13 +363,18 @@ declare namespace Parse { interface SaveOptions extends SuccessFailureOptions, SilentOption, ScopeOptions, WaitOption { } - interface SaveAllOptions extends SuccessFailureOptions, ScopeOptions { } + interface SaveAllOptions extends BatchSizeOption, ScopeOptions { } interface SetOptions extends ErrorOption, SilentOption { promise?: any; } } + class Polygon extends BaseObject { + constructor(arg1: GeoPoint[] | number[][]); + containsPoint(point: GeoPoint): boolean; + equals(other: Polygon | any): boolean; + } /** * Every Parse application installed on a device registered for * push notifications has an associated Installation object. @@ -414,18 +459,23 @@ declare namespace Parse { constructor(objectClass: string); constructor(objectClass: new (...args: any[]) => T); + static and(...args: Query[]): Query; + static fromJSON(className: string, json: any): Query; + static nor(...args: Query[]): Query; static or(...var_args: Query[]): Query; - aggregate(pipeline: Query.AggregationOptions|Query.AggregationOptions[]): Query; addAscending(key: string): Query; addAscending(key: string[]): Query; addDescending(key: string): Query; addDescending(key: string[]): Query; ascending(key: string): Query; ascending(key: string[]): Query; + aggregate(pipeline: Query.AggregationOptions|Query.AggregationOptions[]): Query; + containedBy(key: string, values: any[]): Query; containedIn(key: string, values: any[]): Query; contains(key: string, substring: string): Query; containsAll(key: string, values: any[]): Query; + containsAllStartingWith(key: string, values: any[]): Query; count(options?: Query.CountOptions): Promise; descending(key: string): Query; descending(key: string[]): Query; @@ -439,12 +489,16 @@ declare namespace Parse { exists(key: string): Query; find(options?: Query.FindOptions): Promise; first(options?: Query.FirstOptions): Promise; + fromLocalDatastore(): void; + fromPin(): void; + fromPinWithName(name: string): void; fullText(key: string, value: string, options?: Query.FullTextOptions): Query; get(objectId: string, options?: Query.GetOptions): Promise; greaterThan(key: string, value: any): Query; greaterThanOrEqualTo(key: string, value: any): Query; include(key: string): Query; include(keys: string[]): Query; + includeAll(): Query; lessThan(key: string, value: any): Query; lessThanOrEqualTo(key: string, value: any): Query; limit(n: number): Query; @@ -454,13 +508,17 @@ declare namespace Parse { near(key: string, point: GeoPoint): Query; notContainedIn(key: string, values: any[]): Query; notEqualTo(key: string, value: any): Query; + polygonContains(key: string, point: GeoPoint): Query; select(...keys: string[]): Query; skip(n: number): Query; + sortByTextScore(): this; startsWith(key: string, prefix: string): Query; subscribe(): LiveQuerySubscription; + withJSON(json: any): this; withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query; withinKilometers(key: string, point: GeoPoint, maxDistance: number): Query; withinMiles(key: string, point: GeoPoint, maxDistance: number): Query; + withinPolygon(key: string, points: GeoPoint[]): Query; withinRadians(key: string, point: GeoPoint, maxDistance: number): Query; } @@ -598,6 +656,7 @@ subscription.on('close', () => {}); class Config extends Object { static get(options?: SuccessFailureOptions): Promise; static current(): Config; + static save(attr: any): Promise; get(attr: string): any; escape(attr: string): any; @@ -621,15 +680,16 @@ subscription.on('close', () => {}); */ class User extends Object { + static allowCustomUserClass(isAllowed: boolean): void; + static become(sessionToken: string, options?: UseMasterKeyOption): Promise; static current(): User | undefined; static currentAsync(): Promise; static signUp(username: string, password: string, attrs: any, options?: SignUpOptions): Promise; static logIn(username: string, password: string, options?: SuccessFailureOptions): Promise; static logOut(): Promise; - static allowCustomUserClass(isAllowed: boolean): void; - static become(sessionToken: string, options?: SuccessFailureOptions): Promise; static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; static extend(protoProps?: any, classProps?: any): any; + static hydrate(userJSON: any): Promise; signUp(attrs: any, options?: SignUpOptions): Promise; logIn(options?: SuccessFailureOptions): Promise; @@ -961,6 +1021,23 @@ subscription.on('close', () => {}); */ function setAsyncStorage(AsyncStorage: any): void; + /** + * Gets all contents from Local Datastore. + */ + function dumpLocalDatastore(): Promise<{ [key: string]: any }>; + + /** + * Enable pinning in your application. + * This must be called before your application can use pinning. + */ + function enableLocalDatastore(): void; + + /** + * Flag that indicates whether Local Datastore is enabled. + */ + function isLocalDatastoreEnabled(): boolean; + + function setLocalDatastoreController(controller: any): void; } declare module "parse/node" { diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 1c430b1807..1b91772746 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -14,6 +14,10 @@ class Game extends Parse.Object { } } +function test_config() { + Parse.Config.save({ foo: 'bar' }); +} + function test_object() { const game = new Game(); @@ -51,10 +55,18 @@ function test_object() { gameScore.increment("score"); gameScore.addUnique("skills", "flying"); gameScore.addUnique("skills", "kungfu"); - + gameScore.addAll("skills", ["kungfu"]); + gameScore.addAllUnique("skills", ["kungfu"]); + gameScore.remove('skills', 'flying'); + gameScore.removeAll('skills', ["kungFu"]); game.set("gameScore", gameScore); const gameCopy = Game.fromJSON(JSON.parse(JSON.stringify(game)), true); + + const object = new Parse.Object('TestObject'); + object.equals(gameScore); + object.fetchWithInclude(['key1', 'key2']); + } function test_query() { @@ -87,6 +99,7 @@ function test_query() { // Restricts to wins >= 50 query.greaterThanOrEqualTo("wins", 50); + query.containedBy('place', ['1', '2']); // Finds scores from any of Jonathan, Dario, or Shawn query.containedIn("playerName", ["Jonathan Walsh", "Dario Wunsch", "Shawn Simon"]); @@ -109,13 +122,15 @@ function test_query() { // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. query.containsAll("arrayKey", [2, 3, 4]); + query.containsAllStartingWith("arrayKey", [2, 3, 4]); query.startsWith("name", "Big Daddy's"); query.equalTo("score", gameScore); query.exists("score"); query.include("score"); query.include(["score.team"]); - + query.includeAll(); + query.sortByTextScore(); // Find objects that match the aggregation pipeline query.aggregate({ group:{ @@ -254,6 +269,12 @@ function test_user_acl_roles() { // The token could not be validated. }); + Parse.User.hydrate({}).then(function (user) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + const game = new Game(); game.set("score", new GameScore()); game.setACL(new Parse.ACL(Parse.User.current())); @@ -517,3 +538,47 @@ function test_query_subscribe() { // unsubscribe subscription.unsubscribe(); } + +function test_serverURL() { + Parse.serverURL = 'http://localhost:1337/parse'; +} +function test_polygon() { + const point = new Parse.GeoPoint(1,2); + const polygon1 = new Parse.Polygon([[0,0], [1,0], [1,1], [0,1]]); + const polygon2 = new Parse.Polygon([point, point, point]); + polygon1.equals(polygon2); + polygon1.containsPoint(point); + + const query = new Parse.Query('TestObject'); + query.polygonContains('key', point); + query.withinPolygon('key', [point, point, point]); +} + +async function test_local_datastore() { + Parse.enableLocalDatastore(); + const name = 'test_pin'; + const obj = new Parse.Object('TestObject'); + await obj.pin(); + await obj.unPin(); + await obj.isPinned(); + await obj.pinWithName(name); + await obj.unPinWithName(name); + await obj.fetchFromLocalDatastore(); + + await Parse.Object.pinAll([obj]); + await Parse.Object.unPinAll([obj]); + await Parse.Object.pinAllWithName(name, [obj]); + await Parse.Object.unPinAllWithName(name, [obj]); + await Parse.Object.unPinAllObjects(); + await Parse.Object.unPinAllObjectsWithName(name); + + const flag = Parse.isLocalDatastoreEnabled(); + const LDS = await Parse.dumpLocalDatastore(); + + const query = new Parse.Query('TestObject'); + query.fromPin(); + query.fromPinWithName(name); + query.fromLocalDatastore(); + + Parse.setLocalDatastoreController({}); +} diff --git a/types/parse/tslint.json b/types/parse/tslint.json index e2172b7f24..158db48e64 100644 --- a/types/parse/tslint.json +++ b/types/parse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-beam/tslint.json b/types/passport-beam/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-beam/tslint.json +++ b/types/passport-beam/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-google-oauth/tslint.json b/types/passport-google-oauth/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-google-oauth/tslint.json +++ b/types/passport-google-oauth/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-http-bearer/tslint.json b/types/passport-http-bearer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-http-bearer/tslint.json +++ b/types/passport-http-bearer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-jwt/tslint.json b/types/passport-jwt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-jwt/tslint.json +++ b/types/passport-jwt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-local-mongoose/tslint.json b/types/passport-local-mongoose/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/passport-local-mongoose/tslint.json +++ b/types/passport-local-mongoose/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-local/tslint.json b/types/passport-local/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-local/tslint.json +++ b/types/passport-local/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-oauth2-client-password/tslint.json b/types/passport-oauth2-client-password/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-oauth2-client-password/tslint.json +++ b/types/passport-oauth2-client-password/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-strategy/tslint.json b/types/passport-strategy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-strategy/tslint.json +++ b/types/passport-strategy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/passport-twitter/tslint.json b/types/passport-twitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/passport-twitter/tslint.json +++ b/types/passport-twitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/password-hash/tslint.json b/types/password-hash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/password-hash/tslint.json +++ b/types/password-hash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/path-parse/tslint.json b/types/path-parse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/path-parse/tslint.json +++ b/types/path-parse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pathfinding/tslint.json b/types/pathfinding/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pathfinding/tslint.json +++ b/types/pathfinding/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pathjs/tslint.json b/types/pathjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pathjs/tslint.json +++ b/types/pathjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/paypal-cordova-plugin/tslint.json b/types/paypal-cordova-plugin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/paypal-cordova-plugin/tslint.json +++ b/types/paypal-cordova-plugin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pdfjs-dist/tslint.json b/types/pdfjs-dist/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/pdfjs-dist/tslint.json +++ b/types/pdfjs-dist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pdfkit/tslint.json b/types/pdfkit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pdfkit/tslint.json +++ b/types/pdfkit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pdfobject/tslint.json b/types/pdfobject/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pdfobject/tslint.json +++ b/types/pdfobject/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pebblekitjs/tslint.json b/types/pebblekitjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pebblekitjs/tslint.json +++ b/types/pebblekitjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/peerjs/tslint.json b/types/peerjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/peerjs/tslint.json +++ b/types/peerjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pegjs/tslint.json b/types/pegjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pegjs/tslint.json +++ b/types/pegjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/persona/tslint.json b/types/persona/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/persona/tslint.json +++ b/types/persona/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pg-pool/tslint.json b/types/pg-pool/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pg-pool/tslint.json +++ b/types/pg-pool/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pgwmodal/tslint.json b/types/pgwmodal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pgwmodal/tslint.json +++ b/types/pgwmodal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phantom/tslint.json b/types/phantom/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/phantom/tslint.json +++ b/types/phantom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phantomcss/tslint.json b/types/phantomcss/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phantomcss/tslint.json +++ b/types/phantomcss/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phantomjs/tslint.json b/types/phantomjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phantomjs/tslint.json +++ b/types/phantomjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phone-formatter/tslint.json b/types/phone-formatter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phone-formatter/tslint.json +++ b/types/phone-formatter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phone/tslint.json b/types/phone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phone/tslint.json +++ b/types/phone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phonegap-facebook-plugin/tslint.json b/types/phonegap-facebook-plugin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phonegap-facebook-plugin/tslint.json +++ b/types/phonegap-facebook-plugin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phonegap-nfc/tslint.json b/types/phonegap-nfc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phonegap-nfc/tslint.json +++ b/types/phonegap-nfc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phonegap-plugin-barcodescanner/tslint.json b/types/phonegap-plugin-barcodescanner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/phonegap-plugin-barcodescanner/tslint.json +++ b/types/phonegap-plugin-barcodescanner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/phonegap/tslint.json b/types/phonegap/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/phonegap/tslint.json +++ b/types/phonegap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/photonui/tslint.json b/types/photonui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/photonui/tslint.json +++ b/types/photonui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/photoswipe/tslint.json b/types/photoswipe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/photoswipe/tslint.json +++ b/types/photoswipe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/physijs/tslint.json b/types/physijs/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/physijs/tslint.json +++ b/types/physijs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pi-spi/tslint.json b/types/pi-spi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pi-spi/tslint.json +++ b/types/pi-spi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pickadate/tslint.json b/types/pickadate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pickadate/tslint.json +++ b/types/pickadate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pify/tslint.json b/types/pify/tslint.json index 7f51cc6e38..f0468d52dc 100644 --- a/types/pify/tslint.json +++ b/types/pify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pinkyswear/tslint.json b/types/pinkyswear/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pinkyswear/tslint.json +++ b/types/pinkyswear/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pino/index.d.ts b/types/pino/index.d.ts index 610ae076ee..ff4ba1f77c 100644 --- a/types/pino/index.d.ts +++ b/types/pino/index.d.ts @@ -444,6 +444,11 @@ declare namespace P { * Flushes the content of the buffer in extreme mode. It has no effect if extreme mode is not enabled. */ flush(): void; + + /** + * A utility method for determining if a given log level will write to the destination. + */ + isLevelEnabled(level: LevelWithSilent | string): boolean; } type LevelChangeEventListener = (lvl: LevelWithSilent | string, val: number, prevLvl: LevelWithSilent | string, prevVal: number) => void; diff --git a/types/pino/pino-tests.ts b/types/pino/pino-tests.ts index 3a6283c3e4..1a64f11d99 100644 --- a/types/pino/pino-tests.ts +++ b/types/pino/pino-tests.ts @@ -91,6 +91,7 @@ logstderr.error('on stderr instead of stdout'); log.useLevelLabels = true; log.info('lol'); log.level === 'info'; +const isEnabled: boolean = log.isLevelEnabled('info'); const extremeDest = pino.extreme(); const logExtreme = pino(extremeDest); diff --git a/types/pinterest-sdk/tslint.json b/types/pinterest-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pinterest-sdk/tslint.json +++ b/types/pinterest-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/piwik-tracker/tslint.json b/types/piwik-tracker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/piwik-tracker/tslint.json +++ b/types/piwik-tracker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pixi.js/tslint.json b/types/pixi.js/tslint.json index 01be0cd9ee..b55a78498f 100644 --- a/types/pixi.js/tslint.json +++ b/types/pixi.js/tslint.json @@ -4,6 +4,7 @@ // TODOs "ban-types": false, "dt-header": false, + "npm-naming": false, "interface-name": false, "no-any-union": false, "no-declare-current-package": false, diff --git a/types/pkijs/tslint.json b/types/pkijs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pkijs/tslint.json +++ b/types/pkijs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/platform/tslint.json b/types/platform/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/platform/tslint.json +++ b/types/platform/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/playerframework/tslint.json b/types/playerframework/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/playerframework/tslint.json +++ b/types/playerframework/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pleasejs/tslint.json b/types/pleasejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pleasejs/tslint.json +++ b/types/pleasejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/plupload/tslint.json b/types/plupload/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/plupload/tslint.json +++ b/types/plupload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pluralize/tslint.json b/types/pluralize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pluralize/tslint.json +++ b/types/pluralize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pngjs2/tslint.json b/types/pngjs2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pngjs2/tslint.json +++ b/types/pngjs2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/podcast/tslint.json b/types/podcast/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/podcast/tslint.json +++ b/types/podcast/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/podium/tslint.json b/types/podium/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/podium/tslint.json +++ b/types/podium/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/polygon/index.d.ts b/types/polygon/index.d.ts new file mode 100644 index 0000000000..c5e7adb827 --- /dev/null +++ b/types/polygon/index.d.ts @@ -0,0 +1,190 @@ +// Type definitions for polygon 1.0 +// Project: https://github.com/tmpvar/polygon.js#readme +// Definitions by: Konrad Klockgether +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* tslint:disable:array-type */ // cause contradictory error messages + +import Vec2 = require('vec2'); + +/** + * Create a new polygon: + * + * ```javascript + * var p = new Polygon([ + * Vec2(0, 0), + * Vec2(10, 0), + * Vec2(0, 10) + * ]); + * + * ``` + * + * You can pass an array of `Vec2`s, arrays `[x, y]`, or objects `{ x: 10, y: 20 }` + * + * **Stuff to Note**: most of the Vec2's methods take a `returnNew` as the last parameter. + * If passed a truthy value, a new vector will be returned to you. + * Otherwise the operation will be applied to `this` and `this` will be returned. + */ +declare class Polygon { + readonly points: Vec2[]; + + /** + * Returns the number of points in this polygon + */ + readonly length: number; + + constructor(points: Vec2[] | number[][] | { x: number, y: number }[]); + + /** + * Something like Array.forEach on points + */ + each(fn: (prev: Vec2, current: Vec2, next: Vec2, idx: number) => any): Polygon; + + /** + * Returns the point at index `idx`. note: this will wrap in both directions + */ + point(idx: number): Vec2; + + /** + * Ensure all of the points are unique + */ + dedupe(returnNew?: boolean): Polygon; + + /** + * Insert `vec2` at the specified index + */ + insert(vec2: Vec2, index: number): void; + + /** + * Remove the specified `vec2` or numeric index from this polygon + */ + remove(vecOrIndex: Vec2 | number): Polygon; + + /** + * Removes contiguous points that are the same + */ + clean(returnNew?: boolean): Polygon; + + /** + * Returns the direction in which a polygon is wound (true === clockwise) + */ + winding(): boolean; + + /** + * Rewinds the polygon in the specified direction (true === clockwise) + */ + rewind(cw: boolean): Polygon; + + /** + * Computes the area of the polygon + */ + area(): number; + + /** + * Finds the closest point in this polygon to `vec2` + */ + closestPointTo(vec2: Vec2): Vec2; + + /** + * Returns a `Vec2` at the center of the AABB + */ + center(): Vec2; + + /** + * Scales this polygon around `origin` (default is `this.center()`) and will return a new polygon if requested with `returnNew` + */ + scale(amount: number, origin: Vec2, returnNew?: boolean): Polygon; + + /** + * Returns true if `vec2` is inside the polygon + */ + containsPoint(vec2: Vec2): boolean; + + /** + * Returns true if `poly` is completely contained in this polygon + */ + containsPolygon(poly: Polygon): boolean; + + /** + * Returns an object `{x:_, y:_, w:_, h:_}` representing the axis-aligned bounding box of this polygyon + */ + aabb(): { x: number, y: number, w: number, h: number }; + + /** + * Performs an offset/buffering operation on this polygon and returns a new one + */ + offset(amount: number): Polygon; + + /** + * Return an array `[startpoint, endpoint]` representing the line at the specified `index` + */ + line(index: number): [Vec2, Vec2]; + + /** + * Iterate over the lines in this polygon + */ + lines(fn: (start: Vec2, end: Vec2, index: number) => any): Polygon; + + /** + * Find self-intersections and return them as a new polygon + */ + selfIntersections(): Polygon; + + /** + * Remove self intersections from this polygon. returns an array of polygons + */ + pruneSelfIntersections(): Polygon[]; + + /** + * Return a new instance of this polygon + */ + clone(): Polygon; + + /** + * Rotate by origin `vec2` (default `this.center()`) by radians `rads` and return a clone if `returnNew` is specified + */ + rotate(rads: number, vec2: Vec2, returnNew?: boolean): Polygon; + + /** + * Translate by `vec2` and return a clone if `returnNew` is specified + */ + translate(vec2: Vec2, returnNew?: boolean): Polygon; + + /** + * Return true if this polygon has the same components and the incoming `poly` + */ + equal(poly: Polygon): boolean; + + /** + * Works with an array of vec2's, + * an object containing a `.position` and `.radius`, + * an object populated with x1,y1,x2,y2, + * an object populated with x,y,w,h, + * and an object populated with x,y,width,height. + * See the tests for more info + */ + contains( + thing: Vec2[] + | { position: Vec2, radius: number } + | { x1: number, y1: number, x2: number, y2: number } + | { x: number, y: number, w: number, h: number } + | { x: number, y: number, width: number, height: number } + ): boolean; + + /** + * Returns a new polygon representing the boolean union of `this` and the incoming `polygon` + */ + union(polygon: Polygon): Polygon; + + /** + * Returns a new polygon representing the boolean cut of `polygon` from `this` + */ + cut(polygon: Polygon): Polygon; + + /** + * Convert this polygon into an array of arrays (`[[x, y]]`) + */ + toArray(): number[][]; +} + +export = Polygon; diff --git a/types/polygon/polygon-tests.ts b/types/polygon/polygon-tests.ts new file mode 100644 index 0000000000..13ea7c08c1 --- /dev/null +++ b/types/polygon/polygon-tests.ts @@ -0,0 +1,16 @@ +// no tests yet +import Polygon = require('polygon'); + +const polygon1 = new Polygon([ + [0, 0], + [5, 0], + [5, 5], + [0, 5], + [0, 0], +]); +const shouldBeTrue = polygon1.contains({ + x: 3, + y: 3, + w: 4, + h: 3, +}); diff --git a/types/polygon/tsconfig.json b/types/polygon/tsconfig.json new file mode 100644 index 0000000000..516af96426 --- /dev/null +++ b/types/polygon/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", + "polygon-tests.ts" + ] +} diff --git a/types/polygon/tslint.json b/types/polygon/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/polygon/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/polygons-intersect/index.d.ts b/types/polygons-intersect/index.d.ts new file mode 100644 index 0000000000..87fd174e69 --- /dev/null +++ b/types/polygons-intersect/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for polygons-intersect 1.0 +// Project: https://github.com/DudaGod/polygons-intersect#readme +// Definitions by: Konrad Klockgether +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds all points where the polygons intersect each other. + */ +declare function intersection( + poly1: Array<{ x: number, y: number }>, + poly2: Array<{ x: number, y: number }> +): Array<{ x: number, y: number }>; + +export = intersection; diff --git a/types/polygons-intersect/polygons-intersect-tests.ts b/types/polygons-intersect/polygons-intersect-tests.ts new file mode 100644 index 0000000000..104c93c788 --- /dev/null +++ b/types/polygons-intersect/polygons-intersect-tests.ts @@ -0,0 +1,5 @@ +import polygonsIntersect = require('polygons-intersect'); + +const poly1 = [{x: 10, y: 10}, {x: 10, y: 30}, {x: 30, y: 30}, {x: 30, y: 10}]; +const poly2 = [{x: 20, y: 20}, {x: 20, y: 40}, {x: 40, y: 40}, {x: 40, y: 20}]; +polygonsIntersect(poly1, poly2); diff --git a/types/polygons-intersect/tsconfig.json b/types/polygons-intersect/tsconfig.json new file mode 100644 index 0000000000..20c8856f07 --- /dev/null +++ b/types/polygons-intersect/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", + "polygons-intersect-tests.ts" + ] +} diff --git a/types/polygons-intersect/tslint.json b/types/polygons-intersect/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/polygons-intersect/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/polyline/tslint.json b/types/polyline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/polyline/tslint.json +++ b/types/polyline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/polymer-ts/tslint.json b/types/polymer-ts/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/polymer-ts/tslint.json +++ b/types/polymer-ts/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/polymer/tslint.json b/types/polymer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/polymer/tslint.json +++ b/types/polymer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/popcorn/tslint.json b/types/popcorn/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/popcorn/tslint.json +++ b/types/popcorn/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/postal/tslint.json b/types/postal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/postal/tslint.json +++ b/types/postal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/power-assert-formatter/tslint.json b/types/power-assert-formatter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/power-assert-formatter/tslint.json +++ b/types/power-assert-formatter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/power-assert/tslint.json b/types/power-assert/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/power-assert/tslint.json +++ b/types/power-assert/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/powerapps-component-framework/componentframework.d.ts b/types/powerapps-component-framework/componentframework.d.ts new file mode 100644 index 0000000000..742e7d506b --- /dev/null +++ b/types/powerapps-component-framework/componentframework.d.ts @@ -0,0 +1,1986 @@ +declare namespace ComponentFramework { + /** + * Interface for the PowerApps Controls (Standard) + */ + interface StandardControl { + /** + * Used to initialize the control instance. Controls can kick off remote server calls and other initialization actions here. + * Data-set values are not initialized here, use updateView. + * @param context The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped + * to property names defined in the manifest, as well as utility functions. + * @param notifyOutputChanged A callback method to alert the framework that the control has new outputs ready to be retrieved asynchronously. + * @param state A piece of data that persists in one session for a single user. Can be set at any point in a controls life cycle by calling + * 'setControlState' in the Mode interface. + * @param container If a control is marked control-type='standard', it will receive an empty div element within which it can render its content. + */ + init(context: Context, notifyOutputChanged?: () => void, state?: Dictionary, container?: HTMLDivElement): void; + + /** + * Called when any value in the property bag has changed. This includes field values, data-sets, global values such as container height and width, + * offline status, control metadata values such as label, visible, etc. + * @param context The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to names + * defined in the manifest, as well as utility functions + */ + updateView(context: Context): void; + + /** + * Called when the control is to be removed from the DOM tree. Controls should use this call for cleanup. + * i.e. cancelling any pending remote calls, removing listeners, etc. + */ + destroy(): void; + + /** + * It is called by the framework prior to a control receiving new data. + * @returns an object based on nomenclature defined in manifest, expecting object[s] for property marked as "bound" or "output" + */ + getOutputs?(): TOutputs; + } + + /** + * The entire property bag interface available to control via Context Object + */ + interface Context { + client: Client; + device: Device; + factory: Factory; + formatting: Formatting; + mode: Mode; + navigation: Navigation; + resources: Resources; + userSettings: UserSettings; + utils: Utility; + webAPI: WebApi; + parameters: TInputs; + updatedProperties: string[]; + } + + /** + * The interface for the context.client + */ + interface Client { + /** + * Whether this control should disable its scrolling capabilities. + */ + disableScroll: boolean; + + /** + * Device form factor. + * Unknown = 0 + * Desktop = 1 + * Tablet = 2 + * Phone = 3 + */ + getFormFactor(): number; + + /** + * Returns a value to indicate which client the script is executing in. + * Web: Web application, or Unified Interface + * Outlook: Outlook + * Mobile: Mobile app + */ + getClient(): string; + + /** + * Returns information whether the server is online or offline. + */ + isOffline(): boolean; + } + + /** + * The interface for the context.device + */ + interface Device { + /** + * Invokes the device microphone to record audio. + */ + captureAudio(): Promise; + + /** + * Invokes the device camera to capture an image. + */ + captureImage(options?: DeviceApi.CaptureImageOptions): Promise; + + /** + * Invokes the device camera to record video. + */ + captureVideo(): Promise; + + /** + * Invokes the device camera to scan the barcode information, such as a product number. + */ + getBarcodeValue(): Promise; + + /** + * Returns the current location using the device geolocation capability. + */ + getCurrentPosition(): Promise; + + /** + * Opens a dialog box to select files from your computer (web client) or mobile device (mobile clients). + */ + pickFile(options?: DeviceApi.PickFileOptions): Promise; + } + + /** + * The interface for the context.factory + */ + interface Factory { + /** + * Gets the popup service which help create Popup and manage Popup easily + */ + getPopupService(): FactoryApi.Popup.PopupService; + + /** + * Requests re-rendering of the control with updated data. + */ + requestRender(): void; + } + + /** + * The interface for the context.formatting + */ + interface Formatting { + /** + * Returns a formatted string that represents the currency value after being formatted. + * @param value A value object to be formatted. + * @param precision The number of digits after decimal point. + * @param symbol The currency symbol/code to be added with currency value. + */ + formatCurrency(value: number, precision?: number, symbol?: string): string; + + /** + * Returns a formatted string that represents the decimal value after being formatted. + * @param value A value object to be formatted. + * @param precision The number of digits after decimal point. + */ + formatDecimal(value: number, precision?: number): string; + + /** + * Returns a formatted string that represents a date in a YYYY-MM-DD standard UTC format. + * Result pattern is based on Standard UTC format. + * @param value The date to be formatted. + * @param includeTime If time component should be included in the return value. + */ + formatDateAsFilterStringInUTC(value: Date, includeTime?: boolean): string; + + /** + * Returns a formatted string that represents a date in the long form. + * Result pattern is based on culture. In USA it's "Day of week, Month dd, yyyy"in USA + * @param value Date to format. + */ + formatDateLong(value: Date): string; + + /** + * Returns a formatted string that represents a date in the long form using abbreviations. + * Result pattern is based on culture. In USA it's "Abbreviated Day of week, Month dd, yyyy" in USA + * @param value Date to format. + */ + formatDateLongAbbreviated(value: Date): string; + + /** + * Returns a string represents the datetime value after being formatted. + * Result pattern is based on culture. In USA it's 'MM/DD/YYYY' in USA + * @param value Date to format. + * @param includeTime Whether to show time in formatted value. + */ + formatDateShort(value: Date, includeTime?: boolean): string; + + /** + * Returns a formatted string that represents a date in the year month format. + * @param value Date to format. + */ + formatDateYearMonth(value: Date): string; + + /** + * Returns a formatted string represents a given integer value. + * @param value A number primitive to be formatted. + */ + formatInteger(value: number): string; + + /** + * Returns a formatted string that represents a given language + * @param input A language code to be formatted. Reference: https://go.microsoft.com/fwlink/?linkid=122128 + * @returns A formatted string represents a given language value. + */ + formatLanguage(value: number): string; + + /** + * Returns a formatted string that represents the datetime value after being formatted. + * @param value The date to be formatted. + * @param behavior The behavior of the datetime object to be formatted. + * None = 0, + * UserLocal = 1, + * TimeZoneIndependent = 3 + */ + formatTime(value: Date, behavior: FormattingApi.DateTimeFieldBehavior): string; + + /** + * Gets the ISO week number of the year for a given date. Range 1-53 + * @param value The DateTime to convert. + */ + getWeekOfYear(value: Date): number; + } + + /** + * The interface for the context.mode + */ + interface Mode { + /** + * Height in pixels allocated to the control. If it's -1, then there is no limit on height + */ + allocatedHeight: number; + + /** + * Width in pixels allocated to the control. + */ + allocatedWidth: number; + + /** + * Is the control in 'Read-only' mode. + */ + isControlDisabled: boolean; + + /** + * Is the control in 'Visible' mode. + */ + isVisible: boolean; + + /** + * The defined control label + */ + label: string; + + /** + * set control state so that it will be stored in one session + */ + setControlState(state: Dictionary): boolean; + + /** + * Make the control full screen. + * @param value True if control needs to autosize to full screen. False if control needs to autosize to allocated width. + */ + setFullScreen(value: boolean): void; + + /** + * API to determine container sizing if control needs to react. Control will get allocatedWidth/allocatedHeight if input is 'true' + * @param value True if controls needs to track container size, control will get allocatedWidth/allocatedHeight + */ + trackContainerResize(value: boolean): void; + } + + /** + * The navigation interface of context.navigation + */ + interface Navigation { + /** + * Opens Alert Dialog + * @param alertStrings Strings to be used in alert dialog + * @param options Dialog options + * @returns promise defining success or failure of operation + */ + openAlertDialog(alertStrings: NavigationApi.AlertDialogStrings, options?: NavigationApi.AlertDialogOptions): Promise; + + /** + * Opens Confirm Dialog + * @param confirmStrings String which will be used in the dialog + * @param options Options for the dialog + * @returns promise defining success or failure of operation. the success case returns a boolean specifying whether yes or no button was pressed + */ + openConfirmDialog(confirmStrings: NavigationApi.ConfirmDialogStrings, options?: NavigationApi.ConfirmDialogOptions): Promise; + + /** + * Opens an Error Dialog. + * @param options Error Dialog options. + * @returns promise defining success or failure of operation. + */ + openErrorDialog(options: NavigationApi.ErrorDialogOptions): Promise; + + /** + * Open a file + * @param file An object describing the file to open + * @param options Options for openFile. OpenMode field in the options allows to save file instead opening. + * @returns promise defining success or failure of operation. + */ + openFile(file: FileObject, options?: NavigationApi.OpenFileOptions): Promise; + + /** + * Opens an entity form or quick create form. + * @param options entity form options. + * @param parameters entity form parameters. + * @returns promise defining success or failure of operation + */ + openForm(options: NavigationApi.EntityFormOptions, parameters?: {[key: string]: string}): Promise; + + /** + * Open url, including file urls. + * @param url url to be opened. + * @param options window options for the url. + */ + openUrl(url: string, options?: NavigationApi.OpenUrlOptions): void; + + /** + * Opens an HTML web resource. + * @param name The name of the HTML web resource to open. + * @param options Window options for the web resource. + * @param data Data to be passed into the data parameter. + */ + openWebResource(name: string, options?: NavigationApi.OpenWebResourceOptions, data?: string): void; + } + + /** + * The resource interface of context.resources + */ + interface Resources { + /** + * Gets a resource referenced by the control manifest. + * @param id The resource string identifier. + * @param success The success callback. Resource data is returned in base 64 encoded format. + * @param failure The failure callback. + */ + getResource(id: string, success: (data: string) => void, failure: () => void): void; + + /** + * Get the localized string for the given identifier. + * @param id name of resource in the control manifest. + */ + getString(id: string): string; + } + + /** + * The interface for context.userSettings + */ + interface UserSettings { + /** + * Date formatting information as retrieved from the server. + */ + dateFormattingInfo: UserSettingApi.DateFormattingInfo; + + /** + * Returns true if the language is right to left + */ + isRTL: boolean; + + /** + * Current user's language id + * + */ + languageId: number; + + /** + * Number formatting information as retrieved from the server. + */ + numberFormattingInfo: UserSettingApi.NumberFormattingInfo; + + /** + * Current user roles + */ + securityRoles: string[]; + + /** + * The id of the current user + */ + userId: string; + + /** + * The username of the current user + */ + userName: string; + + /** + * Gets the offset in minutes from UTC for the given date + * @param date date to get the offset from utc for + */ + getTimeZoneOffsetMinutes(date?: Date): number; + } + + /** + * The interface for context.utils + */ + interface Utility { + /** + * Gets the entity metadata for the specified entity. + * @param entityType The logical name of the entity. + * @param attributes The attributes to get metadata for. + */ + getEntityMetadata(entityName: string, attributes?: string[]): Promise; + + /** + * Function to return if the user has Privilege for one specific entity + * @entityTypeName entity type name + * @privilegeType privilege type i.e. Create, Read, Write etc. + * @privilegeDepth privilege depth i.e. basic, Global etc. + */ + hasEntityPrivilege(entityTypeName: string, privilegeType: PropertyHelper.PrivilegeType, privilegeDepth: PropertyHelper.PrivilegeDepth): boolean; + + /** + * Opens a lookup dialog allowing the user to select one or more entities. + * @param lookupOptions Options for opening the lookup dialog. + */ + lookupObjects(lookupOptions: UtilityApi.LookupOptions): Promise; + } + + /** + * The interface for context.webApi + */ + interface WebApi { + /** + * Creates an entity record. + * @param entityType logical name of the entity type record to create + * @param data dictionary with attribute schema name and value + * @returns The deferred object for the result of the operation. The created record object will be resolved if successful. + */ + createRecord(entityType: string, data: WebApi.Entity): Promise; + + /** + * Deletes an entity record. + * @param id GUID of the entity record you want to delete. + * @param entityType logical name of the entity type record to delete + * @returns The deferred object for the result of the operation. The deleted record object will be resolved if successful. + */ + deleteRecord(entityType: string, id: string): Promise; + + /** + * Updates an entity record. + * @param id GUID of the entity record you want to update. + * @param data dictionary containing to-change attributes with schema name and value + * @param entityType logical name of the entity type record to update + * @returns The deferred object for the result of the operation. The updated record object will be resolved if successful. + */ + updateRecord(entityType: string, id: string, data: WebApi.Entity): Promise; + + /** + * Retrieves a collection of entity records. + * @param entityType logical name of the entity type record to retrieve + * @param options OData system query options or FetchXML query to retrieve your data. + * For support options, please refer to https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi/retrievemultiplerecords + * @param maxPageSize Max number of records to be retrieved per page + * @returns The deferred object for the result of the operation. An object with interface RetrieveMultipleResponse will be resolved if successful. + */ + retrieveMultipleRecords(entityType: string, options?: string, maxPageSize?: number): Promise; + + /** + * Retrieves an entity record. + * @param id GUID of the entity record you want to retrieve. + * @param entityType logical name of the entity type record to retrieve + * @param options OData system query options, $select and $expand, to retrieve your data. + * For support options, please refer to https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi/retrieverecord + * @returns The deferred object for the result of the operation. A JSON object with the retrieved properties and values will be resolved if successful. + */ + retrieveRecord(entityType: string, id: string, options?: string): Promise; + } + + //////////////// Define namespace of each context first-level child interface's helper //////////////// + + interface Dictionary { + [key: string]: any; + } + + /** + * Helper of Device API interface + */ + namespace DeviceApi { + /** + * Interface of input argument 'options' in context.device.captureImage + */ + interface CaptureImageOptions { + /** + * Indicates whether to edit the image before saving. + */ + allowEdit: boolean; + + /** + * Height of the image to capture. + */ + height: number; + + /** + * Indicates whether to capture image using the front camera of the device. + */ + preferFrontCamera: boolean; + + /** + * Quality of the image file in percentage. + */ + quality: number; + + /** + * Width of the image to capture. + */ + width: number; + } + + /** + * Interface of return geological information in context.device.getCurrentPosition + */ + interface Position { + /** + * Contains a set of geographic coordinates along with associated accuracy as well as a set of other optional attributes such as altitude and speed. + */ + coords: Dictionary; + + /** + * Represents the time when the object was acquired and is represented as DOMTimeStamp. + */ + timestamp: Date; + } + + /** + * Interface of input argument 'pickupFileOption' in context.device.pickupFile + */ + interface PickFileOptions { + /** + * Image file types to select. Valid values are "audio", "video", or "image". + */ + accept: string; + + /** + * Indicates whether to allow selecting multiple files. + */ + allowMultipleFiles: boolean; + + /** + * Maximum size of the files(s) to be selected. + */ + maximumAllowedFileSize: number; + } + } + + /** + * Helper of Factory Pop API interface + */ + namespace FactoryApi.Popup { + interface PopupService { + /** + * Create a new popup element + * @param props The popup properties object, see Popup interface for more + */ + createPopup(props: Popup): void; + + /** + * Open an existing popup in the service with the given name. Does nothing if popup does not exist yet. + * @param name the name of the popup you're trying to open + */ + openPopup(name: string): void; + + /** + * Close an existing popup in the service with the given name. Does nothing if popup does not exist yet. + * @param name the name of the popup you're trying to close + */ + closePopup(name: string): void; + + /** + * Update an existing popup in the service with the given name, patching new content to the same popup element. Does nothing if popup does not exist yet. + * @param name the name of the popup you're trying to update + * @param newProps the updated properties to give to the popup. + */ + updatePopup(name: string, newProps: Popup): void; + + /** + * Remove the referenced popup from the popupService, unregister the service + * @param name The name of the popup to remove + */ + deletePopup(name: string): void; + + /** + * Sets the ID (on the DOM and in the system) for the root popup element. + * @param id The string to set as the id + */ + setPopupsId(id: string): void; + + /** + * Gets the currently set popup Id + */ + getPopupsId(): string; + } + + enum PopupType { + /** + * Root popup in the popup stack + */ + Root = 1, + + /** + * Not root popup in the popup stack + */ + Nested, + } + + interface Popup { + /** + * The id to be set to the anchor control if any. + */ + id?: string; + + /** + * The name of the Popup. Used as the reference to open Popups. + */ + name: string; + + /** + * Indicates whether popup close on an outside mouse click. + * When it's false, the popup will not be closed on an outside mouse click. + */ + closeOnOutsideClick?: boolean; + + /** + * The name of Popup which should be opened. + * Should be defined ONLY in a Root Popup. + * To open nested Popups, should be provided string like "rootName.nestedName.[allOtherNestedNames]". + * To close Popups, should be provided empty string. + * This prop will be automatically propagated to children. + */ + popupToOpen?: string; + + /** + * The type of Popup, which is described in PopupType enum. Should be only one "root" Popup for each set of Popups. + */ + type: PopupType; + + /** + * Static DOM element to be inserted + */ + content: HTMLElement; + } + } + + /** + * Helper of Formatting API interface + */ + namespace FormattingApi { + /** + * DateTime Field Behavior options + */ + enum DateTimeFieldBehavior { + /** + * Unknown DateTime Behavior + */ + None = 0, + + /** + * Respect user local time. Dates stored as UTC + */ + UserLocal = 1, + + /** + * Dates and time stored without conversion to UTC + */ + TimeZoneIndependent = 3, + } + } + + /** + * Helper of Navigation API interface + */ + namespace NavigationApi { + /** + * Interface for alert dialog options. + */ + interface AlertDialogOptions { + /** + * Height of the alert dialog in pixels. + */ + height?: number; + + /** + * Width of the alert dialog pixels. + */ + width?: number; + } + + /** + * Represents the String parameters for Alert Dialog. + */ + interface AlertDialogStrings { + /** + * The message to be displyed in the alert dialog. + */ + text: string; + + /** + * The confirm button label. If you do not specify the button label, OK (in user's preferred language) is used as the button label. + */ + confirmButtonLabel?: string; + } + + /** + * Interface for confirm dialog options. + */ + interface ConfirmDialogOptions { + /** + * Height of the confirmation dialog in pixels. + */ + height?: number; + + /** + * Width of the confirmation dialog pixels. + */ + width?: number; + } + + /** + * Represents the String parameters for Confirm Dialog. + */ + interface ConfirmDialogStrings { + /** + * Confirm Dialog Title. + */ + title?: string; + + /** + * Confirm Dialog Subtitle + */ + subtitle?: string; + + /** + * Confirm Dialog Text\Message. + */ + text: string; + + /** + * The confirm button label. If you do not specify the button label, OK (in user's preferred language) is used as the button label. + */ + confirmButtonLabel?: string; + + /** + * Cancel Button label. + */ + cancelButtonLabel?: string; + } + + /** + * An object with the confirmed (Boolean) attribute is passed that indicates whether the confirm button was clicked to close the dialog. + */ + interface ConfirmDialogResponse { + /** + * confirmed (Boolean) attribute is passed that indicates whether the confirm button was clicked to close the dialog. + */ + confirmed: boolean; + } + + /** + * Interface for entity form options. + */ + interface EntityFormOptions { + /** + * Designates a record that will provide default values based on mapped attribute values. The lookup object has the following String properties: entityType, id, and name + */ + createFromEntity?: EntityReference; + + /** + * ID of the entity record to display the form for. + */ + entityId?: string; + + /** + * Logical name of the entity to display the form for. + */ + entityName: string; + + /** + * ID of the form instance to be displayed. + */ + formId?: string; + + /** + * Height of the form window to be displayed in pixels. + */ + height?: number; + + /** + * Indicates whether to display form in a new window. + */ + openInNewWindow?: boolean; + + /** + * Indicates whether to open a quick create form. If you do not specify this, by default false is passed. + */ + useQuickCreateForm?: boolean; + + /** + * Width of the form window to be displayed in pixels. + */ + width?: number; + + /** + * Specify one of the following values for the window position of the form on the screen: + * 1:center + * 2:side + */ + windowPosition?: number; + } + + /** + * Interface for error dialog options. + * You must set either the errorCode or message attribute. + */ + interface ErrorDialogOptions { + /** + * Details about the error. When you specify this, the Download Log File button is available in the error message, and clicking it will let users download a text file with + * the content specified in this attribute. + */ + details?: string; + + /** + * If you just set errorCode, the message for the error code is automatically retrieved from the server and displayed in the error dialog. If you specify an errorCode value, + * an error dialog with a default error message is displyed. + */ + errorCode?: number; + + /** + * The message to be displayed in the error dialog. + */ + message?: string; + } + + /** + * The options for openFile mode. + */ + enum OpenFileMode { + /** + * default. mode open + */ + open = 1, + + /** + * mode save + */ + save = 2, + } + + /** + * Interface for open file options. + */ + interface OpenFileOptions { + /** + * Specify whether to open or save the file + * Values: + * 1 open + * 2 save + */ + openMode: OpenFileMode; + } + + /** + * The object returned when a save is successful for open form. + */ + interface OpenFormSuccessResponse { + savedEntityReference: EntityReference[]; + } + + /** + * Interface for OpenUrl options. + */ + interface OpenUrlOptions { + /** + * Height of the window to display the resultant page in pixels. + */ + height?: number; + + /** + * Width of the window to display the resultant page in pixels. + */ + width?: number; + } + + /** + * Interface for OpenWebResource options. + */ + interface OpenWebResourceOptions { + /** + * Height of the window to display the resultant page in pixels. + */ + height?: number; + + /** + * Indicates whether to open the web resource in a new window. + */ + openInNewWindow: boolean; + + /** + * Width of the window to display the resultant page in pixels. + */ + width?: number; + } + } + + /** + * Helper of UserSettings API interface + */ + namespace UserSettingApi { + /** + * Day Of Week Enum + */ + enum DayOfWeek { + Sunday = 0, + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6 + } + + /** + * The interface for Org Date Format Info exposed to a custom control + * Result pattern is based on culture,examples are for 'USA' area + */ + interface DateFormattingInfo { + /** + * @example "AM" + */ + amDesignator: string; + + /** + * @example { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } + */ + abbreviatedDayNames: string[]; + + /** + * @example { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } + */ + abbreviatedMonthGenitiveNames: string[]; + + /** + * @example { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } + */ + abbreviatedMonthNames: string[]; + + /** + * @example 0 + */ + calendarWeekRule: number; + + /** + * @example See interface Calendar + */ + calendar: Calendar; + + /** + * @example "/" + */ + dateSeparator: string; + + /** + * @example { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } + */ + dayNames: string[]; + + /** + * @example See interface DayOfWeek + */ + firstDayOfWeek: DayOfWeek; + + /** + * @example "dddd, MMMM d, yyyy h:mm:ss tt" + */ + fullDateTimePattern: string; + + /** + * @example "dddd, MMMM d, yyyy" + */ + longDatePattern: string; + + /** + * @example "hh:mm:ss tt" + */ + longTimePattern: string; + + /** + * @example "MMMM dd" + */ + monthDayPattern: string; + + /** + * @example { "January", "February", "March", ... "December", "" } + */ + monthGenitiveNames: string[]; + + /** + * @example { "January", "February", "March", ... "December", "" } + */ + monthNames: string[]; + + /** + * @example "PM" + */ + pmDesignator: string; + + /** + * @example "M/d/yyyy" + */ + shortDatePattern: string; + + /** + * @example "h:mm tt" + */ + shortTimePattern: string; + + /** + * @example { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" } + */ + shortestDayNames: string[]; + + /** + * @example "yyyy'-'MM'-'dd'T'HH':'mm':'ss" + */ + sortableDateTimePattern: string; + + /** + * @example ":" + */ + timeSeparator: string; + + /** + * @example "yyyy'-'MM'-'dd HH':'mm':'ss'Z'" + */ + universalSortableDateTimePattern: string; + + /** + * @example "MMMM yyyy" + */ + yearMonthPattern: string; + } + + /** + * The interface for the Org System Settings Number Format Info exposed to a custom control + * Comments indicate example values + */ + interface NumberFormattingInfo { + /** + * @example 2 + */ + currencyDecimalDigits: number; + + /** + * @example "." + */ + currencyDecimalSeparator: string; + + /** + * @example "," + */ + currencyGroupSeparator: string; + + /** + * @example [ 3 ] + */ + currencyGroupSizes: number[]; + + /** + * @example 0 + */ + currencyNegativePattern: number; + + /** + * @example 0 + */ + currencyPositivePattern: number; + + /** + * @example "$" + */ + currencySymbol: string; + + /** + * @example "NaN" + */ + nanSymbol: string; + + /** + * @example { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} + */ + nativeDigits: string[]; + + /** + * @example "-Infinity" + */ + negativeInfinitySymbol: string; + + /** + * @example "-" + */ + negativeSign: string; + + /** + * @example 2 + */ + numberDecimalDigits: number; + + /** + * @example "." + */ + numberDecimalSeparator: string; + + /** + * @example "," + */ + numberGroupSeparator: string; + + /** + * @example [3] + */ + numberGroupSizes: number[]; + + /** + * @example 1 + */ + numberNegativePattern: number; + + /** + * @example "" + */ + perMilleSymbol: string; + + /** + * @example 2 + */ + percentDecimalDigits: number; + + /** + * @example "." + */ + percentDecimalSeparator: string; + + /** + * @example "," + */ + percentGroupSeparator: string; + + /** + * @example [3] + */ + percentGroupSizes: number[]; + + /** + * @example 0 + */ + percentNegativePattern: number; + + /** + * @example 0 + */ + percentPositivePattern: number; + + /** + * @example "%" + */ + percentSymbol: string; + + /** + * @example "Infinity" + */ + positiveInfinitySymbol: string; + + /** + * @example "+" + */ + positiveSign: string; + } + + /** + * The interface for the Calendar exposed in DateFormattingInfo + */ + interface Calendar { + /** + * @example "/Date(-62135568000000)/" + */ + minSupportedDateTime: Date; + + /** + * @example "/Date(253402300799999)/" + */ + maxSupportedDateTime: Date; + + /** + * @example 1 + */ + algorithmType: number; + + /** + * @example 1 + */ + calendarType: number; + + /** + * @example 2029 + */ + twoDigitYearMax: number; + } + } + + /** + * Helper of Utils API interface + */ + namespace UtilityApi { + /** + * Options used when opening a lookup dialog. + */ + interface LookupOptions { + /** + * Whether the lookup allows more than one item to be selected. + */ + allowMultiSelect: boolean; + + /** + * The default entity type. + */ + defaultEntityType: string; + + /** + * The default view to use. + */ + defaultViewId: string; + + /** + * The entity types to display. + */ + entityTypes: string[]; + + /** + * The views to be available in the view picker. Only System views are supported (not user views). + */ + viewIds: string[]; + } + } + + /** + * Objects related to interacting with the Web API. + */ + namespace WebApi { + /** + * Interface that describes an entity sent or received from the SDK through the Web API. + */ + interface Entity { + [key: string]: any; + } + + interface RetrieveMultipleResponse { + /** + * An array of JSON objects, where each object represents the retrieved entity record containing attributes and their values + */ + entities: Entity[]; + + /** + * If the number of records being retrieved is more than the value specified in the 'maxPageSize' parameter in the request, this attribute returns the URL to return next set of records. + */ + nextLink: string; + } + } + + /** + * An object that encapsulates an Entity Reference as a plain object suitable for storing in the state tree + */ + interface EntityReference { + /** + * The record id. Read-only. + */ + id: string; + + /** + * The entity logical name. Read-only. + */ + entityType?: string; + + /** + * The name of the entity reference. Read-only. + */ + name: string; + } + + /** + * Interface of one file object + */ + interface FileObject { + /** + * Contents of the file. + */ + fileContent: string; + + /** + * Name of the file. + */ + fileName: string; + + /** + * Size of the file in KB. + */ + fileSize: number; + + /** + * File MIME type. + */ + mimeType: string; + } + +///////////////////// Parameter //////////////////////// + + namespace PropertyTypes { + /** + * Interface for context.parameters.[property_key] + */ + interface Property { + error: boolean; + errorMessage: string; + formatted?: string; + security?: PropertyHelper.SecurityValues; + raw: any; + type: string; + attribute?: PropertyHelper.FieldPropertyMetadata.Metadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is Whole.None|FP|Decimal + */ + interface NumberProperty extends Property { + raw: number; + attributes?: PropertyHelper.FieldPropertyMetadata.NumberMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is Decimal + */ + interface DecimalNumberProperty extends NumberProperty { + attributes?: PropertyHelper.FieldPropertyMetadata.DecimalNumberMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is FP + */ + interface FloatingNumberProperty extends NumberProperty { + attributes?: PropertyHelper.FieldPropertyMetadata.FloatingNumberMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is Whole.None + */ + interface WholeNumberProperty extends NumberProperty { + attributes?: PropertyHelper.FieldPropertyMetadata.WholeNumberMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type starts from DateTime + */ + interface DateTimeProperty extends Property { + raw: Date; + attributes?: PropertyHelper.FieldPropertyMetadata.DateTimeMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type starts from SingleLine + */ + interface StringProperty extends Property { + raw: string; + attributes?: PropertyHelper.FieldPropertyMetadata.StringMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is Enum + */ + interface EnumProperty { + type: string; + raw: EnumType; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is OptionSet + */ + interface OptionSetProperty extends Property { + raw: number; + attributes?: PropertyHelper.FieldPropertyMetadata.OptionSetMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is MultiSelectOptionSet + */ + interface MultiSelectOptionSetProperty extends Property { + raw: number[]; + attributes?: PropertyHelper.FieldPropertyMetadata.OptionSetMetadata; + } + + /** + * Property Interface for context.parameters.[property_key], when property manifest type is TwoOptions + */ + interface TwoOptionsProperty extends Property { + raw: boolean; + attributes?: PropertyHelper.FieldPropertyMetadata.TwoOptionMetadata; + } + + /** + * The structure returned by getCellImageInfo and propagated down to the control to display conditional images. + */ + interface ImageInfo { + /** + * The Url of the conditional image. + */ + Url: string; + + /** + * The tooltip associated with that image. + */ + Tooltip: string; + } + + /** + * The structure of a dataset property as it would be passed to a control + */ + interface DataSet { + /** + * Adds column to the columnset + * @param name column name to be added to the columnset + * @param entityAlias entity alias for which the column name needs to be added + */ + addColumn?: (name: string, entityAlias?: string) => void; + + /** + * Set of columns available in this dataset. + */ + columns: PropertyHelper.DataSetApi.Column[]; + + /** + * True if encountered error while data retrieval + */ + error: boolean; + + /** + * The error message associated with the last encountered error, if applicable + */ + errorMessage: string; + + /** + * The column filtering for the current query. + */ + filtering: PropertyHelper.DataSetApi.Filtering; + + /** + * Related entity info + */ + linking: PropertyHelper.DataSetApi.Linking; + + /** + * Indicate if the dataset property is in loading state or not + */ + loading: boolean; + + /** + * Pagination status and actions. + */ + paging: PropertyHelper.DataSetApi.Paging; + + /** + * Map of IDs to the full record object + */ + records: { + [id: string]: PropertyHelper.DataSetApi.EntityRecord; + }; + + /** + * IDs of the records in the dataset, order by the query response result + */ + sortedRecordIds: string[]; + + /** + * The sorting status for the current query. + */ + sorting: PropertyHelper.DataSetApi.SortStatus[]; + + /** + * Clear selected record ids list + */ + clearSelectedRecordIds(): void; + + /** + * Retrieves all selected record ids + */ + getSelectedRecordIds(): string[]; + + /** + * Get DataSet target entity logical name + */ + getTargetEntityType(): string; + + /** + * Retrieves the view display name used by the dataset property + */ + getTitle(): string; + + /** + * Gets Id of view used by the dataset property + */ + getViewId(): string; + + /** + * Open dataSet item for a given EntityReference. It will check if there is a command with command button id "Mscrm.OpenRecordItem". + * If there is, it will execute the command, otherwise it will just navigate to the associated form of the entityReference + * @param entityReference entity reference + */ + openDatasetItem(entityReference: EntityReference): void; + + /** + * Refreshes the dataset based on filters, sorting, linking, new column. New data will be pushed to control in another 'updateView' cycle. + */ + refresh(): void; + + /** + * Set the ids of the selected records + * @ids List of recordId's + */ + setSelectedRecordIds(ids: string[]): void; + } + } + + namespace PropertyHelper { + /** + * Ime Mode + */ + enum ImeMode { + Auto = 0, + Inactive = 1, + Active = 2, + Disabled = 3, + } + + /** + * Entity privilege types. + */ + enum PrivilegeType { + None = 0, + Create = 1, + Read = 2, + Write = 3, + Delete = 4, + Assign = 5, + Share = 6, + Append = 7, + AppendTo = 8, + } + + /** + * Entity Priviledge Depth + */ + enum PrivilegeDepth { + None = -1, + Basic = 0, + Local = 1, + Deep = 2, + Global = 3, + } + + /** + * Attribute required level + */ + enum RequiredLevel { + Unknown = -1, + None = 0, + SystemRequired = 1, + ApplicationRequired = 2, + Recommended = 3, + } + + /** + * Entity metadata refer to online documentation + * https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-utility/getentitymetadata + */ + interface EntityMetadata { + [key: string]: any; + } + + /** + * Option Item Metadata + */ + interface OptionMetadata { + Label: string; + Value: number; + Color: string; + } + + /** + * Entity metadata security privileges. + */ + interface SecurityPrivilegeMetadata { + CanBeBasic: boolean; + CanBeDeep: boolean; + CanBeGlobal: boolean; + CanBeLocal: boolean; + CanBeEntityReference: boolean; + CanBeParentEntityReference: boolean; + Name: string; + PrivilegeId: string; + PrivilegeType: PrivilegeType; + } + + /** + * Entity metadata security values + */ + interface SecurityValues { + editable: boolean; + readable: boolean; + secured: boolean; + } + + namespace FieldPropertyMetadata { + interface Metadata { + DisplayName: string; + LogicalName: string; + RequiredLevel: RequiredLevel; + IsSecured: boolean; + SourceType: number; + Description: string; + } + + interface NumberMetadata extends Metadata { + MinValue: number; + MaxValue: number; + ImeMode: ImeMode; + } + + interface StringMetadata extends Metadata { + MaxLength: number; + ImeMode: ImeMode; + } + + interface FloatingNumberMetadata extends NumberMetadata { + Precision: number; + } + + interface DecimalNumberMetadata extends NumberMetadata { + Precision: number; + } + + interface WholeNumberMetadata extends NumberMetadata { + Format: string; + LanguageByCode?: Dictionary; + TimeZoneByCode?: Dictionary; + } + + interface DateTimeMetadata extends Metadata { + Behavior: FormattingApi.DateTimeFieldBehavior; + Format: string; + ImeMode: ImeMode; + } + + interface LookupMetadata extends Metadata { + Targets: string[]; + } + + interface StringMetadata extends Metadata { + Format: string; + } + + interface OptionSetMetadata extends Metadata { + Options: OptionMetadata[]; + DefaultValue: number; + } + + interface TwoOptionMetadata extends Metadata { + Options: [OptionMetadata, OptionMetadata]; + DefaultValue: boolean; + } + } + + namespace DataSetApi { + /** + * Supported Condition Operator for filtering expression condition + * This is subset of full condition operators list defined in https://docs.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.query.conditionoperator + */ + enum ConditionOperator { + None = -1, + Equal = 0, + NotEqual = 1, + GreaterThan = 2, + LessThan = 3, + GreaterEqual = 4, + LessEqual = 5, + Like = 6, + In = 8, + Null = 12, + Yesterday = 14, + Today = 15, + Tomorrow = 16, + Last7Days = 17, + Next7Days = 18, + LastWeek = 19, + ThisWeek = 20, + LastMonth = 22, + ThisMonth = 23, + On = 25, + OnOrBefore = 26, + OnOrAfter = 27, + LastYear = 28, + ThisYear = 29, + LastXDays = 33, + NextXDays = 34, + LastXMonths = 37, + NextXMonths = 38, + Contains = 49, + InFiscalPeriodAndYear = 70, + Above = 75, + Under = 76, + NotUnder = 77, + AboveOrEqual = 78, + UnderOrEqual = 79, + ContainValues = 87 + } + + /** + * An expression used to represent a filter condition. + */ + interface ConditionExpression { + /** + * The name of the data-set column to apply the filter on. + */ + attributeName: string; + + /** + * The value evaluated by the condition + */ + conditionOperator: ConditionOperator; + + /** + * The value evaluated by the condition. + */ + value: string | string[]; + + /** + * Entity alias name so filtering can be used on linked entities. + */ + entityAliasName?: string; + } + + /** + * Supported Filter Operator for filtering expression linkage + */ + enum FilterOperator { + And = 0, + Or = 1 + } + + /** + * An expression used to represent a filter. + */ + interface FilterExpression { + /** + * The set of conditions associated with this filter. + */ + conditions: ConditionExpression[]; + + /** + * The operator used to combine conditions in this filter. + */ + filterOperator: FilterOperator; + + /** + * Any child filters that should be evaluated after evaluating this filter. + */ + filters?: FilterExpression[]; + } + + /** + * Filter state for a dataset. + */ + interface Filtering { + /** + * Returns the top-most filter associated with the data-set + */ + getFilter(): FilterExpression; + + /** + * Sets the top-most filter associated with the data-set + * @expression filter expression to be set + */ + setFilter(expression: FilterExpression): void; + + /** + * Clears the filter associated with the data-set. + */ + clearFilter(): void; + } + + /** + * Metadata about a column in a dataset + */ + interface Column { + /** + * Name of the column, unique in this dataset + */ + name: string; + + /** + * Localized display name for the column + */ + displayName: string; + + /** + * The manifest type of this column's values. + */ + dataType: string; + + /** + * The alias of this column. + */ + alias: string; + + /** + * The column order for the layout + */ + order: number; + + /** + * Customized column width ratios + */ + visualSizeFactor: number; + + /** + * The column visibility state. + */ + isHidden?: boolean; + + /** + * Is specific column the primary attrribute of the view's entity + */ + isPrimary?: boolean; + + /** + * Prevents the UI from making the column sortable. + */ + disableSorting?: boolean; + } + + /** + * Base interface for dataset record result. Supports value retrival by column name. + */ + interface EntityRecord { + /** + * Get the current formatted value of this record column. + * @param columnName Column name of the record + */ + getFormattedValue(columnName: string): string; + + /** + * Get the record ID + */ + getRecordId(): string; + + /** + * Get the raw value of the record's column + * @param columnName Column name of the record + */ + getValue(columnName: string): string | Date | number | number[] | boolean | EntityReference | EntityReference[]; + + /** + * Get the object that encapsulates an Entity Reference as a plain object + */ + getNamedReference(): EntityReference; + } + + /** + * Column Sort Direction + */ + enum SortDirection { + None = -1, + Ascending = 0, + Descending = 1 + } + + /** + * Current sort status of a dataset column + */ + interface SortStatus { + /** + * The name of the column + */ + name: string; + + /** + * The current sort direction for the column. + */ + sortDirection: SortDirection; + } + + /** + * Paging state for a dataset + */ + interface Paging { + /** + * Total number of results on the server for the current query. + */ + totalResultCount: number; + + /** + * Whether the result set can be paged forwards. + */ + hasNextPage: boolean; + + /** + * Whether the result set can be paged backwards. + */ + hasPreviousPage: boolean; + + /** + * Request the next page of results to be loaded. New data will be pushed to control in another 'updateView' cycle. + */ + loadNextPage(): void; + + /** + * Request the previous page of results to be loaded. New data will be pushed to control in another 'updateView' cycle. + */ + loadPreviousPage(): void; + + /** + * Reload the results from the server, and reset to page 1. + */ + reset(): void; + + /** + * Sets the number of results to return per page on the next data refresh. + * @pageSize pageSize to be set. + */ + setPageSize(pageSize: number): void; + } + + /** + * Dataset entity linking. + */ + interface Linking { + /** + * Returns all the linked entities information + */ + getLinkedEntities(): LinkEntityExposedExpression[]; + + /** + * Add a new linked entity relationship with the existed query primary entity + */ + addLinkedEntity(expression: LinkEntityExposedExpression): void; + } + + /** + * Entity linking expression + */ + interface LinkEntityExposedExpression { + /** + * The 'name' of the entity to link to + */ + name: string; + + /** + * The 'from' attribute in the link-entity relationship + */ + from: string; + + /** + * The 'to' attribute in the link-entity relationship + */ + to: string; + + /** + * The 'type' of the link, referred by the link-entity attribute + */ + linkType: string; + + /** + * The 'alias' for the link-entity relationship + */ + alias: string; + } + } + } +} diff --git a/types/powerapps-component-framework/index.d.ts b/types/powerapps-component-framework/index.d.ts new file mode 100644 index 0000000000..f4ba8718d0 --- /dev/null +++ b/types/powerapps-component-framework/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for non-npm package PowerApps Component Framework 1.0 +// Project: https://powerapps.microsoft.com +// Definitions by: Joseph Pursley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// diff --git a/types/powerapps-component-framework/powerapps-component-framework-tests.ts b/types/powerapps-component-framework/powerapps-component-framework-tests.ts new file mode 100644 index 0000000000..de727aff7e --- /dev/null +++ b/types/powerapps-component-framework/powerapps-component-framework-tests.ts @@ -0,0 +1,87 @@ +interface TInputs { inputString?: string; } +interface TOutputs { testString: string; } + +class TestControl implements ComponentFramework.StandardControl { + init(context: ComponentFramework.Context, notifyOutputChanged?: () => void, state?: ComponentFramework.Dictionary, container?: HTMLDivElement) { + } + updateView(context: ComponentFramework.Context) { + } + destroy() { + } + getOutputs() { + return { + testString: '', + }; + } +} + +const clientTest: ComponentFramework.Client = { + disableScroll: false, + getFormFactor: () => 1, + getClient: () => '', + isOffline: () => false +}; + +const tmpFile: ComponentFramework.FileObject = { fileContent: '', fileName: '', fileSize: 0, mimeType: '' }; +const deviceTest: ComponentFramework.Device = { + captureAudio: () => Promise.resolve(tmpFile), + captureImage: () => Promise.resolve(tmpFile), + captureVideo: () => Promise.resolve(tmpFile), + getBarcodeValue: () => Promise.resolve(''), + getCurrentPosition: () => Promise.resolve({coords: {}, timestamp: new Date(0)}), + pickFile: () => Promise.resolve([tmpFile]) +}; + +const formattingTest: ComponentFramework.Formatting = { + formatCurrency: (value: number) => value.toString(), + formatDecimal: (value: number) => value.toString(), + formatDateAsFilterStringInUTC: (value: Date) => value.toString(), + formatDateLong: (value: Date) => value.toString(), + formatDateLongAbbreviated: (value: Date) => value.toString(), + formatDateShort: (value: Date) => value.toString(), + formatDateYearMonth: (value: Date) => value.toString(), + formatInteger: (value: number) => value.toString(), + formatLanguage: (value: number) => value.toString(), + formatTime: (value: Date, behavior: ComponentFramework.FormattingApi.DateTimeFieldBehavior) => value.toString(), + getWeekOfYear: (value: Date) => 0, +}; + +const modeTest: ComponentFramework.Mode = { + allocatedHeight: -1, + allocatedWidth: -1, + isControlDisabled: false, + isVisible: true, + label: '', + setControlState: (state: ComponentFramework.Dictionary) => false, + setFullScreen: (value: boolean) => null, + trackContainerResize: (value: boolean) => null +}; + +const resourcesTest: ComponentFramework.Resources = { + getResource: (id: string, success: (data: string) => void, failure: () => void) => {}, + getString: (id: string) => '' +}; + +const dictionary: ComponentFramework.Dictionary = { testKey: '' }; + +const imeModeAuto: ComponentFramework.PropertyHelper.ImeMode = ComponentFramework.PropertyHelper.ImeMode.Auto; + +const dataSetApiColumn: ComponentFramework.PropertyHelper.DataSetApi.Column = { + name: '', + displayName: '', + dataType: '', + alias: '', + order: 1, + visualSizeFactor: 1, + isHidden: false, + isPrimary: true, + disableSorting: false +}; + +const linkEntityExposeExpression: ComponentFramework.PropertyHelper.DataSetApi.LinkEntityExposedExpression = { + name: '', + from: '', + to: '', + linkType: '', + alias: '' +}; diff --git a/types/powerapps-component-framework/tsconfig.json b/types/powerapps-component-framework/tsconfig.json new file mode 100644 index 0000000000..57d0f82863 --- /dev/null +++ b/types/powerapps-component-framework/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true, + "noEmit": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [] + }, + "files": [ + "index.d.ts", + "powerapps-component-framework-tests.ts" + ] +} diff --git a/types/powerapps-component-framework/tslint.json b/types/powerapps-component-framework/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/powerapps-component-framework/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/precise/tslint.json b/types/precise/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/precise/tslint.json +++ b/types/precise/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/precond/tslint.json b/types/precond/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/precond/tslint.json +++ b/types/precond/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/preloadjs/tslint.json b/types/preloadjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/preloadjs/tslint.json +++ b/types/preloadjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/prelude-ls/tslint.json b/types/prelude-ls/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/prelude-ls/tslint.json +++ b/types/prelude-ls/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/prettyjson/tslint.json b/types/prettyjson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/prettyjson/tslint.json +++ b/types/prettyjson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/priorityqueuejs/tslint.json b/types/priorityqueuejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/priorityqueuejs/tslint.json +++ b/types/priorityqueuejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/progress/tslint.json b/types/progress/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/progress/tslint.json +++ b/types/progress/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/progressjs/tslint.json b/types/progressjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/progressjs/tslint.json +++ b/types/progressjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/project-oxford/tslint.json b/types/project-oxford/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/project-oxford/tslint.json +++ b/types/project-oxford/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/promise-pg/tslint.json b/types/promise-pg/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/promise-pg/tslint.json +++ b/types/promise-pg/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/promise-pool/tslint.json b/types/promise-pool/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/promise-pool/tslint.json +++ b/types/promise-pool/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/promisify-node/tslint.json b/types/promisify-node/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/promisify-node/tslint.json +++ b/types/promisify-node/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/promisify-supertest/tslint.json b/types/promisify-supertest/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/promisify-supertest/tslint.json +++ b/types/promisify-supertest/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/prompt-sync-history/tslint.json b/types/prompt-sync-history/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/prompt-sync-history/tslint.json +++ b/types/prompt-sync-history/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/prompt-sync/tslint.json b/types/prompt-sync/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/prompt-sync/tslint.json +++ b/types/prompt-sync/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/promptly/tslint.json b/types/promptly/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/promptly/tslint.json +++ b/types/promptly/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/protractor-helpers/tslint.json b/types/protractor-helpers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/protractor-helpers/tslint.json +++ b/types/protractor-helpers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/protractor-http-mock/tslint.json b/types/protractor-http-mock/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/protractor-http-mock/tslint.json +++ b/types/protractor-http-mock/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/proxyquire/tslint.json b/types/proxyquire/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/proxyquire/tslint.json +++ b/types/proxyquire/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pty.js/tslint.json b/types/pty.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pty.js/tslint.json +++ b/types/pty.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pubsub-js/tslint.json b/types/pubsub-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pubsub-js/tslint.json +++ b/types/pubsub-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pug/tslint.json b/types/pug/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pug/tslint.json +++ b/types/pug/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pure-render-decorator/tslint.json b/types/pure-render-decorator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pure-render-decorator/tslint.json +++ b/types/pure-render-decorator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/purl/tslint.json b/types/purl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/purl/tslint.json +++ b/types/purl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/pvutils/tslint.json b/types/pvutils/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/pvutils/tslint.json +++ b/types/pvutils/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/q-io/tslint.json b/types/q-io/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/q-io/tslint.json +++ b/types/q-io/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/q-retry/tslint.json b/types/q-retry/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/q-retry/tslint.json +++ b/types/q-retry/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/qs/tslint.json b/types/qs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/qs/tslint.json +++ b/types/qs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/qtip2/tslint.json b/types/qtip2/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/qtip2/tslint.json +++ b/types/qtip2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/quixote/tslint.json b/types/quixote/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/quixote/tslint.json +++ b/types/quixote/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/qunit/tslint.json b/types/qunit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/qunit/tslint.json +++ b/types/qunit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/quoted-printable/tslint.json b/types/quoted-printable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/quoted-printable/tslint.json +++ b/types/quoted-printable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/qwest/tslint.json b/types/qwest/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/qwest/tslint.json +++ b/types/qwest/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rabbit.js/tslint.json b/types/rabbit.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rabbit.js/tslint.json +++ b/types/rabbit.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ractive/tslint.json b/types/ractive/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ractive/tslint.json +++ b/types/ractive/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/radium/tslint.json b/types/radium/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/radium/tslint.json +++ b/types/radium/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/radius/tslint.json b/types/radius/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/radius/tslint.json +++ b/types/radius/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 917715c3e7..1078d9a51a 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -2686,9 +2686,9 @@ declare namespace R { * sequence to transform the resulting Traversable of Applicative into * an Applicative of Traversable. */ - traverse(of: (a: U[]) => A, fn: (t: T) => U, list: ReadonlyArray): A; - traverse(of: (a: U[]) => A, fn: (t: T) => U): (list: ReadonlyArray) => A; - traverse(of: (a: U[]) => A): (fn: (t: T) => U, list: ReadonlyArray) => A; + traverse(of: (a: B) => ReadonlyArray, fn: (t: A) => ReadonlyArray, list: ReadonlyArray): B[][]; + traverse(of: (a: B) => ReadonlyArray, fn: (t: A) => ReadonlyArray): (list: ReadonlyArray) => B[][]; + traverse(of: (a: B) => ReadonlyArray): (fn: (t: A) => ReadonlyArray, list: ReadonlyArray) => B[][]; /** * Removes (strips) whitespace from both ends of the string. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index fdac7648db..6f88d82200 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -967,7 +967,8 @@ interface Obj { } const list: Book[] = [{id: "xyz", title: "A"}, {id: "abc", title: "B"}]; const a1 = R.indexBy(R.prop("id"), list); - const a2 = R.indexBy(R.prop("id"))(list); + // Typescript 3.3 incorrectly gives `a2: {}`, 3.4 gives an error instead. + // const a2 = R.indexBy(R.prop("id"))(list); const a3 = R.indexBy<{ id: string }>(R.prop("id"))(list); const a4 = R.indexBy(R.prop<"id", string>("id"))(list); const a5 = R.indexBy<{ id: string }>(R.prop<"id", string>("id"))(list); @@ -1459,7 +1460,7 @@ type Pair = KeyValuePair; const list = [1, 2, 3]; R.traverse(of, fn, list); R.traverse(of, fn)(list); - R.traverse(of)(fn, list); + R.traverse(of)(fn, list); }; () => { diff --git a/types/random-string/tslint.json b/types/random-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/random-string/tslint.json +++ b/types/random-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/randomcolor/tslint.json b/types/randomcolor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/randomcolor/tslint.json +++ b/types/randomcolor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/randomstring/tslint.json b/types/randomstring/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/randomstring/tslint.json +++ b/types/randomstring/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rangy/tslint.json b/types/rangy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rangy/tslint.json +++ b/types/rangy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rangyinputs/tslint.json b/types/rangyinputs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rangyinputs/tslint.json +++ b/types/rangyinputs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/raphael/tslint.json b/types/raphael/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/raphael/tslint.json +++ b/types/raphael/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ratelimiter/tslint.json b/types/ratelimiter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ratelimiter/tslint.json +++ b/types/ratelimiter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/raty/tslint.json b/types/raty/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/raty/tslint.json +++ b/types/raty/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rbush/tslint.json b/types/rbush/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rbush/tslint.json +++ b/types/rbush/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rc-select/tslint.json b/types/rc-select/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rc-select/tslint.json +++ b/types/rc-select/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rcloader/tslint.json b/types/rcloader/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rcloader/tslint.json +++ b/types/rcloader/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-create-fragment/tslint.json b/types/react-addons-create-fragment/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-create-fragment/tslint.json +++ b/types/react-addons-create-fragment/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-css-transition-group/tslint.json b/types/react-addons-css-transition-group/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-css-transition-group/tslint.json +++ b/types/react-addons-css-transition-group/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-linked-state-mixin/tslint.json b/types/react-addons-linked-state-mixin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-linked-state-mixin/tslint.json +++ b/types/react-addons-linked-state-mixin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-perf/tslint.json b/types/react-addons-perf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-perf/tslint.json +++ b/types/react-addons-perf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-pure-render-mixin/tslint.json b/types/react-addons-pure-render-mixin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-pure-render-mixin/tslint.json +++ b/types/react-addons-pure-render-mixin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-shallow-compare/tslint.json b/types/react-addons-shallow-compare/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-shallow-compare/tslint.json +++ b/types/react-addons-shallow-compare/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-test-utils/tslint.json b/types/react-addons-test-utils/tslint.json index e3610fefae..89955128d5 100644 --- a/types/react-addons-test-utils/tslint.json +++ b/types/react-addons-test-utils/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-transition-group/tslint.json b/types/react-addons-transition-group/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-transition-group/tslint.json +++ b/types/react-addons-transition-group/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-addons-update/tslint.json b/types/react-addons-update/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-addons-update/tslint.json +++ b/types/react-addons-update/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-alert/index.d.ts b/types/react-alert/index.d.ts index 6c94da77b0..5334de3571 100644 --- a/types/react-alert/index.d.ts +++ b/types/react-alert/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-alert 4.0 +// Type definitions for react-alert 5.2 // Project: https://github.com/schiehll/react-alert // Definitions by: Yue Yang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,16 +8,49 @@ import * as React from 'react'; export type AlertPosition = | 'top left' - | 'top right' | 'top center' + | 'top right' + | 'middle left' + | 'middle' + | 'middle right' | 'bottom left' - | 'bottom right' - | 'bottom center'; + | 'bottom center' + | 'bottom right'; + +export interface Positions { + TOP_LEFT: 'top left'; + TOP_CENTER: 'top center'; + TOP_RIGHT: 'top right'; + MIDDLE_LEFT: 'middle left'; + MIDDLE: 'middle'; + MIDDLE_RIGHT: 'middle right'; + BOTTOM_LEFT: 'bottom left'; + BOTTOM_CENTER: 'bottom center'; + BOTTOM_RIGHT: 'bottom right'; +} + +export const positions: Positions; export type AlertType = 'info' | 'success' | 'error'; + +export interface Types { + INFO: 'info'; + SUCCESS: 'success'; + ERROR: 'error'; +} + +export const types: Types; + export type AlertTransition = 'fade' | 'scale'; -export interface ProviderOptions { +export interface Transitions { + FADE: 'fade'; + SCALE: 'scale'; +} + +export const transitions: Transitions; + +export interface AlertProviderProps extends React.HTMLAttributes { /** * The margin of each alert * @@ -49,18 +82,33 @@ export interface ProviderOptions { */ transition?: AlertTransition; /** - * The z-index of alerts + * The style of the alert container * - * Default value: 100 + * Default z-index value: 100 */ - zIndex?: number; + containerStyle?: React.CSSProperties; + /** + * The alert component for each message + */ + template: React.ComponentType; + /** + * Custom context to separate alerts. + */ + context?: React.Context; } -export class Provider extends React.Component {} +export interface AlertComponentProps { + id: string; + message: React.ReactNode; + options: AlertCustomOptionsWithType; + close(): void; +} -export const Alert: React.Consumer; +export interface AlertComponentPropsWithStyle extends AlertComponentProps { + style: React.CSSProperties; +} + +export class Provider extends React.Component {} export interface AlertCustomOptions { /** @@ -70,28 +118,32 @@ export interface AlertCustomOptions { /** * Callback that will be executed after this alert open */ - onOpen?(): undefined; + onOpen?(): void; /** * Callback that will be executed after this alert is removed */ - onClose?(): undefined; + onClose?(): void; } export interface AlertCustomOptionsWithType extends AlertCustomOptions { type?: AlertType; } -export interface InjectedAlertProp { +export interface AlertManager { + root?: HTMLElement; + alerts: AlertComponentProps[]; show( - message?: string, + message?: React.ReactNode, options?: AlertCustomOptionsWithType - ): InjectedAlertProp; - remove(alert: InjectedAlertProp): undefined; - success(message?: string, options?: AlertCustomOptions): InjectedAlertProp; - error(message?: string, options?: AlertCustomOptions): InjectedAlertProp; - info(message?: string, options?: AlertCustomOptions): InjectedAlertProp; + ): AlertComponentProps; + remove(alert: AlertComponentProps): void; + success(message?: React.ReactNode, options?: AlertCustomOptions): AlertComponentProps; + error(message?: React.ReactNode, options?: AlertCustomOptions): AlertComponentProps; + info(message?: React.ReactNode, options?: AlertCustomOptions): AlertComponentProps; } -export function withAlert

( - c: React.ComponentType

-): React.ComponentType>>; +export function withAlert

(context?: React.Context): + (c: React.ComponentType

) => + React.ComponentType>>; + +export function useAlert(context?: React.Context): AlertManager; diff --git a/types/react-alert/react-alert-tests.tsx b/types/react-alert/react-alert-tests.tsx index c6088a52a8..64a4e5cf97 100644 --- a/types/react-alert/react-alert-tests.tsx +++ b/types/react-alert/react-alert-tests.tsx @@ -1,20 +1,28 @@ import * as React from 'react'; import { + AlertComponentPropsWithStyle, + AlertManager, Provider as AlertProvider, - Alert, + AlertProviderProps, + useAlert, withAlert, - AlertPosition, - AlertTransition, - ProviderOptions, - InjectedAlertProp } from 'react-alert'; -class AppWithoutAlert extends React.Component<{ alert: InjectedAlertProp }> { +class AppWithoutAlert extends React.Component<{ alert: AlertManager }> { render() { return ( - )} - - ); - } -} +const App = withAlert(customContext)(AppWithoutAlert); -class AlertTemplate extends React.Component { +const AlertHook = (): JSX.Element => { + const alert = useAlert(); + return ( + + ); +}; + +class AlertTemplate extends React.Component { render() { // the style contains only the margin given as offset // options contains all alert given options @@ -63,28 +76,25 @@ class AlertTemplate extends React.Component { } } -const options: ProviderOptions = { - position: 'bottom center' as AlertPosition, +const options: AlertProviderProps = { + position: 'bottom center', timeout: 5000, offset: '30px', - transition: 'scale' as AlertTransition + transition: 'scale', + context: customContext, + className: 'cssClass', + template: AlertTemplate, + containerStyle: { + margin: 5, + }, }; class Root extends React.Component { render() { return ( - + - - ); - } -} - -class RootAlert extends React.Component { - render() { - return ( - - + ); } diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index 926a8f7e9f..6c9334c670 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -105,7 +105,7 @@ export interface DroppableProvidedProps { } export interface DroppableProvided { innerRef(element: HTMLElement | null): any; - placeholder?: React.ReactElement | null; + placeholder?: React.ReactElement | null; droppableProps: DroppableProvidedProps; } @@ -122,7 +122,7 @@ export interface DroppableProps { isDropDisabled?: boolean; isCombineEnabled?: boolean; direction?: 'vertical' | 'horizontal'; - children(provided: DroppableProvided, snapshot: DroppableStateSnapshot): React.ReactElement; + children(provided: DroppableProvided, snapshot: DroppableStateSnapshot): React.ReactElement; } export class Droppable extends React.Component { } @@ -176,7 +176,7 @@ export interface DraggableProvided { // will be removed after move to react 16 innerRef(element?: HTMLElement | null): any; - placeholder?: React.ReactElement | null; + placeholder?: React.ReactElement | null; } export interface DraggableStateSnapshot { @@ -205,7 +205,7 @@ export interface DraggableProps { index: number; isDragDisabled?: boolean; disableInteractiveElementBlocking?: boolean; - children(provided: DraggableProvided, snapshot: DraggableStateSnapshot): React.ReactElement; + children(provided: DraggableProvided, snapshot: DraggableStateSnapshot): React.ReactElement; type?: TypeId; shouldRespectForceTouch?: boolean; } diff --git a/types/react-bootstrap-daterangepicker/tslint.json b/types/react-bootstrap-daterangepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-bootstrap-daterangepicker/tslint.json +++ b/types/react-bootstrap-daterangepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-breadcrumbs/tslint.json b/types/react-breadcrumbs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-breadcrumbs/tslint.json +++ b/types/react-breadcrumbs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-bytesize-icons/tslint.json b/types/react-bytesize-icons/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-bytesize-icons/tslint.json +++ b/types/react-bytesize-icons/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-calendar-timeline/tslint.json b/types/react-calendar-timeline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-calendar-timeline/tslint.json +++ b/types/react-calendar-timeline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-codemirror/tslint.json b/types/react-codemirror/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-codemirror/tslint.json +++ b/types/react-codemirror/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-css-modules/tslint.json b/types/react-css-modules/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-css-modules/tslint.json +++ b/types/react-css-modules/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-css-transition-replace/tslint.json b/types/react-css-transition-replace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-css-transition-replace/tslint.json +++ b/types/react-css-transition-replace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-csv/components/Link.d.ts b/types/react-csv/components/Link.d.ts index 3e133095de..82194dea93 100644 --- a/types/react-csv/components/Link.d.ts +++ b/types/react-csv/components/Link.d.ts @@ -1,5 +1,16 @@ import { Component } from "react"; import { CommonPropTypes } from "./CommonPropTypes"; -export default class Link extends Component { -} +// tslint:disable-next-line strict-export-declare-modifiers +type Omit = Pick>; + +export interface LinkProps + extends CommonPropTypes, + Omit< + React.DetailedHTMLProps< + React.AnchorHTMLAttributes, + HTMLAnchorElement + >, + "onClick" + > {} +export default class Link extends Component {} diff --git a/types/react-csv/react-csv-tests.tsx b/types/react-csv/react-csv-tests.tsx index a099d60626..4153879fea 100644 --- a/types/react-csv/react-csv-tests.tsx +++ b/types/react-csv/react-csv-tests.tsx @@ -3,16 +3,16 @@ import { render } from "react-dom"; import { CSVLink, CSVDownload } from "react-csv"; const headers = [ - {label: 'First Name', key: 'details.firstName'}, - {label: 'Last Name', key: 'details.lastName'}, - {label: 'Job', key: 'job'}, + { label: "First Name", key: "details.firstName" }, + { label: "Last Name", key: "details.lastName" }, + { label: "Job", key: "job" } ]; -const headersStrings = ['foo', 'bar']; +const headersStrings = ["foo", "bar"]; const data = [ - {details: {firstName: 'Ahmed', lastName: 'Tomi'}, job: 'manager'}, - {details: {firstName: 'John', lastName: 'Jones'}, job: 'developer'}, + { details: { firstName: "Ahmed", lastName: "Tomi" }, job: "manager" }, + { details: { firstName: "John", lastName: "Jones" }, job: "developer" } ]; const dataString = `firstname,lastname @@ -21,57 +21,226 @@ Raed,Labes Yezzi,Min l3b `; -const syncOnClickReturn = (event: React.MouseEventHandler) => { +const syncOnClickReturn = ( + event: React.MouseEventHandler +) => { window.console.log(event); return true; }; -const syncOnClickVoid = (event: React.MouseEventHandler) => window.console.log(event); -const asyncOnClickReturn = (event: React.MouseEventHandler, done: (proceed?: boolean) => void) => { +const syncOnClickVoid = (event: React.MouseEventHandler) => + window.console.log(event); +const asyncOnClickReturn = ( + event: React.MouseEventHandler, + done: (proceed?: boolean) => void +) => { window.console.log(event); done(true); }; -const asyncOnClickVoid = (event: React.MouseEventHandler, done: (proceed?: boolean) => void) => { +const asyncOnClickVoid = ( + event: React.MouseEventHandler, + done: (proceed?: boolean) => void +) => { window.console.log(event); done(); }; const node = document.getElementById("main"); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); -render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render(, node); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); +render( + , + node +); diff --git a/types/react-custom-scrollbars/tslint.json b/types/react-custom-scrollbars/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-custom-scrollbars/tslint.json +++ b/types/react-custom-scrollbars/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-data-grid/tslint.json b/types/react-data-grid/tslint.json index 637071b426..592fc9bcaa 100644 --- a/types/react-data-grid/tslint.json +++ b/types/react-data-grid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-datagrid/tslint.json b/types/react-datagrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-datagrid/tslint.json +++ b/types/react-datagrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-dates/tslint.json b/types/react-dates/tslint.json index 01adabd8ca..1285fdffdc 100644 --- a/types/react-dates/tslint.json +++ b/types/react-dates/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "file-name-casing": false, diff --git a/types/react-dom/test-utils/index.d.ts b/types/react-dom/test-utils/index.d.ts index c6f46edd36..ea61a9c858 100644 --- a/types/react-dom/test-utils/index.d.ts +++ b/types/react-dom/test-utils/index.d.ts @@ -29,7 +29,7 @@ export interface SyntheticEventData extends OptionalEventProperties { clientX?: number; clientY?: number; changedTouches?: TouchList; - charCode?: boolean; + charCode?: number; clipboardData?: DataTransfer; ctrlKey?: boolean; deltaMode?: number; diff --git a/types/react-dom/tslint.json b/types/react-dom/tslint.json index 8179a3659a..3dc65c7465 100644 --- a/types/react-dom/tslint.json +++ b/types/react-dom/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-unnecessary-generics": false, "no-unnecessary-type-assertion": false } diff --git a/types/react-dom/v15/react-dom-tests.ts b/types/react-dom/v15/react-dom-tests.ts index 5f5b149594..8d10405a86 100644 --- a/types/react-dom/v15/react-dom-tests.ts +++ b/types/react-dom/v15/react-dom-tests.ts @@ -61,7 +61,7 @@ describe('React dom test utils', () => { node.value = 'giraffe'; ReactTestUtils.Simulate.change(node); - ReactTestUtils.Simulate.keyDown(node, { key: "Enter", keyCode: 13, which: 13 }); + ReactTestUtils.Simulate.keyDown(node, { key: "Enter", charCode: 13, keyCode: 13, which: 13 }); }); it('renderIntoDocument', () => { diff --git a/types/react-dropzone/tslint.json b/types/react-dropzone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-dropzone/tslint.json +++ b/types/react-dropzone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-easy-chart/tslint.json b/types/react-easy-chart/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-easy-chart/tslint.json +++ b/types/react-easy-chart/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-file-input/tslint.json b/types/react-file-input/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-file-input/tslint.json +++ b/types/react-file-input/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-flex/tslint.json b/types/react-flex/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-flex/tslint.json +++ b/types/react-flex/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-flexr/tslint.json b/types/react-flexr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-flexr/tslint.json +++ b/types/react-flexr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-helmet/tslint.json b/types/react-helmet/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-helmet/tslint.json +++ b/types/react-helmet/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-holder/tslint.json b/types/react-holder/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-holder/tslint.json +++ b/types/react-holder/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-imageloader/tslint.json b/types/react-imageloader/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-imageloader/tslint.json +++ b/types/react-imageloader/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-infinite/tslint.json b/types/react-infinite/tslint.json index e3610fefae..89955128d5 100644 --- a/types/react-infinite/tslint.json +++ b/types/react-infinite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-inlinesvg/index.d.ts b/types/react-inlinesvg/index.d.ts index e8e1f4095b..2dde329572 100644 --- a/types/react-inlinesvg/index.d.ts +++ b/types/react-inlinesvg/index.d.ts @@ -31,6 +31,7 @@ export interface Props { uniquifyIDs?: boolean; onError?(error: RequestError | InlineSVGError): void; onLoad?(src: URL | string, isCached: boolean): void; + processSVG?(svgText: string): string; supportTest?(): void; wrapper?(): ReactNode; } diff --git a/types/react-input-calendar/tslint.json b/types/react-input-calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-input-calendar/tslint.json +++ b/types/react-input-calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-instantsearch-core/index.d.ts b/types/react-instantsearch-core/index.d.ts index 0092feb370..ed0241ffad 100644 --- a/types/react-instantsearch-core/index.d.ts +++ b/types/react-instantsearch-core/index.d.ts @@ -333,7 +333,7 @@ interface HitsProvided { * https://community.algolia.com/react-instantsearch/connectors/connectHits.html */ // tslint:disable-next-line:no-unnecessary-generics -export function connectHits(stateless: React.StatelessComponent>): React.ComponentClass; +export function connectHits(stateless: React.StatelessComponent>): React.ComponentClass; export function connectHits, THit>(ctor: React.ComponentType): ConnectedComponentClass>; export function connectHitsPerPage(Composed: React.ComponentType): React.ComponentClass; diff --git a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx index 76cc26f2a4..3d0208707e 100644 --- a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx +++ b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx @@ -408,12 +408,14 @@ import { } const ConnectedCustomHighlight2 = connectHighlight(CustomHighlight2); - connectHits(({ hits }) => ( + const ConnectedStatelessHits = connectHits(({ hits }) => (

)); + + ; }; // https://github.com/algolia/react-instantsearch/blob/master/examples/autocomplete/src/App-Mentions.js diff --git a/types/react-intl-redux/tslint.json b/types/react-intl-redux/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-intl-redux/tslint.json +++ b/types/react-intl-redux/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-is-deprecated/tslint.json b/types/react-is-deprecated/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-is-deprecated/tslint.json +++ b/types/react-is-deprecated/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-jsonschema-form/tslint.json b/types/react-jsonschema-form/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-jsonschema-form/tslint.json +++ b/types/react-jsonschema-form/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index 04c4d9aed9..e0b25765de 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-map-gl 4.0 +// Type definitions for react-map-gl 4.1 // Project: https://github.com/uber/react-map-gl#readme // Definitions by: Robert Imig // Fabio Berta +// Sander Siim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 @@ -309,6 +310,25 @@ export interface NavigationControlProps extends BaseControlProps { export class NavigationControl extends BaseControl {} +export interface FullscreenControlProps extends BaseControlProps { + className?: string; + container?: HTMLElement | null; +} + +export class FullscreenControl extends BaseControl {} + +export interface GeolocateControlProps extends BaseControlProps { + className?: string; + positionOptions?: MapboxGL.PositionOptions; + fitBoundsOptions?: MapboxGL.FitBoundsOptions; + trackUserLocation?: boolean; + showUserLocation?: boolean; + onViewStateChange?: (info: ViewStateChangeInfo) => void; + onViewportChange?: (viewState: ViewState) => void; +} + +export class GeolocateControl extends BaseControl {} + export interface DraggableControlProps extends BaseControlProps { draggable?: boolean; onDrag?: (event: DragEvent) => void; diff --git a/types/react-map-gl/react-map-gl-tests.tsx b/types/react-map-gl/react-map-gl-tests.tsx index c9024287c9..17179fb0d6 100644 --- a/types/react-map-gl/react-map-gl-tests.tsx +++ b/types/react-map-gl/react-map-gl-tests.tsx @@ -5,6 +5,8 @@ import { CanvasOverlay, SVGOverlay, HTMLOverlay, + FullscreenControl, + GeolocateControl, CanvasRedrawOptions, HTMLRedrawOptions, SVGRedrawOptions, @@ -37,6 +39,8 @@ class MyMap extends React.Component<{}, State> { width={400} ref={this.setRefInteractive} > + + { const { diff --git a/types/react-mdl/tslint.json b/types/react-mdl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-mdl/tslint.json +++ b/types/react-mdl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-mixin/tslint.json b/types/react-mixin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-mixin/tslint.json +++ b/types/react-mixin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-motion-slider/tslint.json b/types/react-motion-slider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-motion-slider/tslint.json +++ b/types/react-motion-slider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-motion/tslint.json b/types/react-motion/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-motion/tslint.json +++ b/types/react-motion/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-native-canvas/index.d.ts b/types/react-native-canvas/index.d.ts index 559b986ba8..1c1f973102 100644 --- a/types/react-native-canvas/index.d.ts +++ b/types/react-native-canvas/index.d.ts @@ -167,9 +167,9 @@ export default class Canvas extends React.Component { export class Image { constructor(canvas: Canvas, height?: number, width?: number); crossOrigin: string | undefined; - height: number | undefined; - width: number | undefined; - src: string | undefined; + height: number; + width: number; + src: string; addEventListener: (event: string, func: (...args: any) => any) => void; } diff --git a/types/react-native-orientation/tslint.json b/types/react-native-orientation/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-native-orientation/tslint.json +++ b/types/react-native-orientation/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-native-sortable-list/tslint.json b/types/react-native-sortable-list/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-native-sortable-list/tslint.json +++ b/types/react-native-sortable-list/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-native-touch-id/tslint.json b/types/react-native-touch-id/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-native-touch-id/tslint.json +++ b/types/react-native-touch-id/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-notification-system/tslint.json b/types/react-notification-system/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-notification-system/tslint.json +++ b/types/react-notification-system/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-props-decorators/tslint.json b/types/react-props-decorators/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-props-decorators/tslint.json +++ b/types/react-props-decorators/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-redux-i18n/tslint.json b/types/react-redux-i18n/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-redux-i18n/tslint.json +++ b/types/react-redux-i18n/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-redux-toastr/tslint.json b/types/react-redux-toastr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-redux-toastr/tslint.json +++ b/types/react-redux-toastr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-router-bootstrap/tslint.json b/types/react-router-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-router-bootstrap/tslint.json +++ b/types/react-router-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-scrollbar/tslint.json b/types/react-scrollbar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-scrollbar/tslint.json +++ b/types/react-scrollbar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-spinkit/tslint.json b/types/react-spinkit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-spinkit/tslint.json +++ b/types/react-spinkit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-swf/tslint.json b/types/react-swf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-swf/tslint.json +++ b/types/react-swf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-swipeable/index.d.ts b/types/react-swipeable/index.d.ts index fc6326deae..7a53884bd3 100644 --- a/types/react-swipeable/index.d.ts +++ b/types/react-swipeable/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for react-swipeable 4.2 +// Type definitions for react-swipeable 4.3 // Project: https://github.com/dogfessional/react-swipeable // Definitions by: Giedrius Grabauskas // Konstantin Vasilev // Hiroki Horiuchi +// Adam Bowles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -36,6 +37,7 @@ declare namespace ReactSwipeable { nodeName?: string; trackMouse?: boolean; disabled?: boolean; + rotationAngle?: number; innerRef?: React.Ref; children?: React.ReactNode; } diff --git a/types/react-swipeable/react-swipeable-tests.tsx b/types/react-swipeable/react-swipeable-tests.tsx index 87294f001e..0479a7d3d5 100644 --- a/types/react-swipeable/react-swipeable-tests.tsx +++ b/types/react-swipeable/react-swipeable-tests.tsx @@ -39,6 +39,7 @@ class SampleComponent extends React.PureComponent { disabled innerRef={this.swipeRef} onClick={this.handleClick} + rotationAngle={0} >
This element can be swiped diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index 626e420cb6..6327eb6128 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-table 6.6 +// Type definitions for react-table 6.8 // Project: https://github.com/react-tools/react-table // Definitions by: Roy Xue , // Pavel Sakalo , diff --git a/types/react-tagcloud/tslint.json b/types/react-tagcloud/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-tagcloud/tslint.json +++ b/types/react-tagcloud/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-tap-event-plugin/tslint.json b/types/react-tap-event-plugin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-tap-event-plugin/tslint.json +++ b/types/react-tap-event-plugin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-test-renderer/tslint.json b/types/react-test-renderer/tslint.json index c4fd1ce0bb..1946fe8602 100644 --- a/types/react-test-renderer/tslint.json +++ b/types/react-test-renderer/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "dt-header": false, + "npm-naming": false, "no-unnecessary-generics": false } } diff --git a/types/react-textarea-autosize/tslint.json b/types/react-textarea-autosize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-textarea-autosize/tslint.json +++ b/types/react-textarea-autosize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-user-tour/tslint.json b/types/react-user-tour/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/react-user-tour/tslint.json +++ b/types/react-user-tour/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/react-virtualized/dist/es/Table.d.ts b/types/react-virtualized/dist/es/Table.d.ts index b66fac389b..d63d593b6e 100644 --- a/types/react-virtualized/dist/es/Table.d.ts +++ b/types/react-virtualized/dist/es/Table.d.ts @@ -183,11 +183,7 @@ export class Column extends Component { } export type RowMouseEventHandlerParams = { - rowData: { - columnData: object; - id: string; - index: number; - }; + rowData: any index: number; event: React.MouseEvent; }; diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index c105c4db2f..1fd2fb0b4f 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-virtualized 9.18 +// Type definitions for react-virtualized 9.21 // Project: https://github.com/bvaughn/react-virtualized // Definitions by: Kalle Ott // John Gunther diff --git a/types/react/tslint.json b/types/react/tslint.json index d2c103b50c..b68a2adfe2 100644 --- a/types/react/tslint.json +++ b/types/react/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-any-union": false, "no-empty-interface": false, "no-object-literal-type-assertion": false, diff --git a/types/reactcss/tslint.json b/types/reactcss/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/reactcss/tslint.json +++ b/types/reactcss/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/read-pkg/index.d.ts b/types/read-pkg/index.d.ts index 5e5b57c445..ba10fee4b9 100644 --- a/types/read-pkg/index.d.ts +++ b/types/read-pkg/index.d.ts @@ -1,15 +1,13 @@ -// Type definitions for read-pkg 3.0 +// Type definitions for read-pkg 4.0 // Project: https://github.com/sindresorhus/read-pkg -// Definitions by: Jeff Dickey +// Definitions by: Jeff Dickey , Richard Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import normalize = require('normalize-package-data'); declare namespace ReadPkg { - function sync(path: string, options: Options & {normalize: false}): {[k: string]: any}; function sync(options: Options & {normalize: false}): {[k: string]: any}; function sync(options?: Options): normalize.Package; - function sync(path?: string, options?: Options): normalize.Package; interface Options { /** @@ -18,14 +16,18 @@ declare namespace ReadPkg { * @default true */ normalize?: boolean; + /** + * Current working directory + * + * @default process.cwd() + */ + cwd?: string; } type Package = normalize.Package; } -declare function ReadPkg(path: string, options: ReadPkg.Options & {normalize: false}): Promise<{[k: string]: any}>; declare function ReadPkg(options: ReadPkg.Options & {normalize: false}): Promise<{[k: string]: any}>; declare function ReadPkg(options?: ReadPkg.Options): Promise; -declare function ReadPkg(path?: string, options?: ReadPkg.Options): Promise; export = ReadPkg; diff --git a/types/read-pkg/read-pkg-tests.ts b/types/read-pkg/read-pkg-tests.ts index a82f953eab..b39c578862 100644 --- a/types/read-pkg/read-pkg-tests.ts +++ b/types/read-pkg/read-pkg-tests.ts @@ -3,7 +3,8 @@ import ReadPkg = require('read-pkg'); ReadPkg().then(pkg => pkg.name); // $ExpectType Promise ReadPkg({normalize: true}).then(pkg => pkg.name); // $ExpectType Promise ReadPkg({normalize: false}).then(pkg => pkg['name']); // $ExpectType Promise +ReadPkg({cwd: './foo'}).then(pkg => pkg.name); // $ExpectType Promise ReadPkg.sync().name; // $ExpectType string ReadPkg.sync({normalize: true}).name; // $ExpectType string ReadPkg.sync({normalize: false})['name']; // $ExpectType any -ReadPkg.sync('package.json', {normalize: false})['name']; // $ExpectType any +ReadPkg.sync({cwd: './foo'}).name; // $ExpectType string diff --git a/types/read/tslint.json b/types/read/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/read/tslint.json +++ b/types/read/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/readdir-stream/tslint.json b/types/readdir-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/readdir-stream/tslint.json +++ b/types/readdir-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/recompose/tslint.json b/types/recompose/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/recompose/tslint.json +++ b/types/recompose/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redis-scripto/tslint.json b/types/redis-scripto/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redis-scripto/tslint.json +++ b/types/redis-scripto/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-action-utils/tslint.json b/types/redux-action-utils/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-action-utils/tslint.json +++ b/types/redux-action-utils/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-actions/index.d.ts b/types/redux-actions/index.d.ts index 6891563ab9..fd92441573 100644 --- a/types/redux-actions/index.d.ts +++ b/types/redux-actions/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for redux-actions 2.3 +// Type definitions for redux-actions 2.6 // Project: https://github.com/redux-utilities/redux-actions // Definitions by: Jack Hsu , // Alex Gorbatchev , // Alec Hill // Alexey Pelykh // Thiago de Andrade +// Ziyu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -17,7 +18,7 @@ export interface BaseAction { } export interface Action extends BaseAction { - payload?: Payload; + payload: Payload; error?: boolean; } @@ -66,6 +67,10 @@ export type Reducer = (state: State, action: Action) => export type ReducerMeta = (state: State, action: ActionMeta) => State; +export type ReduxCompatibleReducer = (state: State | undefined, action: Action) => State; + +export type ReduxCompatibleReducerMeta = (state: State | undefined, action: ActionMeta) => State; + /** argument inferring borrowed from lodash definitions */ export type ActionFunction0 = () => R; export type ActionFunction1 = (t1: T1) => R; @@ -148,13 +153,13 @@ export function handleAction( actionType: string | ActionFunctions | CombinedActionType, reducer: Reducer | ReducerNextThrow, initialState: State -): Reducer; +): ReduxCompatibleReducer; export function handleAction( actionType: string | ActionWithMetaFunctions | CombinedActionType, reducer: ReducerMeta | ReducerNextThrowMeta, initialState: State -): Reducer; +): ReduxCompatibleReducerMeta; export interface Options { prefix?: string; @@ -165,19 +170,19 @@ export function handleActions( reducerMap: ReducerMap, initialState: StateAndPayload, options?: Options -): Reducer; +): ReduxCompatibleReducer; export function handleActions( reducerMap: ReducerMap, initialState: State, options?: Options -): Reducer; +): ReduxCompatibleReducer; export function handleActions( reducerMap: ReducerMapMeta, initialState: State, options?: Options -): ReducerMeta; +): ReduxCompatibleReducerMeta; // https://github.com/redux-utilities/redux-actions/blob/v2.3.0/src/combineActions.js#L21 export function combineActions(...actionTypes: Array | string | symbol>): CombinedActionType; diff --git a/types/redux-actions/redux-actions-tests.ts b/types/redux-actions/redux-actions-tests.ts index 207e4746b7..27f33a2843 100644 --- a/types/redux-actions/redux-actions-tests.ts +++ b/types/redux-actions/redux-actions-tests.ts @@ -1,7 +1,6 @@ import * as ReduxActions from 'redux-actions'; let state: number; -const minimalAction: ReduxActions.BaseAction = { type: 'INCREMENT' }; const incrementAction: () => ReduxActions.Action = ReduxActions.createAction( 'INCREMENT', () => 1 @@ -11,14 +10,13 @@ const multiplyAction: (...args: number[]) => ReduxActions.Action = Redux 'MULTIPLY' ); -const action: ReduxActions.Action = incrementAction(); - const actionHandler = ReduxActions.handleAction( 'INCREMENT', (state: number, action: ReduxActions.Action) => state + action.payload, 0 ); +state = actionHandler(undefined, incrementAction()); state = actionHandler(0, incrementAction()); const actionHandlerWithReduceMap = ReduxActions.handleAction( @@ -31,6 +29,7 @@ const actionHandlerWithReduceMap = ReduxActions.handleAction( 0 ); +state = actionHandlerWithReduceMap(undefined, multiplyAction(10)); state = actionHandlerWithReduceMap(0, multiplyAction(10)); const actionsHandler = ReduxActions.handleActions({ @@ -38,7 +37,8 @@ const actionsHandler = ReduxActions.handleActions({ MULTIPLY: (state: number, action: ReduxActions.Action) => state * action.payload }, 0); -state = actionsHandler(0, { type: 'INCREMENT' }); +state = actionsHandler(undefined, incrementAction()); +state = actionsHandler(0, incrementAction()); const actionsHandlerWithInitialState = ReduxActions.handleActions({ INCREMENT: { @@ -49,7 +49,8 @@ const actionsHandlerWithInitialState = ReduxActions.handleActions({ } }, 0); -state = actionsHandlerWithInitialState(0, { type: 'INCREMENT' }); +state = actionsHandlerWithInitialState(undefined, incrementAction()); +state = actionsHandlerWithInitialState(0, incrementAction()); const actionsHandlerWithRecursiveReducerMap = ReduxActions.handleActions({ ADJUST: { @@ -58,6 +59,7 @@ const actionsHandlerWithRecursiveReducerMap = ReduxActions.handleActions) => state * action.payload }, 0, {prefix: 'TEST'}); -state = actionsHandlerWithOptions(0, { type: 'TEST/INCREMENT' }); +state = actionsHandlerWithOptions(undefined, { type: 'TEST/INCREMENT', payload: 1 }); +state = actionsHandlerWithOptions(0, { type: 'TEST/INCREMENT', payload: 1 }); const actionsHandlerWithRecursiveReducerMapAndOptions = ReduxActions.handleActions({ ADJUST: { @@ -74,6 +77,7 @@ const actionsHandlerWithRecursiveReducerMapAndOptions = ReduxActions.handleActio } }, 0, {namespace: '--'}); +state = actionsHandlerWithRecursiveReducerMapAndOptions(undefined, { type: 'ADJUST--UP', payload: 1 }); state = actionsHandlerWithRecursiveReducerMapAndOptions(0, { type: 'ADJUST--UP', payload: 1 }); // ---------------------------------------------------------------------------------------------------- @@ -117,6 +121,7 @@ const typedActionHandler = ReduxActions.handleAction( const actionNoArgs = typedIncrementAction(); actionNoArgs.payload.increase = 1; +typedState = typedActionHandler(undefined, actionNoArgs); typedState = typedActionHandler({ value: 0 }, actionNoArgs); const typedIncrementAction1TypedArg: (value: number) => @@ -144,6 +149,7 @@ const typedActionHandlerReducerMap = ReduxActions.handleActions( {value: 1} ); +typedState = typedActionHandlerReducerMap(undefined, actionFrom1Arg); typedState = typedActionHandlerReducerMap({ value: 0 }, actionFrom1Arg); const typedIncrementByActionWithMetaAnyArgs: (...args: any[]) => ReduxActions.ActionMeta = @@ -167,6 +173,7 @@ const typedActionHandlerWithMeta = ReduxActions.handleAction( @@ -181,6 +188,7 @@ const typedActionHandlerReducerMetaMap = ReduxActions.handleActions ReduxActions.ActionMeta = diff --git a/types/redux-actions/tsconfig.json b/types/redux-actions/tsconfig.json index ea4f7f1a53..8a88909508 100644 --- a/types/redux-actions/tsconfig.json +++ b/types/redux-actions/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ diff --git a/types/redux-debounced/tslint.json b/types/redux-debounced/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-debounced/tslint.json +++ b/types/redux-debounced/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-devtools-dock-monitor/tslint.json b/types/redux-devtools-dock-monitor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-devtools-dock-monitor/tslint.json +++ b/types/redux-devtools-dock-monitor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-devtools-log-monitor/tslint.json b/types/redux-devtools-log-monitor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-devtools-log-monitor/tslint.json +++ b/types/redux-devtools-log-monitor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-devtools/tslint.json b/types/redux-devtools/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-devtools/tslint.json +++ b/types/redux-devtools/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 752dccd876..7005abf1de 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -14,6 +14,7 @@ // Mohamed Shaaban // Ethan Setnik // Walter Barbagallo +// Kota Marusue // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 import { diff --git a/types/redux-form/lib/FieldArray.d.ts b/types/redux-form/lib/FieldArray.d.ts index b84d04ad5a..026e75633f 100644 --- a/types/redux-form/lib/FieldArray.d.ts +++ b/types/redux-form/lib/FieldArray.d.ts @@ -40,7 +40,7 @@ export interface FieldArrayFieldsProps { length: number; map(callback: FieldIterate): R[]; pop(): FieldValue; - push(value: FieldValue): void; + push(value?: FieldValue): void; remove(index: number): void; shift(): FieldValue; swap(indexA: number, indexB: number): void; diff --git a/types/redux-immutable/tslint.json b/types/redux-immutable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-immutable/tslint.json +++ b/types/redux-immutable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-mock-store/tslint.json b/types/redux-mock-store/tslint.json index 3337f86cdc..9b99cce699 100644 --- a/types/redux-mock-store/tslint.json +++ b/types/redux-mock-store/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODO "dt-header": false, + "npm-naming": false, "no-unnecessary-generics": false } } \ No newline at end of file diff --git a/types/redux-optimistic-ui/tslint.json b/types/redux-optimistic-ui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-optimistic-ui/tslint.json +++ b/types/redux-optimistic-ui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-promise-middleware/tslint.json b/types/redux-promise-middleware/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-promise-middleware/tslint.json +++ b/types/redux-promise-middleware/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-promise/tslint.json b/types/redux-promise/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-promise/tslint.json +++ b/types/redux-promise/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-recycle/tslint.json b/types/redux-recycle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-recycle/tslint.json +++ b/types/redux-recycle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-router/tslint.json b/types/redux-router/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-router/tslint.json +++ b/types/redux-router/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/redux-storage/tslint.json b/types/redux-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/redux-storage/tslint.json +++ b/types/redux-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-array-di/tslint.json b/types/ref-array-di/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-array-di/tslint.json +++ b/types/ref-array-di/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-array/tslint.json b/types/ref-array/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-array/tslint.json +++ b/types/ref-array/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-napi/tslint.json b/types/ref-napi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-napi/tslint.json +++ b/types/ref-napi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-struct-di/tslint.json b/types/ref-struct-di/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-struct-di/tslint.json +++ b/types/ref-struct-di/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-struct/tslint.json b/types/ref-struct/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-struct/tslint.json +++ b/types/ref-struct/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-union-di/tslint.json b/types/ref-union-di/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-union-di/tslint.json +++ b/types/ref-union-di/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref-union/tslint.json b/types/ref-union/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref-union/tslint.json +++ b/types/ref-union/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ref/tslint.json b/types/ref/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ref/tslint.json +++ b/types/ref/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/relateurl/tslint.json b/types/relateurl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/relateurl/tslint.json +++ b/types/relateurl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/replace-ext/tslint.json b/types/replace-ext/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/replace-ext/tslint.json +++ b/types/replace-ext/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/request-ip/tslint.json b/types/request-ip/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/request-ip/tslint.json +++ b/types/request-ip/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/requirejs-domready/tslint.json b/types/requirejs-domready/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/requirejs-domready/tslint.json +++ b/types/requirejs-domready/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/requirejs/tslint.json b/types/requirejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/requirejs/tslint.json +++ b/types/requirejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/resemblejs/tslint.json b/types/resemblejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/resemblejs/tslint.json +++ b/types/resemblejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/resize-observer-browser/index.d.ts b/types/resize-observer-browser/index.d.ts index 83291fe4a0..5e585f81e5 100644 --- a/types/resize-observer-browser/index.d.ts +++ b/types/resize-observer-browser/index.d.ts @@ -4,6 +4,12 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 +declare global { + interface Window { + ResizeObserver: typeof ResizeObserver; + } +} + export class ResizeObserver { constructor(callback: ResizeObserverCallback); disconnect(): void; @@ -11,7 +17,7 @@ export class ResizeObserver { unobserve(target: Element): void; } -export type ResizeObserverCallback = (entries: ResizeObserverEntry[]) => void; +export type ResizeObserverCallback = (entries: ReadonlyArray) => void; export interface ResizeObserverEntry { readonly target: Element; diff --git a/types/resize-observer-browser/test/resize-observer-browser-global.tests.ts b/types/resize-observer-browser/test/resize-observer-browser-global.tests.ts new file mode 100644 index 0000000000..6398b979fe --- /dev/null +++ b/types/resize-observer-browser/test/resize-observer-browser-global.tests.ts @@ -0,0 +1,11 @@ +function resizeObserverCreatesViaWindow(): void { + const resizeObserver = new window.ResizeObserver((entries) => { + const div = document.getElementById('display-div')!; + const rect = entries[0].contentRect; + div.textContent = `${rect.left} ${rect.right}`; + }); + const div = document.getElementById('resized-div')!; + resizeObserver.observe(div); + resizeObserver.unobserve(div); + resizeObserver.disconnect(); +} diff --git a/types/resize-observer-browser/resize-observer-browser-tests.ts b/types/resize-observer-browser/test/resize-observer-browser-module.tests.ts similarity index 100% rename from types/resize-observer-browser/resize-observer-browser-tests.ts rename to types/resize-observer-browser/test/resize-observer-browser-module.tests.ts diff --git a/types/resize-observer-browser/tsconfig.json b/types/resize-observer-browser/tsconfig.json index 849758c836..69a030695e 100644 --- a/types/resize-observer-browser/tsconfig.json +++ b/types/resize-observer-browser/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "resize-observer-browser-tests.ts" + "test/resize-observer-browser-global.tests.ts", + "test/resize-observer-browser-module.tests.ts" ] } diff --git a/types/resolve/tslint.json b/types/resolve/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/resolve/tslint.json +++ b/types/resolve/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/response-time/tslint.json b/types/response-time/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/response-time/tslint.json +++ b/types/response-time/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rest/tslint.json b/types/rest/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rest/tslint.json +++ b/types/rest/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/restangular/tslint.json b/types/restangular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/restangular/tslint.json +++ b/types/restangular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/restful.js/tslint.json b/types/restful.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/restful.js/tslint.json +++ b/types/restful.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/restler/tslint.json b/types/restler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/restler/tslint.json +++ b/types/restler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/resumablejs/tslint.json b/types/resumablejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/resumablejs/tslint.json +++ b/types/resumablejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rethinkdb/tslint.json b/types/rethinkdb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rethinkdb/tslint.json +++ b/types/rethinkdb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/revalidator/index.d.ts b/types/revalidator/index.d.ts index dd249d2afc..ec172c2be2 100644 --- a/types/revalidator/index.d.ts +++ b/types/revalidator/index.d.ts @@ -88,6 +88,8 @@ declare module Revalidator { conform?: (value: any, data?: T) => boolean; /**Value is valid only if the dependent value is valid */ dependencies?: string; + /**Property to describe items for type: 'array' */ + items?: ISchema|JSONSchema } } @@ -95,4 +97,4 @@ declare var revalidator: Revalidator.RevalidatorStatic; declare module "revalidator" { export = revalidator; -} \ No newline at end of file +} diff --git a/types/revalidator/tslint.json b/types/revalidator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/revalidator/tslint.json +++ b/types/revalidator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/reveal/tslint.json b/types/reveal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/reveal/tslint.json +++ b/types/reveal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rickshaw/tslint.json b/types/rickshaw/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rickshaw/tslint.json +++ b/types/rickshaw/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/riot-api-nodejs/tslint.json b/types/riot-api-nodejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/riot-api-nodejs/tslint.json +++ b/types/riot-api-nodejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/riot-games-api/tslint.json b/types/riot-games-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/riot-games-api/tslint.json +++ b/types/riot-games-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/riot-route/index.d.ts b/types/riot-route/index.d.ts index 453bb185fa..a771b3096d 100644 --- a/types/riot-route/index.d.ts +++ b/types/riot-route/index.d.ts @@ -6,4 +6,4 @@ import route from './lib/index'; -export default route; +export = route; diff --git a/types/riot-route/riot-route-tests.ts b/types/riot-route/riot-route-tests.ts index fab6a2b0df..496c8c7fb4 100644 --- a/types/riot-route/riot-route-tests.ts +++ b/types/riot-route/riot-route-tests.ts @@ -1,4 +1,4 @@ -import { default as route } from 'riot-route'; +import route = require('riot-route'); import routeFromTag from 'riot-route/lib/tag'; /* () */ diff --git a/types/riotcontrol/tslint.json b/types/riotcontrol/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/riotcontrol/tslint.json +++ b/types/riotcontrol/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/riotjs/tslint.json b/types/riotjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/riotjs/tslint.json +++ b/types/riotjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rison/tslint.json b/types/rison/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rison/tslint.json +++ b/types/rison/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rollup-plugin-json/index.d.ts b/types/rollup-plugin-json/index.d.ts index b6b61b25e5..c906d90e8a 100644 --- a/types/rollup-plugin-json/index.d.ts +++ b/types/rollup-plugin-json/index.d.ts @@ -8,22 +8,25 @@ /// import { Plugin } from 'rollup'; -export interface Options { - /** - * All JSON files will be parsed by default, but you can also specifically include/exclude files - */ - include?: string | string[]; - exclude?: string | string[]; - /** - * for tree-shaking, properties will be declared as variables, using either `var` or `const` - * @default false - */ - preferConst?: boolean; - /** - * specify indentation for the generated default export — defaults to '\t' - * @default '\t' - */ - indent?: string; +declare namespace json { + interface Options { + /** + * All JSON files will be parsed by default, but you can also specifically include/exclude files + */ + include?: string | string[]; + exclude?: string | string[]; + /** + * for tree-shaking, properties will be declared as variables, using either `var` or `const` + * @default false + */ + preferConst?: boolean; + /** + * specify indentation for the generated default export — defaults to '\t' + * @default '\t' + */ + indent?: string; + } } -export default function json(options?: Options): Plugin; +declare function json(options?: json.Options): Plugin; +export = json; diff --git a/types/rollup-plugin-json/rollup-plugin-json-tests.ts b/types/rollup-plugin-json/rollup-plugin-json-tests.ts index 32e7b26b7a..ed3ddc2b72 100644 --- a/types/rollup-plugin-json/rollup-plugin-json-tests.ts +++ b/types/rollup-plugin-json/rollup-plugin-json-tests.ts @@ -1,4 +1,4 @@ -import json from 'rollup-plugin-json'; +import json = require('rollup-plugin-json'); json(); // $ExpectType Plugin diff --git a/types/rosie/tslint.json b/types/rosie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rosie/tslint.json +++ b/types/rosie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/roslib/tslint.json b/types/roslib/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/roslib/tslint.json +++ b/types/roslib/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/routie/tslint.json b/types/routie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/routie/tslint.json +++ b/types/routie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/royalslider/tslint.json b/types/royalslider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/royalslider/tslint.json +++ b/types/royalslider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rpio/tslint.json b/types/rpio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rpio/tslint.json +++ b/types/rpio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rsmq-worker/tslint.json b/types/rsmq-worker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rsmq-worker/tslint.json +++ b/types/rsmq-worker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rsmq/tslint.json b/types/rsmq/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rsmq/tslint.json +++ b/types/rsmq/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rss/tslint.json b/types/rss/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rss/tslint.json +++ b/types/rss/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rsvp/tslint.json b/types/rsvp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rsvp/tslint.json +++ b/types/rsvp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rsync/tslint.json b/types/rsync/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rsync/tslint.json +++ b/types/rsync/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rtree/tslint.json b/types/rtree/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rtree/tslint.json +++ b/types/rtree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/run-sequence/tslint.json b/types/run-sequence/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/run-sequence/tslint.json +++ b/types/run-sequence/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rx-angular/tslint.json b/types/rx-angular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rx-angular/tslint.json +++ b/types/rx-angular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rx-core-binding/tslint.json b/types/rx-core-binding/tslint.json index 9bd93a98fd..84f4d93abb 100644 --- a/types/rx-core-binding/tslint.json +++ b/types/rx-core-binding/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-declare-current-package": false, "no-empty-interface": false, "interface-name": false, diff --git a/types/rx-core/tslint.json b/types/rx-core/tslint.json index af05206613..ed19039904 100644 --- a/types/rx-core/tslint.json +++ b/types/rx-core/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "unified-signatures": false, "no-declare-current-package": false, "no-empty-interface": false, diff --git a/types/rx-jquery/tslint.json b/types/rx-jquery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rx-jquery/tslint.json +++ b/types/rx-jquery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rx-lite-aggregates/tslint.json b/types/rx-lite-aggregates/tslint.json index 3043cd814e..5b5adfb0bd 100644 --- a/types/rx-lite-aggregates/tslint.json +++ b/types/rx-lite-aggregates/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODO "dt-header": false, + "npm-naming": false, "unified-signatures": false, "no-declare-current-package": false, "no-single-declare-module": false diff --git a/types/rx-lite-coincidence/tslint.json b/types/rx-lite-coincidence/tslint.json index 0651031b32..b84945c7b5 100644 --- a/types/rx-lite-coincidence/tslint.json +++ b/types/rx-lite-coincidence/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "unified-signatures": false, "no-declare-current-package": false, "no-single-declare-module": false, diff --git a/types/rx-lite-time/tslint.json b/types/rx-lite-time/tslint.json index 0651031b32..b84945c7b5 100644 --- a/types/rx-lite-time/tslint.json +++ b/types/rx-lite-time/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "unified-signatures": false, "no-declare-current-package": false, "no-single-declare-module": false, diff --git a/types/rx-lite-virtualtime/tslint.json b/types/rx-lite-virtualtime/tslint.json index d132ae15db..fe197d7c2b 100644 --- a/types/rx-lite-virtualtime/tslint.json +++ b/types/rx-lite-virtualtime/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "interface-name": false, "no-declare-current-package": false, "no-empty-interface": false, diff --git a/types/rx-lite/tslint.json b/types/rx-lite/tslint.json index 21bc7a553d..f653226b64 100644 --- a/types/rx-lite/tslint.json +++ b/types/rx-lite/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "unified-signatures": false, "no-declare-current-package": false, "no-empty-interface": false, diff --git a/types/rx-node/tslint.json b/types/rx-node/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rx-node/tslint.json +++ b/types/rx-node/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rx.wamp/tslint.json b/types/rx.wamp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/rx.wamp/tslint.json +++ b/types/rx.wamp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/rx/tslint.json b/types/rx/tslint.json index 6d192e7cef..3a5b262091 100644 --- a/types/rx/tslint.json +++ b/types/rx/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "dt-header": false, + "npm-naming": false, "no-declare-current-package": false, "no-single-declare-module": false } diff --git a/types/s3-uploader/tslint.json b/types/s3-uploader/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/s3-uploader/tslint.json +++ b/types/s3-uploader/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/s3rver/tslint.json b/types/s3rver/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/s3rver/tslint.json +++ b/types/s3rver/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/safari-extension-content/tslint.json b/types/safari-extension-content/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/safari-extension-content/tslint.json +++ b/types/safari-extension-content/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/safari-extension/tslint.json b/types/safari-extension/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/safari-extension/tslint.json +++ b/types/safari-extension/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sails.io.js/tslint.json b/types/sails.io.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sails.io.js/tslint.json +++ b/types/sails.io.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/saml2-js/tslint.json b/types/saml2-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/saml2-js/tslint.json +++ b/types/saml2-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/samlp/tslint.json b/types/samlp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/samlp/tslint.json +++ b/types/samlp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sammy/tslint.json b/types/sammy/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/sammy/tslint.json +++ b/types/sammy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sandboxed-module/tslint.json b/types/sandboxed-module/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sandboxed-module/tslint.json +++ b/types/sandboxed-module/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sanitize-filename/tslint.json b/types/sanitize-filename/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sanitize-filename/tslint.json +++ b/types/sanitize-filename/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sanitize-html/tslint.json b/types/sanitize-html/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sanitize-html/tslint.json +++ b/types/sanitize-html/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sanitizer/tslint.json b/types/sanitizer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sanitizer/tslint.json +++ b/types/sanitizer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sass-graph/tslint.json b/types/sass-graph/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sass-graph/tslint.json +++ b/types/sass-graph/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sat/tslint.json b/types/sat/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sat/tslint.json +++ b/types/sat/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/satnav/tslint.json b/types/satnav/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/satnav/tslint.json +++ b/types/satnav/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/sax/tslint.json b/types/sax/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/sax/tslint.json +++ b/types/sax/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/scalike/tslint.json b/types/scalike/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/scalike/tslint.json +++ b/types/scalike/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/screenfull/index.d.ts b/types/screenfull/index.d.ts deleted file mode 100644 index 2c7b93e453..0000000000 --- a/types/screenfull/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Type definitions for screenfull.js 4.0 -// Project: https://github.com/sindresorhus/screenfull.js -// Definitions by: Ilia Choly -// lionelb -// Joel Shepherd -// BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.5 - -export = screenfull; -export as namespace screenfull; - -declare const screenfull: screenfull.Screenfull | false; - -declare namespace screenfull { - interface Screenfull { - /** - * Returns a boolean whether fullscreen is active. - */ - readonly isFullscreen: boolean; - /** - * Returns the element currently in fullscreen, otherwise `null`. - */ - readonly element: Element | null; - /** - * Returns a boolean whether you are allowed to enter fullscreen. If your page is inside an `